Class GenerateContentResponse.UsageMetadata.Builder (3.58.0)

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

Usage metadata about response(s).

Protobuf type google.cloud.aiplatform.v1beta1.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.v1beta1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
values Iterable<? extends com.google.cloud.aiplatform.v1beta1.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.v1beta1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
values Iterable<? extends com.google.cloud.aiplatform.v1beta1.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.v1beta1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
values Iterable<? extends com.google.cloud.aiplatform.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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 GenerateContentResponse.UsageMetadata.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
GenerateContentResponse.UsageMetadata.Builder
Overrides

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.v1beta1.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.v1beta1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
GenerateContentResponse.UsageMetadata.Builder

clearField(Descriptors.FieldDescriptor field)

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

clearOneof(Descriptors.OneofDescriptor oneof)

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

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.v1beta1.ModalityTokenCount prompt_tokens_details = 9 [(.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.

clone()

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

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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<? extends com.google.cloud.aiplatform.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<? extends com.google.cloud.aiplatform.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

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

getTotalTokenCount()

public int getTotalTokenCount()

Total token count for prompt and response candidates.

int32 total_token_count = 3;

Returns
Type Description
int

The totalTokenCount.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.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

mergeUnknownFields(UnknownFieldSet unknownFields)

public final GenerateContentResponse.UsageMetadata.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
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.v1beta1.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.v1beta1.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.v1beta1.ModalityTokenCount prompt_tokens_details = 9 [(.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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

setField(Descriptors.FieldDescriptor field, Object value)

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

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.v1beta1.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.v1beta1.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

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

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

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.

setUnknownFields(UnknownFieldSet unknownFields)

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