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 class
Builder for GenerateContentResponseUsageMetadata. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Instantiates a builder for GenerateContentResponseUsageMetadata.Output only.abstract Optional<List<ModalityTokenCount>>
Output only.Number of tokens in the response(s).abstract Optional<List<ModalityTokenCount>>
Output only.Deserializes a JSON string to a GenerateContentResponseUsageMetadata object.Number of tokens in the request.abstract Optional<List<ModalityTokenCount>>
Output only.Output only.Creates a builder with the same values as this instance.Output only.abstract Optional<List<ModalityTokenCount>>
Output only.Total token count for prompt, response candidates, and tool-use prompts (if present).abstract Optional<TrafficType>
Output only.Methods inherited from class com.google.genai.JsonSerializable
stringToJsonNode, toJson
-
Constructor Details
-
GenerateContentResponseUsageMetadata
public GenerateContentResponseUsageMetadata()
-
-
Method Details
-
cacheTokensDetails
Output only. List of modalities of the cached content in the request input. -
cachedContentTokenCount
Output only. Number of tokens in the cached part in the input (the cached content). -
candidatesTokenCount
Number of tokens in the response(s). -
candidatesTokensDetails
Output only. List of modalities that were returned in the response. -
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. -
promptTokensDetails
Output only. List of modalities that were processed in the request input. -
thoughtsTokenCount
Output only. Number of tokens present in thoughts output. -
toolUsePromptTokenCount
Output only. Number of tokens present in tool-use prompt(s). -
toolUsePromptTokensDetails
Output only. List of modalities that were processed for tool-use request inputs. -
totalTokenCount
Total token count for prompt, response candidates, and tool-use prompts (if present). -
trafficType
Output only. Traffic type. This shows whether a request consumes Pay-As-You-Go or Provisioned Throughput quota. -
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.
-