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
Inherited Members
com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)
Static Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public GenerateContentResponse.UsageMetadata.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Overrides
build()
public GenerateContentResponse.UsageMetadata build()
buildPartial()
public GenerateContentResponse.UsageMetadata buildPartial()
clear()
public GenerateContentResponse.UsageMetadata.Builder clear()
Overrides
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];
clearCandidatesTokenCount()
public GenerateContentResponse.UsageMetadata.Builder clearCandidatesTokenCount()
Number of tokens in the response(s).
int32 candidates_token_count = 2;
clearField(Descriptors.FieldDescriptor field)
public GenerateContentResponse.UsageMetadata.Builder clearField(Descriptors.FieldDescriptor field)
Overrides
clearOneof(Descriptors.OneofDescriptor oneof)
public GenerateContentResponse.UsageMetadata.Builder clearOneof(Descriptors.OneofDescriptor oneof)
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;
clearTotalTokenCount()
public GenerateContentResponse.UsageMetadata.Builder clearTotalTokenCount()
Total token count for prompt and response candidates.
int32 total_token_count = 3;
clone()
public GenerateContentResponse.UsageMetadata.Builder clone()
Overrides
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.
|
getDefaultInstanceForType()
public GenerateContentResponse.UsageMetadata getDefaultInstanceForType()
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
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.
|
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()
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
mergeFrom(GenerateContentResponse.UsageMetadata other)
public GenerateContentResponse.UsageMetadata.Builder mergeFrom(GenerateContentResponse.UsageMetadata other)
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public GenerateContentResponse.UsageMetadata.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Overrides
mergeFrom(Message other)
public GenerateContentResponse.UsageMetadata.Builder mergeFrom(Message other)
Parameter |
Name |
Description |
other |
Message
|
Overrides
mergeUnknownFields(UnknownFieldSet unknownFields)
public final GenerateContentResponse.UsageMetadata.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Overrides
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.
|
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.
|
setField(Descriptors.FieldDescriptor field, Object value)
public GenerateContentResponse.UsageMetadata.Builder setField(Descriptors.FieldDescriptor field, Object value)
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.
|
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public GenerateContentResponse.UsageMetadata.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
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.
|
setUnknownFields(UnknownFieldSet unknownFields)
public final GenerateContentResponse.UsageMetadata.Builder setUnknownFields(UnknownFieldSet unknownFields)
Overrides