Package com.google.genai.types
Class CountTokensResponse
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.CountTokensResponse
Response for counting tokens.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Builder for CountTokensResponse. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CountTokensResponse.Builder
builder()
Instantiates a builder for CountTokensResponse.Number of tokens in the cached part of the prompt (the cached content).static CountTokensResponse
Deserializes a JSON string to a CountTokensResponse object.abstract Optional<HttpResponse>
Used to retain the full HTTP response.abstract CountTokensResponse.Builder
Creates a builder with the same values as this instance.Total number of tokens.Methods inherited from class com.google.genai.JsonSerializable
stringToJsonNode, toJson
-
Constructor Details
-
CountTokensResponse
public CountTokensResponse()
-
-
Method Details
-
sdkHttpResponse
Used to retain the full HTTP response. -
totalTokens
Total number of tokens. -
cachedContentTokenCount
Number of tokens in the cached part of the prompt (the cached content). -
builder
Instantiates a builder for CountTokensResponse. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a CountTokensResponse object.
-