UsageMetadata class final

Metadata on the generation request's token usage.

Properties

cachedContentTokenCount int?
The number of tokens in the prompt that were served from the cache. If implicit caching is not active or no content was cached, this will be 0.
final
cacheTokensDetails List<ModalityTokenCount>?
Detailed breakdown of the cached tokens by modality (e.g., text, image). This list provides granular insight into which parts of the content were cached.
final
candidatesTokenCount int?
Total number of tokens across the generated candidates.
final
candidatesTokensDetails List<ModalityTokenCount>?
List of modalities that were returned in the response.
final
hashCode int
The hash code for this object.
no setterinherited
promptTokenCount int?
Number of tokens in the prompt.
final
promptTokensDetails List<ModalityTokenCount>?
List of modalities that were processed in the request input.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
thoughtsTokenCount int?
Number of tokens present in thoughts output.
final
toolUsePromptTokenCount int?
The number of tokens used by tools.
final
toolUsePromptTokensDetails List<ModalityTokenCount>?
A list of tokens used by tools whose usage was triggered from a prompt, broken down by modality.
final
totalTokenCount int?
Total token count for the generation request (prompt + candidates).
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited