Package com.google.genai.types
Class TokensInfo
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.TokensInfo
Tokens info with a list of tokens and the corresponding list of token ids.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.google.genai.JsonSerializable
MAX_READ_LENGTH_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TokensInfo.Builderbuilder()Instantiates a builder for TokensInfo.static TokensInfoDeserializes a JSON string to a TokensInfo object.role()Optional fields for the role from the corresponding Content.abstract TokensInfo.BuilderCreates a builder with the same values as this instance.tokenIds()A list of token ids from the input.tokens()A list of tokens from the input.Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString
-
Constructor Details
-
TokensInfo
public TokensInfo()
-
-
Method Details
-
role
Optional fields for the role from the corresponding Content. -
tokenIds
A list of token ids from the input. -
tokens
A list of tokens from the input. -
builder
Instantiates a builder for TokensInfo. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a TokensInfo object.
-