Class UsageMetadata.Builder (3.82.0)

public static final class UsageMetadata.Builder extends GeneratedMessageV3.Builder<UsageMetadata.Builder> implements UsageMetadataOrBuilder

Usage metadata about the content generation request and response. This message provides a detailed breakdown of token usage and other relevant metrics.

Protobuf type google.cloud.aiplatform.v1.UsageMetadata

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllCacheTokensDetails(Iterable<? extends ModalityTokenCount> values)

public UsageMetadata.Builder addAllCacheTokensDetails(Iterable<? extends ModalityTokenCount> values)

Output only. A detailed breakdown of the token count for each modality in the cached content.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
values Iterable<? extends com.google.cloud.aiplatform.v1.ModalityTokenCount>
Returns
Type Description
UsageMetadata.Builder

addAllCandidatesTokensDetails(Iterable<? extends ModalityTokenCount> values)

public UsageMetadata.Builder addAllCandidatesTokensDetails(Iterable<? extends ModalityTokenCount> values)

Output only. A detailed breakdown of the token count for each modality in the generated candidates.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
values Iterable<? extends com.google.cloud.aiplatform.v1.ModalityTokenCount>
Returns
Type Description
UsageMetadata.Builder

addAllPromptTokensDetails(Iterable<? extends ModalityTokenCount> values)

public UsageMetadata.Builder addAllPromptTokensDetails(Iterable<? extends ModalityTokenCount> values)

Output only. A detailed breakdown of the token count for each modality in the prompt.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
values Iterable<? extends com.google.cloud.aiplatform.v1.ModalityTokenCount>
Returns
Type Description
UsageMetadata.Builder

addAllToolUsePromptTokensDetails(Iterable<? extends ModalityTokenCount> values)

public UsageMetadata.Builder addAllToolUsePromptTokensDetails(Iterable<? extends ModalityTokenCount> values)

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.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
values Iterable<? extends com.google.cloud.aiplatform.v1.ModalityTokenCount>
Returns
Type Description
UsageMetadata.Builder

addCacheTokensDetails(ModalityTokenCount value)

public UsageMetadata.Builder addCacheTokensDetails(ModalityTokenCount value)

Output only. A detailed breakdown of the token count for each modality in the cached content.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value ModalityTokenCount
Returns
Type Description
UsageMetadata.Builder

addCacheTokensDetails(ModalityTokenCount.Builder builderForValue)

public UsageMetadata.Builder addCacheTokensDetails(ModalityTokenCount.Builder builderForValue)

Output only. A detailed breakdown of the token count for each modality in the cached content.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue ModalityTokenCount.Builder
Returns
Type Description
UsageMetadata.Builder

addCacheTokensDetails(int index, ModalityTokenCount value)

public UsageMetadata.Builder addCacheTokensDetails(int index, ModalityTokenCount value)

Output only. A detailed breakdown of the token count for each modality in the cached content.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
value ModalityTokenCount
Returns
Type Description
UsageMetadata.Builder

addCacheTokensDetails(int index, ModalityTokenCount.Builder builderForValue)

public UsageMetadata.Builder addCacheTokensDetails(int index, ModalityTokenCount.Builder builderForValue)

Output only. A detailed breakdown of the token count for each modality in the cached content.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
builderForValue ModalityTokenCount.Builder
Returns
Type Description
UsageMetadata.Builder

addCacheTokensDetailsBuilder()

public ModalityTokenCount.Builder addCacheTokensDetailsBuilder()

Output only. A detailed breakdown of the token count for each modality in the cached content.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ModalityTokenCount.Builder

addCacheTokensDetailsBuilder(int index)

public ModalityTokenCount.Builder addCacheTokensDetailsBuilder(int index)

Output only. A detailed breakdown of the token count for each modality in the cached content.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
ModalityTokenCount.Builder

addCandidatesTokensDetails(ModalityTokenCount value)

public UsageMetadata.Builder addCandidatesTokensDetails(ModalityTokenCount value)

Output only. A detailed breakdown of the token count for each modality in the generated candidates.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value ModalityTokenCount
Returns
Type Description
UsageMetadata.Builder

addCandidatesTokensDetails(ModalityTokenCount.Builder builderForValue)

public UsageMetadata.Builder addCandidatesTokensDetails(ModalityTokenCount.Builder builderForValue)

Output only. A detailed breakdown of the token count for each modality in the generated candidates.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue ModalityTokenCount.Builder
Returns
Type Description
UsageMetadata.Builder

