Class GenerateContentResponse.UsageMetadata.Builder (3.34.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.v1.GenerateContentResponse.UsageMetadata

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public GenerateContentResponse.UsageMetadata.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
GenerateContentResponse.UsageMetadata.Builder
Overrides

build()

public GenerateContentResponse.UsageMetadata build()
Returns
TypeDescription
GenerateContentResponse.UsageMetadata

buildPartial()

public GenerateContentResponse.UsageMetadata buildPartial()
Returns
TypeDescription
GenerateContentResponse.UsageMetadata

clear()

public GenerateContentResponse.UsageMetadata.Builder clear()
Returns
TypeDescription
GenerateContentResponse.UsageMetadata.Builder
Overrides

clearCandidatesTokenCount()

public GenerateContentResponse.UsageMetadata.Builder clearCandidatesTokenCount()

Number of tokens in the response(s).

int32 candidates_token_count = 2;

Returns
TypeDescription
GenerateContentResponse.UsageMetadata.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public GenerateContentResponse.UsageMetadata.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
GenerateContentResponse.UsageMetadata.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public GenerateContentResponse.UsageMetadata.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
GenerateContentResponse.UsageMetadata.Builder
Overrides

clearPromptTokenCount()

public GenerateContentResponse.UsageMetadata.Builder clearPromptTokenCount()

Number of tokens in the request.

int32 prompt_token_count = 1;

Returns
TypeDescription
GenerateContentResponse.UsageMetadata.Builder

This builder for chaining.

clearTotalTokenCount()

public GenerateContentResponse.UsageMetadata.Builder clearTotalTokenCount()

int32 total_token_count = 3;

Returns
TypeDescription
GenerateContentResponse.UsageMetadata.Builder

This builder for chaining.

clone()

public GenerateContentResponse.UsageMetadata.Builder clone()
Returns
TypeDescription
GenerateContentResponse.UsageMetadata.Builder
Overrides

getCandidatesTokenCount()

public int getCandidatesTokenCount()

Number of tokens in the response(s).

int32 candidates_token_count = 2;

Returns
TypeDescription
int

The candidatesTokenCount.

getDefaultInstanceForType()

public GenerateContentResponse.UsageMetadata getDefaultInstanceForType()
Returns
TypeDescription
GenerateContentResponse.UsageMetadata

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getPromptTokenCount()

public int getPromptTokenCount()

Number of tokens in the request.

int32 prompt_token_count = 1;

Returns
TypeDescription
int

The promptTokenCount.

getTotalTokenCount()

public int getTotalTokenCount()

int32 total_token_count = 3;

Returns
TypeDescription
int

The totalTokenCount.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(GenerateContentResponse.UsageMetadata other)

public GenerateContentResponse.UsageMetadata.Builder mergeFrom(GenerateContentResponse.UsageMetadata other)
Parameter
NameDescription
otherGenerateContentResponse.UsageMetadata
Returns
TypeDescription
GenerateContentResponse.UsageMetadata.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public GenerateContentResponse.UsageMetadata.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
GenerateContentResponse.UsageMetadata.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public GenerateContentResponse.UsageMetadata.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
GenerateContentResponse.UsageMetadata.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final GenerateContentResponse.UsageMetadata.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
GenerateContentResponse.UsageMetadata.Builder
Overrides

setCandidatesTokenCount(int value)

public GenerateContentResponse.UsageMetadata.Builder setCandidatesTokenCount(int value)

Number of tokens in the response(s).

int32 candidates_token_count = 2;

Parameter
NameDescription
valueint

The candidatesTokenCount to set.

Returns
TypeDescription
GenerateContentResponse.UsageMetadata.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public GenerateContentResponse.UsageMetadata.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
GenerateContentResponse.UsageMetadata.Builder
Overrides

setPromptTokenCount(int value)

public GenerateContentResponse.UsageMetadata.Builder setPromptTokenCount(int value)

Number of tokens in the request.

int32 prompt_token_count = 1;

Parameter
NameDescription
valueint

The promptTokenCount to set.

Returns
TypeDescription
GenerateContentResponse.UsageMetadata.Builder

This builder for chaining.

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

public GenerateContentResponse.UsageMetadata.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
GenerateContentResponse.UsageMetadata.Builder
Overrides

setTotalTokenCount(int value)

public GenerateContentResponse.UsageMetadata.Builder setTotalTokenCount(int value)

int32 total_token_count = 3;

Parameter
NameDescription
valueint

The totalTokenCount to set.

Returns
TypeDescription
GenerateContentResponse.UsageMetadata.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final GenerateContentResponse.UsageMetadata.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
GenerateContentResponse.UsageMetadata.Builder
Overrides