Package com.google.cloud.aiplatform.v1
Class UsageMetadata
java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.cloud.aiplatform.v1.UsageMetadata
- All Implemented Interfaces:
UsageMetadataOrBuilder,com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Serializable
@Generated
public final class UsageMetadata
extends com.google.protobuf.GeneratedMessage
implements UsageMetadataOrBuilder
Usage metadata about the content generation request and response. This message provides a detailed breakdown of token usage and other relevant metrics.Protobuf type
google.cloud.aiplatform.v1.UsageMetadata- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classUsage metadata about the content generation request and response.static enumThe type of traffic that this request was processed with, indicating which quota gets consumed.Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessage
com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT, BuilderT>>, com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.FieldAccessorTable, com.google.protobuf.GeneratedMessage.GeneratedExtension<ContainingT extends com.google.protobuf.Message, T extends Object>, com.google.protobuf.GeneratedMessage.UnusedPrivateParameter Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessage
com.google.protobuf.AbstractMessage.BuilderParentNested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessage
alwaysUseFieldBuilders, loggedPre22TypeNames, unknownFieldsFields inherited from class com.google.protobuf.AbstractMessage
memoizedSizeFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionbooleanintOutput only.getCacheTokensDetails(int index) Output only.intOutput only.Output only.getCacheTokensDetailsOrBuilder(int index) Output only.List<? extends ModalityTokenCountOrBuilder>Output only.intThe total number of tokens in the generated candidates.getCandidatesTokensDetails(int index) Output only.intOutput only.Output only.getCandidatesTokensDetailsOrBuilder(int index) Output only.List<? extends ModalityTokenCountOrBuilder>Output only.static UsageMetadatastatic final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Parser<UsageMetadata>intThe total number of tokens in the prompt.getPromptTokensDetails(int index) Output only.intOutput only.Output only.getPromptTokensDetailsOrBuilder(int index) Output only.List<? extends ModalityTokenCountOrBuilder>Output only.intintOutput only.intOutput only.getToolUsePromptTokensDetails(int index) Output only.intOutput only.Output only.getToolUsePromptTokensDetailsOrBuilder(int index) Output only.List<? extends ModalityTokenCountOrBuilder>Output only.intThe total number of tokens for the entire request.Output only.intOutput only.inthashCode()protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanstatic UsageMetadata.Builderstatic UsageMetadata.BuildernewBuilder(UsageMetadata prototype) protected UsageMetadata.BuildernewBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) static UsageMetadataparseDelimitedFrom(InputStream input) static UsageMetadataparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static UsageMetadataparseFrom(byte[] data) static UsageMetadataparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static UsageMetadataparseFrom(com.google.protobuf.ByteString data) static UsageMetadataparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static UsageMetadataparseFrom(com.google.protobuf.CodedInputStream input) static UsageMetadataparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static UsageMetadataparseFrom(InputStream input) static UsageMetadataparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static UsageMetadataparseFrom(ByteBuffer data) static UsageMetadataparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<UsageMetadata>parser()voidwriteTo(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessage
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, newFileScopedGeneratedExtension, newInstance, newMessageScopedGeneratedExtension, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagMethods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashFields, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
PROMPT_TOKEN_COUNT_FIELD_NUMBER
public static final int PROMPT_TOKEN_COUNT_FIELD_NUMBER- See Also:
-
CANDIDATES_TOKEN_COUNT_FIELD_NUMBER
public static final int CANDIDATES_TOKEN_COUNT_FIELD_NUMBER- See Also:
-
TOTAL_TOKEN_COUNT_FIELD_NUMBER
public static final int TOTAL_TOKEN_COUNT_FIELD_NUMBER- See Also:
-
TOOL_USE_PROMPT_TOKEN_COUNT_FIELD_NUMBER
public static final int TOOL_USE_PROMPT_TOKEN_COUNT_FIELD_NUMBER- See Also:
-
THOUGHTS_TOKEN_COUNT_FIELD_NUMBER
public static final int THOUGHTS_TOKEN_COUNT_FIELD_NUMBER- See Also:
-
CACHED_CONTENT_TOKEN_COUNT_FIELD_NUMBER
public static final int CACHED_CONTENT_TOKEN_COUNT_FIELD_NUMBER- See Also:
-
PROMPT_TOKENS_DETAILS_FIELD_NUMBER
public static final int PROMPT_TOKENS_DETAILS_FIELD_NUMBER- See Also:
-
CACHE_TOKENS_DETAILS_FIELD_NUMBER
public static final int CACHE_TOKENS_DETAILS_FIELD_NUMBER- See Also:
-
CANDIDATES_TOKENS_DETAILS_FIELD_NUMBER
public static final int CANDIDATES_TOKENS_DETAILS_FIELD_NUMBER- See Also:
-
TOOL_USE_PROMPT_TOKENS_DETAILS_FIELD_NUMBER
public static final int TOOL_USE_PROMPT_TOKENS_DETAILS_FIELD_NUMBER- See Also:
-
TRAFFIC_TYPE_FIELD_NUMBER
public static final int TRAFFIC_TYPE_FIELD_NUMBER- See Also:
-
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage
-
getPromptTokenCount
public int getPromptTokenCount()The total number of tokens in the prompt. This includes any text, images, or other media provided in the request. When `cached_content` is set, this also includes the number of tokens in the cached content.
int32 prompt_token_count = 1;- Specified by:
getPromptTokenCountin interfaceUsageMetadataOrBuilder- Returns:
- The promptTokenCount.
-
getCandidatesTokenCount
public int getCandidatesTokenCount()The total number of tokens in the generated candidates.
int32 candidates_token_count = 2;- Specified by:
getCandidatesTokenCountin interfaceUsageMetadataOrBuilder- Returns:
- The candidatesTokenCount.
-
getTotalTokenCount
public int getTotalTokenCount()The total number of tokens for the entire request. This is the sum of `prompt_token_count`, `candidates_token_count`, `tool_use_prompt_token_count`, and `thoughts_token_count`.
int32 total_token_count = 3;- Specified by:
getTotalTokenCountin interfaceUsageMetadataOrBuilder- Returns:
- The totalTokenCount.
-
getToolUsePromptTokenCount
public int getToolUsePromptTokenCount()Output only. The number of tokens in the results from tool executions, which are provided back to the model as input, if applicable.
int32 tool_use_prompt_token_count = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getToolUsePromptTokenCountin interfaceUsageMetadataOrBuilder- Returns:
- The toolUsePromptTokenCount.
-
getThoughtsTokenCount
public int getThoughtsTokenCount()Output only. The number of tokens that were part of the model's generated "thoughts" output, if applicable.
int32 thoughts_token_count = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getThoughtsTokenCountin interfaceUsageMetadataOrBuilder- Returns:
- The thoughtsTokenCount.
-
getCachedContentTokenCount
public int getCachedContentTokenCount()Output only. The number of tokens in the cached content that was used for this request.
int32 cached_content_token_count = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getCachedContentTokenCountin interfaceUsageMetadataOrBuilder- Returns:
- The cachedContentTokenCount.
-
getPromptTokensDetailsList
Output only. A detailed breakdown of the token count for each modality in the prompt.
repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getPromptTokensDetailsListin interfaceUsageMetadataOrBuilder
-
getPromptTokensDetailsOrBuilderList
Output only. A detailed breakdown of the token count for each modality in the prompt.
repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getPromptTokensDetailsOrBuilderListin interfaceUsageMetadataOrBuilder
-
getPromptTokensDetailsCount
public int getPromptTokensDetailsCount()Output only. A detailed breakdown of the token count for each modality in the prompt.
repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getPromptTokensDetailsCountin interfaceUsageMetadataOrBuilder
-
getPromptTokensDetails
Output only. A detailed breakdown of the token count for each modality in the prompt.
repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getPromptTokensDetailsin interfaceUsageMetadataOrBuilder
-
getPromptTokensDetailsOrBuilder
Output only. A detailed breakdown of the token count for each modality in the prompt.
repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getPromptTokensDetailsOrBuilderin interfaceUsageMetadataOrBuilder
-
getCacheTokensDetailsList
Output only. A detailed breakdown of the token count for each modality in the cached content.
repeated .google.cloud.aiplatform.v1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getCacheTokensDetailsListin interfaceUsageMetadataOrBuilder
-
getCacheTokensDetailsOrBuilderList
Output only. A detailed breakdown of the token count for each modality in the cached content.
repeated .google.cloud.aiplatform.v1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getCacheTokensDetailsOrBuilderListin interfaceUsageMetadataOrBuilder
-
getCacheTokensDetailsCount
public int getCacheTokensDetailsCount()Output only. A detailed breakdown of the token count for each modality in the cached content.
repeated .google.cloud.aiplatform.v1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getCacheTokensDetailsCountin interfaceUsageMetadataOrBuilder
-
getCacheTokensDetails
Output only. A detailed breakdown of the token count for each modality in the cached content.
repeated .google.cloud.aiplatform.v1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getCacheTokensDetailsin interfaceUsageMetadataOrBuilder
-
getCacheTokensDetailsOrBuilder
Output only. A detailed breakdown of the token count for each modality in the cached content.
repeated .google.cloud.aiplatform.v1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getCacheTokensDetailsOrBuilderin interfaceUsageMetadataOrBuilder
-
getCandidatesTokensDetailsList
Output only. A detailed breakdown of the token count for each modality in the generated candidates.
repeated .google.cloud.aiplatform.v1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getCandidatesTokensDetailsListin interfaceUsageMetadataOrBuilder
-
getCandidatesTokensDetailsOrBuilderList
Output only. A detailed breakdown of the token count for each modality in the generated candidates.
repeated .google.cloud.aiplatform.v1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getCandidatesTokensDetailsOrBuilderListin interfaceUsageMetadataOrBuilder
-
getCandidatesTokensDetailsCount
public int getCandidatesTokensDetailsCount()Output only. A detailed breakdown of the token count for each modality in the generated candidates.
repeated .google.cloud.aiplatform.v1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getCandidatesTokensDetailsCountin interfaceUsageMetadataOrBuilder
-
getCandidatesTokensDetails
Output only. A detailed breakdown of the token count for each modality in the generated candidates.
repeated .google.cloud.aiplatform.v1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getCandidatesTokensDetailsin interfaceUsageMetadataOrBuilder
-
getCandidatesTokensDetailsOrBuilder
Output only. A detailed breakdown of the token count for each modality in the generated candidates.
repeated .google.cloud.aiplatform.v1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getCandidatesTokensDetailsOrBuilderin interfaceUsageMetadataOrBuilder
-
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];- Specified by:
getToolUsePromptTokensDetailsListin interfaceUsageMetadataOrBuilder
-
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];- Specified by:
getToolUsePromptTokensDetailsOrBuilderListin interfaceUsageMetadataOrBuilder
-
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];- Specified by:
getToolUsePromptTokensDetailsCountin interfaceUsageMetadataOrBuilder
-
getToolUsePromptTokensDetails
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];- Specified by:
getToolUsePromptTokensDetailsin interfaceUsageMetadataOrBuilder
-
getToolUsePromptTokensDetailsOrBuilder
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];- Specified by:
getToolUsePromptTokensDetailsOrBuilderin interfaceUsageMetadataOrBuilder
-
getTrafficTypeValue
public int getTrafficTypeValue()Output only. The traffic type for this request.
.google.cloud.aiplatform.v1.UsageMetadata.TrafficType traffic_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getTrafficTypeValuein interfaceUsageMetadataOrBuilder- Returns:
- The enum numeric value on the wire for trafficType.
-
getTrafficType
Output only. The traffic type for this request.
.google.cloud.aiplatform.v1.UsageMetadata.TrafficType traffic_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getTrafficTypein interfaceUsageMetadataOrBuilder- Returns:
- The trafficType.
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage
-
writeTo
- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessage- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessage
-
equals
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.google.protobuf.AbstractMessage
-
parseFrom
public static UsageMetadata parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static UsageMetadata parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static UsageMetadata parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static UsageMetadata parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static UsageMetadata parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static UsageMetadata parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static UsageMetadata parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static UsageMetadata parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
public static UsageMetadata parseFrom(com.google.protobuf.CodedInputStream input) throws IOException - Throws:
IOException
-
parseFrom
public static UsageMetadata parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilderForType
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
-
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected UsageMetadata.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) - Overrides:
newBuilderForTypein classcom.google.protobuf.AbstractMessage
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessage
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-