Class GenerateContentResponse.UsageMetadata.Builder (3.88.0)

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

Usage metadata about response(s).

Protobuf type google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata

Static Methods

getDescriptor()

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

Methods

addAllCacheTokensDetails(Iterable<? extends ModalityTokenCount> values)

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

Output only. List of modalities of the cached content in the request input.

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
GenerateContentResponse.UsageMetadata.Builder

addAllCandidatesTokensDetails(Iterable<? extends ModalityTokenCount> values)

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

Output only. List of modalities that were returned in the response.

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
GenerateContentResponse.UsageMetadata.Builder

addAllPromptTokensDetails(Iterable<? extends ModalityTokenCount> values)

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

Output only. List of modalities that were processed in the request input.

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
GenerateContentResponse.UsageMetadata.Builder

addAllToolUsePromptTokensDetails(Iterable<? extends ModalityTokenCount> values)

public GenerateContentResponse.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
GenerateContentResponse.UsageMetadata.Builder

addCacheTokensDetails(ModalityTokenCount value)

public GenerateContentResponse.UsageMetadata.Builder addCacheTokensDetails(ModalityTokenCount value)

Output only. List of modalities of the cached content in the request input.

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

Parameter
Name Description
value ModalityTokenCount
Returns
Type Description
GenerateContentResponse.UsageMetadata.Builder

addCacheTokensDetails(ModalityTokenCount.Builder builderForValue)

public GenerateContentResponse.UsageMetadata.Builder addCacheTokensDetails(ModalityTokenCount.Builder builderForValue)

Output only. List of modalities of the cached content in the request input.

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
GenerateContentResponse.UsageMetadata.Builder

addCacheTokensDetails(int index, ModalityTokenCount value)

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

Output only. List of modalities of the cached content in the request input.

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
GenerateContentResponse.UsageMetadata.Builder

addCacheTokensDetails(int index, ModalityTokenCount.Builder builderForValue)

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

Output only. List of modalities of the cached content in the request input.

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
GenerateContentResponse.UsageMetadata.Builder

addCacheTokensDetailsBuilder()

public ModalityTokenCount.Builder addCacheTokensDetailsBuilder()

Output only. List of modalities of the cached content in the request input.

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. List of modalities of the cached content in the request input.

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 GenerateContentResponse.UsageMetadata.Builder addCandidatesTokensDetails(ModalityTokenCount value)

Output only. List of modalities that were returned in the response.

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

Parameter
Name Description
value ModalityTokenCount
Returns
Type Description
GenerateContentResponse.UsageMetadata.Builder

addCandidatesTokensDetails(ModalityTokenCount.Builder builderForValue)

public GenerateContentResponse.UsageMetadata.Builder addCandidatesTokensDetails(ModalityTokenCount.Builder builderForValue)

Output only. List of modalities that were returned in the response.

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
GenerateContentResponse.UsageMetadata.Builder

addCandidatesTokensDetails(int index, ModalityTokenCount value)

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

Output only. List of modalities that were returned in the response.

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
GenerateContentResponse.UsageMetadata.Builder

addCandidatesTokensDetails(int index, ModalityTokenCount.Builder builderForValue)

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

Output only. List of modalities that were returned in the response.

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
GenerateContentResponse.UsageMetadata.Builder

addCandidatesTokensDetailsBuilder()

public ModalityTokenCount.Builder addCandidatesTokensDetailsBuilder()

Output only. List of modalities that were returned in the response.

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. List of modalities that were returned in the response.

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 GenerateContentResponse.UsageMetadata.Builder addPromptTokensDetails(ModalityTokenCount value)

Output only. List of modalities that were processed in the request input.

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

Parameter
Name Description
value ModalityTokenCount
Returns
Type Description
GenerateContentResponse.UsageMetadata.Builder

addPromptTokensDetails(ModalityTokenCount.Builder builderForValue)

public GenerateContentResponse.UsageMetadata.Builder addPromptTokensDetails(ModalityTokenCount.Builder builderForValue)

