public static class GeneratedText.Builder extends Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
GeneratedText |
build() |
GeneratedText.Builder |
copy(GeneratedText model) |
GeneratedText.Builder |
finishReason(String finishReason)
The reason why the model stopped generating tokens.
|
GeneratedText.Builder |
id(String id)
A unique identifier for this text generation.
|
GeneratedText.Builder |
likelihood(Double likelihood)
The overall likelihood of the generated text.
|
GeneratedText.Builder |
text(String text)
The generated text.
|
GeneratedText.Builder |
tokenLikelihoods(List<TokenLikelihood> tokenLikelihoods)
A collection of generated tokens and their corresponding likelihoods.
|
public GeneratedText.Builder id(String id)
A unique identifier for this text generation.
id
- the value to setpublic GeneratedText.Builder text(String text)
The generated text.
text
- the value to setpublic GeneratedText.Builder likelihood(Double likelihood)
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.
likelihood
- the value to setpublic GeneratedText.Builder finishReason(String finishReason)
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.
finishReason
- the value to setpublic GeneratedText.Builder tokenLikelihoods(List<TokenLikelihood> tokenLikelihoods)
A collection of generated tokens and their corresponding likelihoods.
tokenLikelihoods
- the value to setpublic GeneratedText build()
public GeneratedText.Builder copy(GeneratedText model)
Copyright © 2016–2024. All rights reserved.