public final class UsageMetadata extends GeneratedMessageV3 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.v1beta1.UsageMetadata
Inherited Members
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)
Static Fields
CACHED_CONTENT_TOKEN_COUNT_FIELD_NUMBER
public static final int CACHED_CONTENT_TOKEN_COUNT_FIELD_NUMBER
| Field Value |
| Type |
Description |
int |
|
public static final int CACHE_TOKENS_DETAILS_FIELD_NUMBER
| Field Value |
| Type |
Description |
int |
|
public static final int CANDIDATES_TOKENS_DETAILS_FIELD_NUMBER
| Field Value |
| Type |
Description |
int |
|
public static final int CANDIDATES_TOKEN_COUNT_FIELD_NUMBER
| Field Value |
| Type |
Description |
int |
|
public static final int PROMPT_TOKENS_DETAILS_FIELD_NUMBER
| Field Value |
| Type |
Description |
int |
|
public static final int PROMPT_TOKEN_COUNT_FIELD_NUMBER
| Field Value |
| Type |
Description |
int |
|
public static final int THOUGHTS_TOKEN_COUNT_FIELD_NUMBER
| Field Value |
| Type |
Description |
int |
|
public static final int TOOL_USE_PROMPT_TOKENS_DETAILS_FIELD_NUMBER
| Field Value |
| Type |
Description |
int |
|
public static final int TOOL_USE_PROMPT_TOKEN_COUNT_FIELD_NUMBER
| Field Value |
| Type |
Description |
int |
|
public static final int TOTAL_TOKEN_COUNT_FIELD_NUMBER
| Field Value |
| Type |
Description |
int |
|
public static final int TRAFFIC_TYPE_FIELD_NUMBER
| Field Value |
| Type |
Description |
int |
|
Static Methods
public static UsageMetadata getDefaultInstance()
public static final Descriptors.Descriptor getDescriptor()
public static UsageMetadata.Builder newBuilder()
public static UsageMetadata.Builder newBuilder(UsageMetadata prototype)
public static UsageMetadata parseDelimitedFrom(InputStream input)
public static UsageMetadata parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
public static UsageMetadata parseFrom(byte[] data)
| Parameter |
| Name |
Description |
data |
byte[]
|
public static UsageMetadata parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static UsageMetadata parseFrom(ByteString data)
public static UsageMetadata parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static UsageMetadata parseFrom(CodedInputStream input)
public static UsageMetadata parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public static UsageMetadata parseFrom(InputStream input)
public static UsageMetadata parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
public static UsageMetadata parseFrom(ByteBuffer data)
public static UsageMetadata parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Parser<UsageMetadata> parser()
Methods
public boolean equals(Object obj)
| Parameter |
| Name |
Description |
obj |
Object
|
Overrides
public ModalityTokenCount getCacheTokensDetails(int index)
Output only. A detailed breakdown of the token count for each modality in
the cached content.
repeated .google.cloud.aiplatform.v1beta1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Parameter |
| Name |
Description |
index |
int
|
public int getCacheTokensDetailsCount()
Output only. A detailed breakdown of the token count for each modality in
the cached content.
repeated .google.cloud.aiplatform.v1beta1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Returns |
| Type |
Description |
int |
|
public List<ModalityTokenCount> getCacheTokensDetailsList()
Output only. A detailed breakdown of the token count for each modality in
the cached content.
repeated .google.cloud.aiplatform.v1beta1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
public ModalityTokenCountOrBuilder getCacheTokensDetailsOrBuilder(int index)
Output only. A detailed breakdown of the token count for each modality in
the cached content.
repeated .google.cloud.aiplatform.v1beta1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Parameter |
| Name |
Description |
index |
int
|
public List<? extends ModalityTokenCountOrBuilder> getCacheTokensDetailsOrBuilderList()
Output only. A detailed breakdown of the token count for each modality in
the cached content.
repeated .google.cloud.aiplatform.v1beta1.ModalityTokenCount cache_tokens_details = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Returns |
| Type |
Description |
List<? extends com.google.cloud.aiplatform.v1beta1.ModalityTokenCountOrBuilder> |
|
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];
| Returns |
| Type |
Description |
int |
The cachedContentTokenCount.
|
public int getCandidatesTokenCount()
The total number of tokens in the generated candidates.
int32 candidates_token_count = 2;
| Returns |
| Type |
Description |
int |
The candidatesTokenCount.
|
public ModalityTokenCount getCandidatesTokensDetails(int index)
Output only. A detailed breakdown of the token count for each modality in
the generated candidates.
repeated .google.cloud.aiplatform.v1beta1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Parameter |
| Name |
Description |
index |
int
|
public int getCandidatesTokensDetailsCount()
Output only. A detailed breakdown of the token count for each modality in
the generated candidates.
repeated .google.cloud.aiplatform.v1beta1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Returns |
| Type |
Description |
int |
|
public List<ModalityTokenCount> getCandidatesTokensDetailsList()
Output only. A detailed breakdown of the token count for each modality in
the generated candidates.
repeated .google.cloud.aiplatform.v1beta1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
public ModalityTokenCountOrBuilder getCandidatesTokensDetailsOrBuilder(int index)
Output only. A detailed breakdown of the token count for each modality in
the generated candidates.
repeated .google.cloud.aiplatform.v1beta1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Parameter |
| Name |
Description |
index |
int
|
public List<? extends ModalityTokenCountOrBuilder> getCandidatesTokensDetailsOrBuilderList()
Output only. A detailed breakdown of the token count for each modality in
the generated candidates.
repeated .google.cloud.aiplatform.v1beta1.ModalityTokenCount candidates_tokens_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Returns |
| Type |
Description |
List<? extends com.google.cloud.aiplatform.v1beta1.ModalityTokenCountOrBuilder> |
|
public UsageMetadata getDefaultInstanceForType()
public Parser<UsageMetadata> getParserForType()
Overrides
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;
| Returns |
| Type |
Description |
int |
The promptTokenCount.
|
public ModalityTokenCount getPromptTokensDetails(int index)
Output only. A detailed breakdown of the token count for each modality in
the prompt.
repeated .google.cloud.aiplatform.v1beta1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Parameter |
| Name |
Description |
index |
int
|
public int getPromptTokensDetailsCount()
Output only. A detailed breakdown of the token count for each modality in
the prompt.
repeated .google.cloud.aiplatform.v1beta1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Returns |
| Type |
Description |
int |
|
public List<ModalityTokenCount> getPromptTokensDetailsList()
Output only. A detailed breakdown of the token count for each modality in
the prompt.
repeated .google.cloud.aiplatform.v1beta1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
public ModalityTokenCountOrBuilder getPromptTokensDetailsOrBuilder(int index)
Output only. A detailed breakdown of the token count for each modality in
the prompt.
repeated .google.cloud.aiplatform.v1beta1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Parameter |
| Name |
Description |
index |
int
|
public List<? extends ModalityTokenCountOrBuilder> getPromptTokensDetailsOrBuilderList()
Output only. A detailed breakdown of the token count for each modality in
the prompt.
repeated .google.cloud.aiplatform.v1beta1.ModalityTokenCount prompt_tokens_details = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Returns |
| Type |
Description |
List<? extends com.google.cloud.aiplatform.v1beta1.ModalityTokenCountOrBuilder> |
|
public int getSerializedSize()
| Returns |
| Type |
Description |
int |
|
Overrides
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];
| Returns |
| Type |
Description |
int |
The thoughtsTokenCount.
|
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];
| Returns |
| Type |
Description |
int |
The toolUsePromptTokenCount.
|
public ModalityTokenCount getToolUsePromptTokensDetails(int index)
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.v1beta1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Parameter |
| Name |
Description |
index |
int
|
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.v1beta1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Returns |
| Type |
Description |
int |
|
public List<ModalityTokenCount> 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.v1beta1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
public ModalityTokenCountOrBuilder getToolUsePromptTokensDetailsOrBuilder(int index)
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.v1beta1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Parameter |
| Name |
Description |
index |
int
|
public List<? extends ModalityTokenCountOrBuilder> 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.v1beta1.ModalityTokenCount tool_use_prompt_tokens_details = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Returns |
| Type |
Description |
List<? extends com.google.cloud.aiplatform.v1beta1.ModalityTokenCountOrBuilder> |
|
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;
| Returns |
| Type |
Description |
int |
The totalTokenCount.
|
public UsageMetadata.TrafficType getTrafficType()
Output only. The traffic type for this request.
.google.cloud.aiplatform.v1beta1.UsageMetadata.TrafficType traffic_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
public int getTrafficTypeValue()
Output only. The traffic type for this request.
.google.cloud.aiplatform.v1beta1.UsageMetadata.TrafficType traffic_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Returns |
| Type |
Description |
int |
The enum numeric value on the wire for trafficType.
|
| Returns |
| Type |
Description |
int |
|
Overrides
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
public final boolean isInitialized()
Overrides
public UsageMetadata.Builder newBuilderForType()
protected UsageMetadata.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Overrides
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
| Returns |
| Type |
Description |
Object |
|
Overrides
public UsageMetadata.Builder toBuilder()
public void writeTo(CodedOutputStream output)
Overrides