Output only. List of modalities that were processed in the request input.

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
GenerateContentResponse.UsageMetadata.Builder

addPromptTokensDetails(int index, ModalityTokenCount value)

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

Output only. List of modalities that were processed in the request input.

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
GenerateContentResponse.UsageMetadata.Builder

addPromptTokensDetails(int index, ModalityTokenCount.Builder builderForValue)

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

Output only. List of modalities that were processed in the request input.

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
GenerateContentResponse.UsageMetadata.Builder

addPromptTokensDetailsBuilder()

public ModalityTokenCount.Builder addPromptTokensDetailsBuilder()

Output only. List of modalities that were processed in the request input.

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. List of modalities that were processed in the request input.

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

addToolUsePromptTokensDetails(ModalityTokenCount value)

public GenerateContentResponse.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
GenerateContentResponse.UsageMetadata.Builder

addToolUsePromptTokensDetails(ModalityTokenCount.Builder builderForValue)

public GenerateContentResponse.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
GenerateContentResponse.UsageMetadata.Builder

addToolUsePromptTokensDetails(int index, ModalityTokenCount value)

public GenerateContentResponse.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
GenerateContentResponse.UsageMetadata.Builder

addToolUsePromptTokensDetails(int index, ModalityTokenCount.Builder builderForValue)

public GenerateContentResponse.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
GenerateContentResponse.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 GenerateContentResponse.UsageMetadata build()
Returns
Type Description
GenerateContentResponse.UsageMetadata

buildPartial()

public GenerateContentResponse.UsageMetadata buildPartial()
Returns
Type Description
GenerateContentResponse.UsageMetadata

clear()

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

clearCacheTokensDetails()

public GenerateContentResponse.UsageMetadata.Builder clearCacheTokensDetails()

Output only. List of modalities of the cached content in the request input.

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

Returns
Type Description
GenerateContentResponse.UsageMetadata.Builder

clearCachedContentTokenCount()

public GenerateContentResponse.UsageMetadata.Builder clearCachedContentTokenCount()

Output only. Number of tokens in the cached part in the input (the cached content).

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

Returns
Type Description
GenerateContentResponse.UsageMetadata.Builder

This builder for chaining.

clearCandidatesTokenCount()

public GenerateContentResponse.UsageMetadata.Builder clearCandidatesTokenCount()

Number of tokens in the response(s).

int32 candidates_token_count = 2;

Returns
Type Description
GenerateContentResponse.UsageMetadata.Builder

This builder for chaining.

clearCandidatesTokensDetails()

public GenerateContentResponse.UsageMetadata.Builder clearCandidatesTokensDetails()

Output only. List of modalities that were returned in the response.

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

Returns
Type Description
GenerateContentResponse.UsageMetadata.Builder

clearPromptTokenCount()

public GenerateContentResponse.UsageMetadata.Builder clearPromptTokenCount()

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.

int32 prompt_token_count = 1;

Returns
Type Description
GenerateContentResponse.UsageMetadata.Builder

This builder for chaining.

clearPromptTokensDetails()

public GenerateContentResponse.UsageMetadata.Builder clearPromptTokensDetails()

Output only. List of modalities that were processed in the request input.

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

Returns
Type Description
GenerateContentResponse.UsageMetadata.Builder

clearThoughtsTokenCount()

public GenerateContentResponse.UsageMetadata.Builder clearThoughtsTokenCount()

Output only. Number of tokens present in thoughts output.

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

Returns
Type Description
GenerateContentResponse.UsageMetadata.Builder

This builder for chaining.

clearToolUsePromptTokensDetails()

public GenerateContentResponse.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
GenerateContentResponse.UsageMetadata.Builder

clearTotalTokenCount()

public GenerateContentResponse.UsageMetadata.Builder clearTotalTokenCount()

Total token count for prompt and response candidates.

int32 total_token_count = 3;

Returns
Type Description
GenerateContentResponse.UsageMetadata.Builder

This builder for chaining.