addCandidatesTokensDetails(int index, ModalityTokenCount value)

public UsageMetadata.Builder addCandidatesTokensDetails(int index, ModalityTokenCount value)

Output only. A detailed breakdown of the token count for each modality in the generated candidates.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
value ModalityTokenCount
Returns
Type Description
UsageMetadata.Builder

addCandidatesTokensDetails(int index, ModalityTokenCount.Builder builderForValue)

public UsageMetadata.Builder addCandidatesTokensDetails(int index, ModalityTokenCount.Builder builderForValue)

Output only. A detailed breakdown of the token count for each modality in the generated candidates.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
builderForValue ModalityTokenCount.Builder
Returns
Type Description
UsageMetadata.Builder

addCandidatesTokensDetailsBuilder()

public ModalityTokenCount.Builder addCandidatesTokensDetailsBuilder()

Output only. A detailed breakdown of the token count for each modality in the generated candidates.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ModalityTokenCount.Builder

addCandidatesTokensDetailsBuilder(int index)

public ModalityTokenCount.Builder addCandidatesTokensDetailsBuilder(int index)

Output only. A detailed breakdown of the token count for each modality in the generated candidates.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
ModalityTokenCount.Builder

addPromptTokensDetails(ModalityTokenCount value)

public UsageMetadata.Builder addPromptTokensDetails(ModalityTokenCount value)

Output only. A detailed breakdown of the token count for each modality in the prompt.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value ModalityTokenCount
Returns
Type Description
UsageMetadata.Builder

addPromptTokensDetails(ModalityTokenCount.Builder builderForValue)

public UsageMetadata.Builder addPromptTokensDetails(ModalityTokenCount.Builder builderForValue)

Output only. A detailed breakdown of the token count for each modality in the prompt.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue ModalityTokenCount.Builder
Returns
Type Description
UsageMetadata.Builder

addPromptTokensDetails(int index, ModalityTokenCount value)

public UsageMetadata.Builder addPromptTokensDetails(int index, ModalityTokenCount value)

Output only. A detailed breakdown of the token count for each modality in the prompt.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
value ModalityTokenCount
Returns
Type Description
UsageMetadata.Builder

addPromptTokensDetails(int index, ModalityTokenCount.Builder builderForValue)

public UsageMetadata.Builder addPromptTokensDetails(int index, ModalityTokenCount.Builder builderForValue)

Output only. A detailed breakdown of the token count for each modality in the prompt.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
builderForValue ModalityTokenCount.Builder
Returns
Type Description
UsageMetadata.Builder

addPromptTokensDetailsBuilder()

public ModalityTokenCount.Builder addPromptTokensDetailsBuilder()

Output only. A detailed breakdown of the token count for each modality in the prompt.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ModalityTokenCount.Builder

addPromptTokensDetailsBuilder(int index)

public ModalityTokenCount.Builder addPromptTokensDetailsBuilder(int index)

Output only. A detailed breakdown of the token count for each modality in the prompt.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
ModalityTokenCount.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public UsageMetadata.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
UsageMetadata.Builder
Overrides

addToolUsePromptTokensDetails(ModalityTokenCount value)

public UsageMetadata.Builder addToolUsePromptTokensDetails(ModalityTokenCount value)

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.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value ModalityTokenCount
Returns
Type Description
UsageMetadata.Builder

addToolUsePromptTokensDetails(ModalityTokenCount.Builder builderForValue)

public UsageMetadata.Builder addToolUsePromptTokensDetails(ModalityTokenCount.Builder builderForValue)

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.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue ModalityTokenCount.Builder
Returns
Type Description
UsageMetadata.Builder

addToolUsePromptTokensDetails(int index, ModalityTokenCount value)

public UsageMetadata.Builder addToolUsePromptTokensDetails(int index, ModalityTokenCount value)

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.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
value ModalityTokenCount
Returns
Type Description
UsageMetadata.Builder

addToolUsePromptTokensDetails(int index, ModalityTokenCount.Builder builderForValue)

public UsageMetadata.Builder addToolUsePromptTokensDetails(int index, ModalityTokenCount.Builder builderForValue)

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.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
builderForValue ModalityTokenCount.Builder
Returns
Type Description
UsageMetadata.Builder

addToolUsePromptTokensDetailsBuilder()

public ModalityTokenCount.Builder addToolUsePromptTokensDetailsBuilder()

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.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ModalityTokenCount.Builder

addToolUsePromptTokensDetailsBuilder(int index)

