Vertex AI v1beta1 API - Class UsageMetadata (1.0.0-beta57)

public sealed class UsageMetadata : IMessage<UsageMetadata>, IEquatable<UsageMetadata>, IDeepCloneable<UsageMetadata>, IBufferMessage, IMessage

Reference documentation and code samples for the Vertex AI v1beta1 API class UsageMetadata.

Usage metadata about the content generation request and response. This message provides a detailed breakdown of token usage and other relevant metrics.

Inheritance

object > UsageMetadata

Namespace

Google.Cloud.AIPlatform.V1Beta1

Assembly

Google.Cloud.AIPlatform.V1Beta1.dll

Constructors

UsageMetadata()

public UsageMetadata()

UsageMetadata(UsageMetadata)

public UsageMetadata(UsageMetadata other)
Parameter
Name Description
other UsageMetadata

Properties

CacheTokensDetails

public RepeatedField<ModalityTokenCount> CacheTokensDetails { get; }

Output only. A detailed breakdown of the token count for each modality in the cached content.

Property Value
Type Description
RepeatedFieldModalityTokenCount

CachedContentTokenCount

public int CachedContentTokenCount { get; set; }

Output only. The number of tokens in the cached content that was used for this request.

Property Value
Type Description
int

CandidatesTokenCount

public int CandidatesTokenCount { get; set; }

The total number of tokens in the generated candidates.

Property Value
Type Description
int

CandidatesTokensDetails

public RepeatedField<ModalityTokenCount> CandidatesTokensDetails { get; }

Output only. A detailed breakdown of the token count for each modality in the generated candidates.

Property Value
Type Description
RepeatedFieldModalityTokenCount

PromptTokenCount

public int PromptTokenCount { get; set; }

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.

Property Value
Type Description
int

PromptTokensDetails

public RepeatedField<ModalityTokenCount> PromptTokensDetails { get; }

Output only. A detailed breakdown of the token count for each modality in the prompt.

Property Value
Type Description
RepeatedFieldModalityTokenCount

ThoughtsTokenCount

public int ThoughtsTokenCount { get; set; }

Output only. The number of tokens that were part of the model's generated "thoughts" output, if applicable.

Property Value
Type Description
int

ToolUsePromptTokenCount

public int ToolUsePromptTokenCount { get; set; }

Output only. The number of tokens in the results from tool executions, which are provided back to the model as input, if applicable.

Property Value
Type Description
int

ToolUsePromptTokensDetails

public RepeatedField<ModalityTokenCount> ToolUsePromptTokensDetails { get; }

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.

Property Value
Type Description
RepeatedFieldModalityTokenCount

TotalTokenCount

public int TotalTokenCount { get; set; }

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.

Property Value
Type Description
int

TrafficType

public UsageMetadata.Types.TrafficType TrafficType { get; set; }

Output only. The traffic type for this request.

Property Value
Type Description
UsageMetadataTypesTrafficType