Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace GeneratedText

The text generated during each run.

Properties

Optional finishReason

finishReason: undefined | string

The reason why the model stopped generating tokens.

A model stops generating tokens if the model hits a natural stop point or reaches a provided stop sequence.

id

id: string

A unique identifier for this text generation.

likelihood

likelihood: number

The overall likelihood of the generated text.

When a large language model generates a new token for the output text, a likelihood is assigned to all tokens, where tokens with higher likelihoods are more likely to follow the current token. For example, it's more likely that the word favorite is followed by the word food or book rather than the word zebra. A lower likelihood means that it's less likely that token follows the current token. Note: Numbers greater than Number.MAX_SAFE_INTEGER will result in rounding issues.

text

text: string

The generated text.

Optional tokenLikelihoods

tokenLikelihoods: Array<TokenLikelihood>

A collection of generated tokens and their corresponding likelihoods.

Functions

getDeserializedJsonObj

getJsonObj