public static final class GenerateContentResponse.UsageMetadata extends com.google.protobuf.GeneratedMessageV3 implements GenerateContentResponse.UsageMetadataOrBuilder
Usage metadata about response(s).Protobuf type
google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata| Modifier and Type | Class and Description |
|---|---|
static class |
GenerateContentResponse.UsageMetadata.Builder
Usage metadata about response(s).
|
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT,BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter| Modifier and Type | Field and Description |
|---|---|
static int |
CACHE_TOKENS_DETAILS_FIELD_NUMBER |
static int |
CACHED_CONTENT_TOKEN_COUNT_FIELD_NUMBER |
static int |
CANDIDATES_TOKEN_COUNT_FIELD_NUMBER |
static int |
CANDIDATES_TOKENS_DETAILS_FIELD_NUMBER |
static int |
PROMPT_TOKEN_COUNT_FIELD_NUMBER |
static int |
PROMPT_TOKENS_DETAILS_FIELD_NUMBER |
static int |
TOTAL_TOKEN_COUNT_FIELD_NUMBER |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final int PROMPT_TOKEN_COUNT_FIELD_NUMBER
public static final int CANDIDATES_TOKEN_COUNT_FIELD_NUMBER
public static final int TOTAL_TOKEN_COUNT_FIELD_NUMBER
public static final int CACHED_CONTENT_TOKEN_COUNT_FIELD_NUMBER
public static final int PROMPT_TOKENS_DETAILS_FIELD_NUMBER
public static final int CACHE_TOKENS_DETAILS_FIELD_NUMBER
public static final int CANDIDATES_TOKENS_DETAILS_FIELD_NUMBER
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
newInstance in class com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3public 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;getPromptTokenCount in interface GenerateContentResponse.UsageMetadataOrBuilderpublic int getCandidatesTokenCount()
Number of tokens in the response(s).
int32 candidates_token_count = 2;getCandidatesTokenCount in interface GenerateContentResponse.UsageMetadataOrBuilderpublic int getTotalTokenCount()
Total token count for prompt and response candidates.
int32 total_token_count = 3;getTotalTokenCount in interface GenerateContentResponse.UsageMetadataOrBuilderpublic 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];
getCachedContentTokenCount in interface GenerateContentResponse.UsageMetadataOrBuilderpublic 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];
getPromptTokensDetailsList in interface GenerateContentResponse.UsageMetadataOrBuilderpublic 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];
getPromptTokensDetailsOrBuilderList in interface GenerateContentResponse.UsageMetadataOrBuilderpublic 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];
getPromptTokensDetailsCount in interface GenerateContentResponse.UsageMetadataOrBuilderpublic 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];
getPromptTokensDetails in interface GenerateContentResponse.UsageMetadataOrBuilderpublic 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];
getPromptTokensDetailsOrBuilder in interface GenerateContentResponse.UsageMetadataOrBuilderpublic 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];
getCacheTokensDetailsList in interface GenerateContentResponse.UsageMetadataOrBuilderpublic 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];
getCacheTokensDetailsOrBuilderList in interface GenerateContentResponse.UsageMetadataOrBuilderpublic 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];
getCacheTokensDetailsCount in interface GenerateContentResponse.UsageMetadataOrBuilderpublic 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];
getCacheTokensDetails in interface GenerateContentResponse.UsageMetadataOrBuilderpublic 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];
getCacheTokensDetailsOrBuilder in interface GenerateContentResponse.UsageMetadataOrBuilderpublic 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];
getCandidatesTokensDetailsList in interface GenerateContentResponse.UsageMetadataOrBuilderpublic 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];
getCandidatesTokensDetailsOrBuilderList in interface GenerateContentResponse.UsageMetadataOrBuilderpublic 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];
getCandidatesTokensDetailsCount in interface GenerateContentResponse.UsageMetadataOrBuilderpublic 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];
getCandidatesTokensDetails in interface GenerateContentResponse.UsageMetadataOrBuilderpublic 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];
getCandidatesTokensDetailsOrBuilder in interface GenerateContentResponse.UsageMetadataOrBuilderpublic final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessageV3IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessageV3public boolean equals(Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static GenerateContentResponse.UsageMetadata parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static GenerateContentResponse.UsageMetadata parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static GenerateContentResponse.UsageMetadata parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static GenerateContentResponse.UsageMetadata parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static GenerateContentResponse.UsageMetadata parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static GenerateContentResponse.UsageMetadata parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static GenerateContentResponse.UsageMetadata parseFrom(InputStream input) throws IOException
IOExceptionpublic static GenerateContentResponse.UsageMetadata parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static GenerateContentResponse.UsageMetadata parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static GenerateContentResponse.UsageMetadata parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static GenerateContentResponse.UsageMetadata parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOExceptionpublic static GenerateContentResponse.UsageMetadata parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic GenerateContentResponse.UsageMetadata.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static GenerateContentResponse.UsageMetadata.Builder newBuilder()
public static GenerateContentResponse.UsageMetadata.Builder newBuilder(GenerateContentResponse.UsageMetadata prototype)
public GenerateContentResponse.UsageMetadata.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected GenerateContentResponse.UsageMetadata.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static GenerateContentResponse.UsageMetadata getDefaultInstance()
public static com.google.protobuf.Parser<GenerateContentResponse.UsageMetadata> parser()
public com.google.protobuf.Parser<GenerateContentResponse.UsageMetadata> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public GenerateContentResponse.UsageMetadata getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderCopyright © 2025 Google LLC. All rights reserved.