Package com.google.genai.types
Class GenerateContentResponseUsageMetadata
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.GenerateContentResponseUsageMetadata
Usage metadata about response(s).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for GenerateContentResponseUsageMetadata. -
Field Summary
Fields inherited from class com.google.genai.JsonSerializable
objectMapper -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Instantiates a builder for GenerateContentResponseUsageMetadata.Output only.Number of tokens in the response(s).Deserializes a JSON string to a GenerateContentResponseUsageMetadata object.Number of tokens in the request.Creates a builder with the same values as this instance.Total token count for prompt and response candidates.Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, toJson, toJsonNode, toJsonString
-
Constructor Details
-
GenerateContentResponseUsageMetadata
public GenerateContentResponseUsageMetadata()
-
-
Method Details
-
cachedContentTokenCount
Output only. Number of tokens in the cached part in the input (the cached content). -
candidatesTokenCount
Number of tokens in the response(s). -
promptTokenCount
Number of tokens in the request. When `cached_content` is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content. -
totalTokenCount
Total token count for prompt and response candidates. -
builder
Instantiates a builder for GenerateContentResponseUsageMetadata. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a GenerateContentResponseUsageMetadata object.
-