clearTrafficType()

public GenerateContentResponse.UsageMetadata.Builder clearTrafficType()

Output only. The traffic type for this request.

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

Returns
Type Description
GenerateContentResponse.UsageMetadata.Builder

This builder for chaining.

getCacheTokensDetails(int index)

public ModalityTokenCount getCacheTokensDetails(int index)

Output only. List of modalities of the cached content in the request input.

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. List of modalities of the cached content in the request input.

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. List of modalities of the cached content in the request input.

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. List of modalities of the cached content in the request input.

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. List of modalities of the cached content in the request input.

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. List of modalities of the cached content in the request input.

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. List of modalities of the cached content in the request input.

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. Number of tokens in the cached part in the input (the cached content).

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

Returns
Type Description
int

The cachedContentTokenCount.

getCandidatesTokenCount()

public int getCandidatesTokenCount()

Number of tokens in the response(s).

int32 candidates_token_count = 2;

Returns
Type Description
int

The candidatesTokenCount.

getCandidatesTokensDetails(int index)

public ModalityTokenCount getCandidatesTokensDetails(int index)

Output only. List of modalities that were returned in the response.

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. List of modalities that were returned in the response.

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. List of modalities that were returned in the response.

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. List of modalities that were returned in the response.

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. List of modalities that were returned in the response.

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. List of modalities that were returned in the response.

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. List of modalities that were returned in the response.

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 GenerateContentResponse.UsageMetadata getDefaultInstanceForType()
Returns
Type Description
GenerateContentResponse.UsageMetadata

getDescriptorForType()

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

getPromptTokenCount()

public int getPromptTokenCount()

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.

int32 prompt_token_count = 1;

Returns
Type Description
int

The promptTokenCount.

getPromptTokensDetails(int index)

public ModalityTokenCount getPromptTokensDetails(int index)

Output only. List of modalities that were processed in the request input.

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. List of modalities that were processed in the request input.

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. List of modalities that were processed in the request input.

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. List of modalities that were processed in the request input.

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. List of modalities that were processed in the request input.

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. List of modalities that were processed in the request input.

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. List of modalities that were processed in the request input.

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. Number of tokens present in thoughts output.

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

Returns
Type Description
int

The thoughtsTokenCount.

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()

Total token count for prompt and response candidates.

int32 total_token_count = 3;

Returns
Type Description
int

The totalTokenCount.

getTrafficType()

public GenerateContentResponse.UsageMetadata.TrafficType getTrafficType()

Output only. The traffic type for this request.

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

Returns
Type Description
GenerateContentResponse.UsageMetadata.TrafficType

The trafficType.

getTrafficTypeValue()

public int getTrafficTypeValue()

Output only. The traffic type for this request.

