Table of Contents

Class GeminiUsageMetadata

Metadata on the generation request's token usage.

public class GeminiUsageMetadata : IAppendableData<GeminiUsageMetadata>
Inheritance
GeminiUsageMetadata
Implements
Extension Methods

Fields

CachedContentTokenCount

Number of tokens in the cached part of the prompt, i.e. in the cached content.

public int CachedContentTokenCount

Field Value

int

CandidatesTokenCount

Total number of tokens across the generated candidates.

public int CandidatesTokenCount

Field Value

int

PromptTokenCount

Number of tokens in the prompt. When cachedContent is set, this is still the total effective prompt size. I.e. this includes the number of tokens in the cached content.

public int PromptTokenCount

Field Value

int

Remarks

Cached content is not supported in this package.

TotalTokenCount

Total token count for the generation request (prompt + candidates).

public int TotalTokenCount

Field Value

int

Methods

Append(GeminiUsageMetadata)

Appends the data to the current IAppendableData<T>.

public void Append(GeminiUsageMetadata data)

Parameters

data GeminiUsageMetadata

The data to append.