Class UsageMetadata.Builder
- Enclosing class:
- UsageMetadata
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract UsageMetadatabuild()abstract UsageMetadata.BuildercachedContentTokenCount(Integer cachedContentTokenCount) Setter for cachedContentTokenCount.cacheTokensDetails(ModalityTokenCount... cacheTokensDetails) Setter for cacheTokensDetails.cacheTokensDetails(ModalityTokenCount.Builder... cacheTokensDetailsBuilders) Setter for cacheTokensDetails builder.abstract UsageMetadata.BuildercacheTokensDetails(List<ModalityTokenCount> cacheTokensDetails) Setter for cacheTokensDetails.Clears the value of cachedContentTokenCount field.Clears the value of cacheTokensDetails field.Clears the value of promptTokenCount field.Clears the value of promptTokensDetails field.Clears the value of responseTokenCount field.Clears the value of responseTokensDetails field.Clears the value of serviceTier field.Clears the value of thoughtsTokenCount field.Clears the value of toolUsePromptTokenCount field.Clears the value of toolUsePromptTokensDetails field.Clears the value of totalTokenCount field.Clears the value of trafficType field.abstract UsageMetadata.BuilderpromptTokenCount(Integer promptTokenCount) Setter for promptTokenCount.promptTokensDetails(ModalityTokenCount... promptTokensDetails) Setter for promptTokensDetails.promptTokensDetails(ModalityTokenCount.Builder... promptTokensDetailsBuilders) Setter for promptTokensDetails builder.abstract UsageMetadata.BuilderpromptTokensDetails(List<ModalityTokenCount> promptTokensDetails) Setter for promptTokensDetails.abstract UsageMetadata.BuilderresponseTokenCount(Integer responseTokenCount) Setter for responseTokenCount.responseTokensDetails(ModalityTokenCount... responseTokensDetails) Setter for responseTokensDetails.responseTokensDetails(ModalityTokenCount.Builder... responseTokensDetailsBuilders) Setter for responseTokensDetails builder.abstract UsageMetadata.BuilderresponseTokensDetails(List<ModalityTokenCount> responseTokensDetails) Setter for responseTokensDetails.abstract UsageMetadata.BuilderserviceTier(ServiceTier serviceTier) Setter for serviceTier.serviceTier(ServiceTier.Known knownType) Setter for serviceTier given a known enum.serviceTier(String serviceTier) Setter for serviceTier given a string.abstract UsageMetadata.BuilderthoughtsTokenCount(Integer thoughtsTokenCount) Setter for thoughtsTokenCount.abstract UsageMetadata.BuildertoolUsePromptTokenCount(Integer toolUsePromptTokenCount) Setter for toolUsePromptTokenCount.toolUsePromptTokensDetails(ModalityTokenCount... toolUsePromptTokensDetails) Setter for toolUsePromptTokensDetails.toolUsePromptTokensDetails(ModalityTokenCount.Builder... toolUsePromptTokensDetailsBuilders) Setter for toolUsePromptTokensDetails builder.abstract UsageMetadata.BuildertoolUsePromptTokensDetails(List<ModalityTokenCount> toolUsePromptTokensDetails) Setter for toolUsePromptTokensDetails.abstract UsageMetadata.BuildertotalTokenCount(Integer totalTokenCount) Setter for totalTokenCount.abstract UsageMetadata.BuildertrafficType(TrafficType trafficType) Setter for trafficType.trafficType(TrafficType.Known knownType) Setter for trafficType given a known enum.trafficType(String trafficType) Setter for trafficType given a string.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
promptTokenCount
Setter for promptTokenCount.promptTokenCount: The total number of tokens in the prompt. This includes any text, images, or other media provided in the request. When `cached_content` is set, this also includes the number of tokens in the cached content.
-
clearPromptTokenCount
Clears the value of promptTokenCount field. -
cachedContentTokenCount
Setter for cachedContentTokenCount.cachedContentTokenCount: Output only. The number of tokens in the cached content that was used for this request.
-
clearCachedContentTokenCount
Clears the value of cachedContentTokenCount field. -
responseTokenCount
Setter for responseTokenCount.responseTokenCount: Total number of tokens across all the generated response candidates.
-
clearResponseTokenCount
Clears the value of responseTokenCount field. -
toolUsePromptTokenCount
Setter for toolUsePromptTokenCount.toolUsePromptTokenCount: Output only. The number of tokens in the results from tool executions, which are provided back to the model as input, if applicable.
-
clearToolUsePromptTokenCount
Clears the value of toolUsePromptTokenCount field. -
thoughtsTokenCount
Setter for thoughtsTokenCount.thoughtsTokenCount: Output only. The number of tokens that were part of the model's generated "thoughts" output, if applicable.
-
clearThoughtsTokenCount
Clears the value of thoughtsTokenCount field. -
totalTokenCount
Setter for totalTokenCount.totalTokenCount: The total number of tokens for the entire request. This is the sum of `prompt_token_count`, `candidates_token_count`, `tool_use_prompt_token_count`, and `thoughts_token_count`.
-
clearTotalTokenCount
Clears the value of totalTokenCount field. -
promptTokensDetails
public abstract UsageMetadata.Builder promptTokensDetails(List<ModalityTokenCount> promptTokensDetails) Setter for promptTokensDetails.promptTokensDetails: Output only. A detailed breakdown of the token count for each modality in the prompt.
-
promptTokensDetails
@CanIgnoreReturnValue public UsageMetadata.Builder promptTokensDetails(ModalityTokenCount... promptTokensDetails) Setter for promptTokensDetails.promptTokensDetails: Output only. A detailed breakdown of the token count for each modality in the prompt.
-
promptTokensDetails
@CanIgnoreReturnValue public UsageMetadata.Builder promptTokensDetails(ModalityTokenCount.Builder... promptTokensDetailsBuilders) Setter for promptTokensDetails builder.promptTokensDetails: Output only. A detailed breakdown of the token count for each modality in the prompt.
-
clearPromptTokensDetails
Clears the value of promptTokensDetails field. -
cacheTokensDetails
public abstract UsageMetadata.Builder cacheTokensDetails(List<ModalityTokenCount> cacheTokensDetails) Setter for cacheTokensDetails.cacheTokensDetails: Output only. A detailed breakdown of the token count for each modality in the cached content.
-
cacheTokensDetails
@CanIgnoreReturnValue public UsageMetadata.Builder cacheTokensDetails(ModalityTokenCount... cacheTokensDetails) Setter for cacheTokensDetails.cacheTokensDetails: Output only. A detailed breakdown of the token count for each modality in the cached content.
-
cacheTokensDetails
@CanIgnoreReturnValue public UsageMetadata.Builder cacheTokensDetails(ModalityTokenCount.Builder... cacheTokensDetailsBuilders) Setter for cacheTokensDetails builder.cacheTokensDetails: Output only. A detailed breakdown of the token count for each modality in the cached content.
-
clearCacheTokensDetails
Clears the value of cacheTokensDetails field. -
responseTokensDetails
public abstract UsageMetadata.Builder responseTokensDetails(List<ModalityTokenCount> responseTokensDetails) Setter for responseTokensDetails.responseTokensDetails: List of modalities that were returned in the response.
-
responseTokensDetails
@CanIgnoreReturnValue public UsageMetadata.Builder responseTokensDetails(ModalityTokenCount... responseTokensDetails) Setter for responseTokensDetails.responseTokensDetails: List of modalities that were returned in the response.
-
responseTokensDetails
@CanIgnoreReturnValue public UsageMetadata.Builder responseTokensDetails(ModalityTokenCount.Builder... responseTokensDetailsBuilders) Setter for responseTokensDetails builder.responseTokensDetails: List of modalities that were returned in the response.
-
clearResponseTokensDetails
Clears the value of responseTokensDetails field. -
toolUsePromptTokensDetails
public abstract UsageMetadata.Builder toolUsePromptTokensDetails(List<ModalityTokenCount> toolUsePromptTokensDetails) Setter for toolUsePromptTokensDetails.toolUsePromptTokensDetails: Output only. A detailed breakdown by modality of the token counts from the results of tool executions, which are provided back to the model as input.
-
toolUsePromptTokensDetails
@CanIgnoreReturnValue public UsageMetadata.Builder toolUsePromptTokensDetails(ModalityTokenCount... toolUsePromptTokensDetails) Setter for toolUsePromptTokensDetails.toolUsePromptTokensDetails: Output only. A detailed breakdown by modality of the token counts from the results of tool executions, which are provided back to the model as input.
-
toolUsePromptTokensDetails
@CanIgnoreReturnValue public UsageMetadata.Builder toolUsePromptTokensDetails(ModalityTokenCount.Builder... toolUsePromptTokensDetailsBuilders) Setter for toolUsePromptTokensDetails builder.toolUsePromptTokensDetails: Output only. A detailed breakdown by modality of the token counts from the results of tool executions, which are provided back to the model as input.
-
clearToolUsePromptTokensDetails
Clears the value of toolUsePromptTokensDetails field. -
trafficType
Setter for trafficType.trafficType: Output only. The traffic type for this request. This field is not supported in Gemini API.
-
clearTrafficType
Clears the value of trafficType field. -
trafficType
Setter for trafficType given a known enum.trafficType: Output only. The traffic type for this request. This field is not supported in Gemini API.
-
trafficType
Setter for trafficType given a string.trafficType: Output only. The traffic type for this request. This field is not supported in Gemini API.
-
serviceTier
Setter for serviceTier.serviceTier: Output only. Service tier of the request. This field is not supported in Vertex AI.
-
clearServiceTier
Clears the value of serviceTier field. -
serviceTier
Setter for serviceTier given a known enum.serviceTier: Output only. Service tier of the request. This field is not supported in Vertex AI.
-
serviceTier
Setter for serviceTier given a string.serviceTier: Output only. Service tier of the request. This field is not supported in Vertex AI.
-
build
-