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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TokensInfo.Builder
builder()
Instantiates a builder for TokensInfo.static TokensInfo
Deserializes a JSON string to a TokensInfo object.role()
Optional.abstract TokensInfo.Builder
Creates 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
fromJsonString, toJson
-
Constructor Details
-
TokensInfo
public TokensInfo()
-
-
Method Details
-
role
Optional. 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.
-