.google.cloud.aiplatform.v1.GenerateContentResponse.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 GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(GenerateContentResponse.UsageMetadata other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

removeCacheTokensDetails(int index)

public GenerateContentResponse.UsageMetadata.Builder removeCacheTokensDetails(int index)

Output only. List of modalities of the cached content in the request input.

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

Parameter
Name Description
index int
Returns
Type Description
GenerateContentResponse.UsageMetadata.Builder

removeCandidatesTokensDetails(int index)

public GenerateContentResponse.UsageMetadata.Builder removeCandidatesTokensDetails(int index)

Output only. List of modalities that were returned in the response.

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

Parameter
Name Description
index int
Returns
Type Description
GenerateContentResponse.UsageMetadata.Builder

removePromptTokensDetails(int index)

public GenerateContentResponse.UsageMetadata.Builder removePromptTokensDetails(int index)

Output only. List of modalities that were processed in the request input.

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

Parameter
Name Description
index int
Returns
Type Description
GenerateContentResponse.UsageMetadata.Builder

removeToolUsePromptTokensDetails(int index)

public GenerateContentResponse.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
GenerateContentResponse.UsageMetadata.Builder

setCacheTokensDetails(int index, ModalityTokenCount value)

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

Output only. List of modalities of the cached content in the request input.

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
GenerateContentResponse.UsageMetadata.Builder

setCacheTokensDetails(int index, ModalityTokenCount.Builder builderForValue)

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

Output only. List of modalities of the cached content in the request input.

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
GenerateContentResponse.UsageMetadata.Builder

setCachedContentTokenCount(int value)

public GenerateContentResponse.UsageMetadata.Builder setCachedContentTokenCount(int value)

Output only. Number of tokens in the cached part in the input (the cached content).

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

Parameter
Name Description
value int

The cachedContentTokenCount to set.

Returns
Type Description
GenerateContentResponse.UsageMetadata.Builder

This builder for chaining.

setCandidatesTokenCount(int value)

public GenerateContentResponse.UsageMetadata.Builder setCandidatesTokenCount(int value)

Number of tokens in the response(s).

int32 candidates_token_count = 2;

Parameter
Name Description
value int

The candidatesTokenCount to set.

Returns
Type Description
GenerateContentResponse.UsageMetadata.Builder

This builder for chaining.

setCandidatesTokensDetails(int index, ModalityTokenCount value)

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

Output only. List of modalities that were returned in the response.

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
GenerateContentResponse.UsageMetadata.Builder

setCandidatesTokensDetails(int index, ModalityTokenCount.Builder builderForValue)

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

Output only. List of modalities that were returned in the response.

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
GenerateContentResponse.UsageMetadata.Builder

setPromptTokenCount(int value)

public GenerateContentResponse.UsageMetadata.Builder setPromptTokenCount(int value)

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.

int32 prompt_token_count = 1;

Parameter
Name Description
value int

The promptTokenCount to set.

Returns
Type Description
GenerateContentResponse.UsageMetadata.Builder

This builder for chaining.

setPromptTokensDetails(int index, ModalityTokenCount value)

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

Output only. List of modalities that were processed in the request input.

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
GenerateContentResponse.UsageMetadata.Builder

setPromptTokensDetails(int index, ModalityTokenCount.Builder builderForValue)

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

Output only. List of modalities that were processed in the request input.

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
GenerateContentResponse.UsageMetadata.Builder

setThoughtsTokenCount(int value)

public GenerateContentResponse.UsageMetadata.Builder setThoughtsTokenCount(int value)

Output only. Number of tokens present in thoughts output.

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

Parameter
Name Description
value int

The thoughtsTokenCount to set.

Returns
Type Description
GenerateContentResponse.UsageMetadata.Builder

This builder for chaining.

setToolUsePromptTokensDetails(int index, ModalityTokenCount value)

public GenerateContentResponse.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
GenerateContentResponse.UsageMetadata.Builder

setToolUsePromptTokensDetails(int index, ModalityTokenCount.Builder builderForValue)

public GenerateContentResponse.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
GenerateContentResponse.UsageMetadata.Builder

setTotalTokenCount(int value)

public GenerateContentResponse.UsageMetadata.Builder setTotalTokenCount(int value)

Total token count for prompt and response candidates.

int32 total_token_count = 3;

Parameter
Name Description
value int

The totalTokenCount to set.

Returns
Type Description
GenerateContentResponse.UsageMetadata.Builder

This builder for chaining.

setTrafficType(GenerateContentResponse.UsageMetadata.TrafficType value)

public GenerateContentResponse.UsageMetadata.Builder setTrafficType(GenerateContentResponse.UsageMetadata.TrafficType value)

Output only. The traffic type for this request.

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

Parameter
Name Description
value GenerateContentResponse.UsageMetadata.TrafficType

The trafficType to set.

Returns
Type Description
GenerateContentResponse.UsageMetadata.Builder

This builder for chaining.

setTrafficTypeValue(int value)

public GenerateContentResponse.UsageMetadata.Builder setTrafficTypeValue(int value)

Output only. The traffic type for this request.

.google.cloud.aiplatform.v1.GenerateContentResponse.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
GenerateContentResponse.UsageMetadata.Builder

This builder for chaining.