Package com.google.cloud.aiplatform.v1
Class GenerateContentResponse.UsageMetadata
java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata
- All Implemented Interfaces:
GenerateContentResponse.UsageMetadataOrBuilder,com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Serializable
- Enclosing class:
- GenerateContentResponse
public static final class GenerateContentResponse.UsageMetadata
extends com.google.protobuf.GeneratedMessage
implements GenerateContentResponse.UsageMetadataOrBuilder
Usage metadata about response(s).Protobuf type
google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classUsage metadata about response(s).static enumThe type of traffic that this request was processed with, indicating which quota is 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 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.intNumber of tokens in the response(s).getCandidatesTokensDetails(int index) Output only.intOutput only.Output only.getCandidatesTokensDetailsOrBuilder(int index) Output only.List<? extends ModalityTokenCountOrBuilder>Output only.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Parser<GenerateContentResponse.UsageMetadata>intNumber of tokens in the request.getPromptTokensDetails(int index) Output only.intOutput only.Output only.getPromptTokensDetailsOrBuilder(int index) Output only.List<? extends ModalityTokenCountOrBuilder>Output only.intintOutput only.getToolUsePromptTokensDetails(int index) Output only.intOutput only.Output only.getToolUsePromptTokensDetailsOrBuilder(int index) Output only.List<? extends ModalityTokenCountOrBuilder>Output only.intTotal token count for prompt and response candidates.Output only.intOutput only.inthashCode()protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleannewBuilder(GenerateContentResponse.UsageMetadata prototype) newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) parseDelimitedFrom(InputStream input) parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) parseFrom(byte[] data) parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) parseFrom(com.google.protobuf.ByteString data) parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) parseFrom(com.google.protobuf.CodedInputStream input) parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) parseFrom(InputStream input) parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) parseFrom(ByteBuffer data) parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<GenerateContentResponse.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:
-
THOUGHTS_TOKEN_COUNT_FIELD_NUMBER
public static final int THOUGHTS_TOKEN_COUNT_FIELD_NUMBER- See Also:
-
TOTAL_TOKEN_COUNT_FIELD_NUMBER
public static final int TOTAL_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()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;- Specified by:
getPromptTokenCountin interfaceGenerateContentResponse.UsageMetadataOrBuilder- Returns:
- The promptTokenCount.
-
getCandidatesTokenCount
public int getCandidatesTokenCount()Number of tokens in the response(s).
int32 candidates_token_count = 2;- Specified by:
getCandidatesTokenCountin interfaceGenerateContentResponse.UsageMetadataOrBuilder- Returns:
- The candidatesTokenCount.
-
getThoughtsTokenCount
public int getThoughtsTokenCount()Output only. Number of tokens present in thoughts output.
int32 thoughts_token_count = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getThoughtsTokenCountin interfaceGenerateContentResponse.UsageMetadataOrBuilder- Returns:
- The thoughtsTokenCount.
-
getTotalTokenCount
public int getTotalTokenCount()Total token count for prompt and response candidates.
int32 total_token_count = 3;- Specified by:
getTotalTokenCountin interfaceGenerateContentResponse.UsageMetadataOrBuilder- Returns:
- The totalTokenCount.
-
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];- Specified by:
getCachedContentTokenCountin interfaceGenerateContentResponse.UsageMetadataOrBuilder- Returns:
- The cachedContentTokenCount.
-
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];- Specified by:
getPromptTokensDetailsListin interfaceGenerateContentResponse.UsageMetadataOrBuilder
-
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];- Specified by:
getPromptTokensDetailsOrBuilderListin interfaceGenerateContentResponse.UsageMetadataOrBuilder
-
getPromptTokensDetailsCount
public 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];- Specified by:
getPromptTokensDetailsCountin interfaceGenerateContentResponse.UsageMetadataOrBuilder
-
getPromptTokensDetails
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];- Specified by:
getPromptTokensDetailsin interfaceGenerateContentResponse.UsageMetadataOrBuilder
-
getPromptTokensDetailsOrBuilder
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];- Specified by:
getPromptTokensDetailsOrBuilderin interfaceGenerateContentResponse.UsageMetadataOrBuilder
-
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];- Specified by:
getCacheTokensDetailsListin interfaceGenerateContentResponse.UsageMetadataOrBuilder
-
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];- Specified by:
getCacheTokensDetailsOrBuilderListin interfaceGenerateContentResponse.UsageMetadataOrBuilder
-
getCacheTokensDetailsCount
public 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];- Specified by:
getCacheTokensDetailsCountin interfaceGenerateContentResponse.UsageMetadataOrBuilder
-
getCacheTokensDetails
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];- Specified by:
getCacheTokensDetailsin interfaceGenerateContentResponse.UsageMetadataOrBuilder
-
getCacheTokensDetailsOrBuilder
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];- Specified by:
getCacheTokensDetailsOrBuilderin interfaceGenerateContentResponse.UsageMetadataOrBuilder
-
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];- Specified by:
getCandidatesTokensDetailsListin interfaceGenerateContentResponse.UsageMetadataOrBuilder
-
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];- Specified by:
getCandidatesTokensDetailsOrBuilderListin interfaceGenerateContentResponse.UsageMetadataOrBuilder
-
getCandidatesTokensDetailsCount
public 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];- Specified by:
getCandidatesTokensDetailsCountin interfaceGenerateContentResponse.UsageMetadataOrBuilder
-
getCandidatesTokensDetails
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];- Specified by:
getCandidatesTokensDetailsin interfaceGenerateContentResponse.UsageMetadataOrBuilder
-
getCandidatesTokensDetailsOrBuilder
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];- Specified by:
getCandidatesTokensDetailsOrBuilderin interfaceGenerateContentResponse.UsageMetadataOrBuilder
-
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 interfaceGenerateContentResponse.UsageMetadataOrBuilder
-
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 interfaceGenerateContentResponse.UsageMetadataOrBuilder
-
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 interfaceGenerateContentResponse.UsageMetadataOrBuilder
-
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 interfaceGenerateContentResponse.UsageMetadataOrBuilder
-
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 interfaceGenerateContentResponse.UsageMetadataOrBuilder
-
getTrafficTypeValue
public int getTrafficTypeValue()Output only. The traffic type for this request.
.google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata.TrafficType traffic_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getTrafficTypeValuein interfaceGenerateContentResponse.UsageMetadataOrBuilder- Returns:
- The enum numeric value on the wire for trafficType.
-
getTrafficType
Output only. The traffic type for this request.
.google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata.TrafficType traffic_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getTrafficTypein interfaceGenerateContentResponse.UsageMetadataOrBuilder- 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 GenerateContentResponse.UsageMetadata parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static GenerateContentResponse.UsageMetadata parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static GenerateContentResponse.UsageMetadata parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static GenerateContentResponse.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 GenerateContentResponse.UsageMetadata parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static GenerateContentResponse.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 GenerateContentResponse.UsageMetadata parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
public static GenerateContentResponse.UsageMetadata parseDelimitedFrom(InputStream input) throws IOException - Throws:
IOException
-
parseDelimitedFrom
public static GenerateContentResponse.UsageMetadata parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
public static GenerateContentResponse.UsageMetadata parseFrom(com.google.protobuf.CodedInputStream input) throws IOException - Throws:
IOException
-
parseFrom
public static GenerateContentResponse.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
public static GenerateContentResponse.UsageMetadata.Builder newBuilder(GenerateContentResponse.UsageMetadata prototype) -
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected GenerateContentResponse.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
-