public ModalityTokenCount.Builder addToolUsePromptTokensDetailsBuilder(int index)

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.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
ModalityTokenCount.Builder

build()

public UsageMetadata build()
Returns
Type Description
UsageMetadata

buildPartial()

public UsageMetadata buildPartial()
Returns
Type Description
UsageMetadata

clear()

public UsageMetadata.Builder clear()
Returns
Type Description
UsageMetadata.Builder
Overrides

clearCacheTokensDetails()

public UsageMetadata.Builder clearCacheTokensDetails()

Output only. A detailed breakdown of the token count for each modality in the cached content.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
UsageMetadata.Builder

clearCachedContentTokenCount()

public UsageMetadata.Builder clearCachedContentTokenCount()

Output only. The number of tokens in the cached content that was used for this request.

int32 cached_content_token_count = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
UsageMetadata.Builder

This builder for chaining.

clearCandidatesTokenCount()

public UsageMetadata.Builder clearCandidatesTokenCount()

The total number of tokens in the generated candidates.

int32 candidates_token_count = 2;

Returns
Type Description
UsageMetadata.Builder

This builder for chaining.

clearCandidatesTokensDetails()

public UsageMetadata.Builder clearCandidatesTokensDetails()

Output only. A detailed breakdown of the token count for each modality in the generated candidates.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
UsageMetadata.Builder

clearField(Descriptors.FieldDescriptor field)

public UsageMetadata.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
UsageMetadata.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public UsageMetadata.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
UsageMetadata.Builder
Overrides

clearPromptTokenCount()

public UsageMetadata.Builder clearPromptTokenCount()

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.

int32 prompt_token_count = 1;

Returns
Type Description
UsageMetadata.Builder

This builder for chaining.

clearPromptTokensDetails()

public UsageMetadata.Builder clearPromptTokensDetails()

Output only. A detailed breakdown of the token count for each modality in the prompt.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
UsageMetadata.Builder

clearThoughtsTokenCount()

public UsageMetadata.Builder clearThoughtsTokenCount()

Output only. The number of tokens that were part of the model's generated "thoughts" output, if applicable.

int32 thoughts_token_count = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
UsageMetadata.Builder

This builder for chaining.

clearToolUsePromptTokenCount()

public UsageMetadata.Builder clearToolUsePromptTokenCount()

Output only. The number of tokens in the results from tool executions, which are provided back to the model as input, if applicable.

int32 tool_use_prompt_token_count = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
UsageMetadata.Builder

This builder for chaining.

clearToolUsePromptTokensDetails()

public UsageMetadata.Builder clearToolUsePromptTokensDetails()

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.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
UsageMetadata.Builder

clearTotalTokenCount()

public UsageMetadata.Builder clearTotalTokenCount()

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.

int32 total_token_count = 3;

Returns
Type Description
UsageMetadata.Builder

This builder for chaining.

clearTrafficType()

public UsageMetadata.Builder clearTrafficType()

Output only. The traffic type for this request.

.google.cloud.aiplatform.v1.UsageMetadata.TrafficType traffic_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
UsageMetadata.Builder

This builder for chaining.

clone()

public UsageMetadata.Builder clone()
Returns
Type Description
UsageMetadata.Builder
Overrides

getCacheTokensDetails(int index)

public ModalityTokenCount getCacheTokensDetails(int index)

Output only. A detailed breakdown of the token count for each modality in the cached content.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
ModalityTokenCount

getCacheTokensDetailsBuilder(int index)

public ModalityTokenCount.Builder getCacheTokensDetailsBuilder(int index)

Output only. A detailed breakdown of the token count for each modality in the cached content.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
ModalityTokenCount.Builder

getCacheTokensDetailsBuilderList()

public List<ModalityTokenCount.Builder> getCacheTokensDetailsBuilderList()

Output only. A detailed breakdown of the token count for each modality in the cached content.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<Builder>

getCacheTokensDetailsCount()

public int getCacheTokensDetailsCount()

Output only. A detailed breakdown of the token count for each modality in the cached content.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

getCacheTokensDetailsList()

public List<ModalityTokenCount> getCacheTokensDetailsList()

Output only. A detailed breakdown of the token count for each modality in the cached content.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<ModalityTokenCount>

getCacheTokensDetailsOrBuilder(int index)

public ModalityTokenCountOrBuilder getCacheTokensDetailsOrBuilder(int index)

Output only. A detailed breakdown of the token count for each modality in the cached content.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
ModalityTokenCountOrBuilder

getCacheTokensDetailsOrBuilderList()

