Package com.google.genai.types
Class LogprobsResultCandidate
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.LogprobsResultCandidate
A single token and its associated log probability.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for LogprobsResultCandidate. -
Field Summary
Fields inherited from class com.google.genai.JsonSerializable
MAX_READ_LENGTH_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Instantiates a builder for LogprobsResultCandidate.static LogprobsResultCandidateDeserializes a JSON string to a LogprobsResultCandidate object.The log probability of this token.abstract LogprobsResultCandidate.BuilderCreates a builder with the same values as this instance.token()The token's string representation.tokenId()The token's numerical ID.Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString
-
Constructor Details
-
LogprobsResultCandidate
public LogprobsResultCandidate()
-
-
Method Details
-
logProbability
The log probability of this token. A higher value indicates that the model was more confident in this token. The log probability can be used to assess the relative likelihood of different tokens and to identify when the model is uncertain. -
token
The token's string representation. -
tokenId
The token's numerical ID. While the `token` field provides the string representation of the token, the `token_id` is the numerical representation that the model uses internally. This can be useful for developers who want to build custom logic based on the model's vocabulary. -
builder
Instantiates a builder for LogprobsResultCandidate. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a LogprobsResultCandidate object.
-