public List<? extends ModalityTokenCountOrBuilder> getCacheTokensDetailsOrBuilderList()

Output only. A detailed breakdown of the token count for each modality in the cached content.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<? extends com.google.cloud.aiplatform.v1.ModalityTokenCountOrBuilder>

getCachedContentTokenCount()

public int getCachedContentTokenCount()

Output only. The number of tokens in the cached content that was used for this request.

int32 cached_content_token_count = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

The cachedContentTokenCount.

getCandidatesTokenCount()

public int getCandidatesTokenCount()

The total number of tokens in the generated candidates.

int32 candidates_token_count = 2;

Returns
Type Description
int

The candidatesTokenCount.

getCandidatesTokensDetails(int index)

public ModalityTokenCount getCandidatesTokensDetails(int index)

Output only. A detailed breakdown of the token count for each modality in the generated candidates.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
ModalityTokenCount

getCandidatesTokensDetailsBuilder(int index)

public ModalityTokenCount.Builder getCandidatesTokensDetailsBuilder(int index)

Output only. A detailed breakdown of the token count for each modality in the generated candidates.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
ModalityTokenCount.Builder

getCandidatesTokensDetailsBuilderList()

public List<ModalityTokenCount.Builder> getCandidatesTokensDetailsBuilderList()

Output only. A detailed breakdown of the token count for each modality in the generated candidates.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<Builder>

getCandidatesTokensDetailsCount()

public int getCandidatesTokensDetailsCount()

Output only. A detailed breakdown of the token count for each modality in the generated candidates.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

getCandidatesTokensDetailsList()

public List<ModalityTokenCount> getCandidatesTokensDetailsList()

Output only. A detailed breakdown of the token count for each modality in the generated candidates.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<ModalityTokenCount>

getCandidatesTokensDetailsOrBuilder(int index)

public ModalityTokenCountOrBuilder getCandidatesTokensDetailsOrBuilder(int index)

Output only. A detailed breakdown of the token count for each modality in the generated candidates.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
ModalityTokenCountOrBuilder

getCandidatesTokensDetailsOrBuilderList()

public List<? extends ModalityTokenCountOrBuilder> getCandidatesTokensDetailsOrBuilderList()

Output only. A detailed breakdown of the token count for each modality in the generated candidates.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<? extends com.google.cloud.aiplatform.v1.ModalityTokenCountOrBuilder>

getDefaultInstanceForType()

public UsageMetadata getDefaultInstanceForType()
Returns
Type Description
UsageMetadata

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getPromptTokenCount()

public int getPromptTokenCount()

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.

int32 prompt_token_count = 1;

Returns
Type Description
int

The promptTokenCount.

getPromptTokensDetails(int index)

public ModalityTokenCount getPromptTokensDetails(int index)

Output only. A detailed breakdown of the token count for each modality in the prompt.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
ModalityTokenCount

getPromptTokensDetailsBuilder(int index)

public ModalityTokenCount.Builder getPromptTokensDetailsBuilder(int index)

Output only. A detailed breakdown of the token count for each modality in the prompt.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
ModalityTokenCount.Builder

getPromptTokensDetailsBuilderList()

public List<ModalityTokenCount.Builder> getPromptTokensDetailsBuilderList()

Output only. A detailed breakdown of the token count for each modality in the prompt.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<Builder>

getPromptTokensDetailsCount()

public int getPromptTokensDetailsCount()

Output only. A detailed breakdown of the token count for each modality in the prompt.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

getPromptTokensDetailsList()

public List<ModalityTokenCount> getPromptTokensDetailsList()

Output only. A detailed breakdown of the token count for each modality in the prompt.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<ModalityTokenCount>

getPromptTokensDetailsOrBuilder(int index)

public ModalityTokenCountOrBuilder getPromptTokensDetailsOrBuilder(int index)

Output only. A detailed breakdown of the token count for each modality in the prompt.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
ModalityTokenCountOrBuilder

getPromptTokensDetailsOrBuilderList()

public List<? extends ModalityTokenCountOrBuilder> getPromptTokensDetailsOrBuilderList()

Output only. A detailed breakdown of the token count for each modality in the prompt.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<? extends com.google.cloud.aiplatform.v1.ModalityTokenCountOrBuilder>

getThoughtsTokenCount()

public int getThoughtsTokenCount()

Output only. The number of tokens that were part of the model's generated "thoughts" output, if applicable.

int32 thoughts_token_count = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

The thoughtsTokenCount.

getToolUsePromptTokenCount()

public int getToolUsePromptTokenCount()

Output only. The number of tokens in the results from tool executions, which are provided back to the model as input, if applicable.

int32 tool_use_prompt_token_count = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

The toolUsePromptTokenCount.

getToolUsePromptTokensDetails(int index)

public ModalityTokenCount getToolUsePromptTokensDetails(int index)

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.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
ModalityTokenCount

getToolUsePromptTokensDetailsBuilder(int index)

public ModalityTokenCount.Builder getToolUsePromptTokensDetailsBuilder(int index)

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.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
ModalityTokenCount.Builder

getToolUsePromptTokensDetailsBuilderList()

public List<ModalityTokenCount.Builder> getToolUsePromptTokensDetailsBuilderList()

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.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<Builder>

getToolUsePromptTokensDetailsCount()

public int getToolUsePromptTokensDetailsCount()

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.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

getToolUsePromptTokensDetailsList()

public List<ModalityTokenCount> getToolUsePromptTokensDetailsList()

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.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<ModalityTokenCount>

getToolUsePromptTokensDetailsOrBuilder(int index)

public ModalityTokenCountOrBuilder getToolUsePromptTokensDetailsOrBuilder(int index)

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.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
ModalityTokenCountOrBuilder

getToolUsePromptTokensDetailsOrBuilderList()

public List<? extends ModalityTokenCountOrBuilder> getToolUsePromptTokensDetailsOrBuilderList()

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.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<? extends com.google.cloud.aiplatform.v1.ModalityTokenCountOrBuilder>

getTotalTokenCount()

public int getTotalTokenCount()

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.

int32 total_token_count = 3;

Returns
Type Description
int

The totalTokenCount.

getTrafficType()

public UsageMetadata.TrafficType getTrafficType()

Output only. The traffic type for this request.

.google.cloud.aiplatform.v1.UsageMetadata.TrafficType traffic_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
UsageMetadata.TrafficType

The trafficType.

getTrafficTypeValue()

public int getTrafficTypeValue()

Output only. The traffic type for this request.

.google.cloud.aiplatform.v1.UsageMetadata.TrafficType traffic_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

The enum numeric value on the wire for trafficType.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(UsageMetadata other)

public UsageMetadata.Builder mergeFrom(UsageMetadata other)
Parameter
Name Description
other UsageMetadata
Returns
Type Description
UsageMetadata.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public UsageMetadata.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
UsageMetadata.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public UsageMetadata.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
UsageMetadata.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final UsageMetadata.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
UsageMetadata.Builder
Overrides

removeCacheTokensDetails(int index)

public UsageMetadata.Builder removeCacheTokensDetails(int index)

Output only. A detailed breakdown of the token count for each modality in the cached content.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
UsageMetadata.Builder

removeCandidatesTokensDetails(int index)

public UsageMetadata.Builder removeCandidatesTokensDetails(int index)

Output only. A detailed breakdown of the token count for each modality in the generated candidates.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
UsageMetadata.Builder

removePromptTokensDetails(int index)

public UsageMetadata.Builder removePromptTokensDetails(int index)

Output only. A detailed breakdown of the token count for each modality in the prompt.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
UsageMetadata.Builder

removeToolUsePromptTokensDetails(int index)

public UsageMetadata.Builder removeToolUsePromptTokensDetails(int index)

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.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
UsageMetadata.Builder

setCacheTokensDetails(int index, ModalityTokenCount value)

public UsageMetadata.Builder setCacheTokensDetails(int index, ModalityTokenCount value)

Output only. A detailed breakdown of the token count for each modality in the cached content.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
value ModalityTokenCount
Returns
Type Description
UsageMetadata.Builder

setCacheTokensDetails(int index, ModalityTokenCount.Builder builderForValue)

public UsageMetadata.Builder setCacheTokensDetails(int index, ModalityTokenCount.Builder builderForValue)

Output only. A detailed breakdown of the token count for each modality in the cached content.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
builderForValue ModalityTokenCount.Builder
Returns
Type Description
UsageMetadata.Builder

setCachedContentTokenCount(int value)

public UsageMetadata.Builder setCachedContentTokenCount(int value)

Output only. The number of tokens in the cached content that was used for this request.

int32 cached_content_token_count = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value int

The cachedContentTokenCount to set.

Returns
Type Description
UsageMetadata.Builder

This builder for chaining.

setCandidatesTokenCount(int value)

public UsageMetadata.Builder setCandidatesTokenCount(int value)

The total number of tokens in the generated candidates.

int32 candidates_token_count = 2;

Parameter
Name Description
value int

The candidatesTokenCount to set.

Returns
Type Description
UsageMetadata.Builder

This builder for chaining.

setCandidatesTokensDetails(int index, ModalityTokenCount value)

public UsageMetadata.Builder setCandidatesTokensDetails(int index, ModalityTokenCount value)

Output only. A detailed breakdown of the token count for each modality in the generated candidates.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
value ModalityTokenCount
Returns
Type Description
UsageMetadata.Builder

setCandidatesTokensDetails(int index, ModalityTokenCount.Builder builderForValue)

public UsageMetadata.Builder setCandidatesTokensDetails(int index, ModalityTokenCount.Builder builderForValue)

Output only. A detailed breakdown of the token count for each modality in the generated candidates.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
builderForValue ModalityTokenCount.Builder
Returns
Type Description
UsageMetadata.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public UsageMetadata.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
UsageMetadata.Builder
Overrides

setPromptTokenCount(int value)

public UsageMetadata.Builder setPromptTokenCount(int value)

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.

int32 prompt_token_count = 1;

Parameter
Name Description
value int

The promptTokenCount to set.

Returns
Type Description
UsageMetadata.Builder

This builder for chaining.

setPromptTokensDetails(int index, ModalityTokenCount value)

public UsageMetadata.Builder setPromptTokensDetails(int index, ModalityTokenCount value)

Output only. A detailed breakdown of the token count for each modality in the prompt.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
value ModalityTokenCount
Returns
Type Description
UsageMetadata.Builder

setPromptTokensDetails(int index, ModalityTokenCount.Builder builderForValue)

public UsageMetadata.Builder setPromptTokensDetails(int index, ModalityTokenCount.Builder builderForValue)

Output only. A detailed breakdown of the token count for each modality in the prompt.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
builderForValue ModalityTokenCount.Builder
Returns
Type Description
UsageMetadata.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public UsageMetadata.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
UsageMetadata.Builder
Overrides

setThoughtsTokenCount(int value)

public UsageMetadata.Builder setThoughtsTokenCount(int value)

Output only. The number of tokens that were part of the model's generated "thoughts" output, if applicable.

int32 thoughts_token_count = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value int

The thoughtsTokenCount to set.

Returns
Type Description
UsageMetadata.Builder

This builder for chaining.

setToolUsePromptTokenCount(int value)

public UsageMetadata.Builder setToolUsePromptTokenCount(int value)

Output only. The number of tokens in the results from tool executions, which are provided back to the model as input, if applicable.

int32 tool_use_prompt_token_count = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value int

The toolUsePromptTokenCount to set.

Returns
Type Description
UsageMetadata.Builder

This builder for chaining.

setToolUsePromptTokensDetails(int index, ModalityTokenCount value)

public UsageMetadata.Builder setToolUsePromptTokensDetails(int index, ModalityTokenCount value)

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.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
value ModalityTokenCount
Returns
Type Description
UsageMetadata.Builder

setToolUsePromptTokensDetails(int index, ModalityTokenCount.Builder builderForValue)

public UsageMetadata.Builder setToolUsePromptTokensDetails(int index, ModalityTokenCount.Builder builderForValue)

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.

repeated .google.cloud.aiplatform.v1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
Name Description
index int
builderForValue ModalityTokenCount.Builder
Returns
Type Description
UsageMetadata.Builder

setTotalTokenCount(int value)

public UsageMetadata.Builder setTotalTokenCount(int value)

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.

int32 total_token_count = 3;

Parameter
Name Description
value int

The totalTokenCount to set.

Returns
Type Description
UsageMetadata.Builder

This builder for chaining.

setTrafficType(UsageMetadata.TrafficType value)

public UsageMetadata.Builder setTrafficType(UsageMetadata.TrafficType value)

Output only. The traffic type for this request.

.google.cloud.aiplatform.v1.UsageMetadata.TrafficType traffic_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value UsageMetadata.TrafficType

The trafficType to set.

Returns
Type Description
UsageMetadata.Builder

This builder for chaining.

setTrafficTypeValue(int value)

public UsageMetadata.Builder setTrafficTypeValue(int value)

Output only. The traffic type for this request.

.google.cloud.aiplatform.v1.UsageMetadata.TrafficType traffic_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value int

The enum numeric value on the wire for trafficType to set.

Returns
Type Description
UsageMetadata.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final UsageMetadata.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
UsageMetadata.Builder
Overrides