UsageMetadata class final

Usage metadata about response(s).

Inheritance
  • Object
  • ProtoMessage
  • UsageMetadata

Constructors

UsageMetadata({int promptTokenCount = 0, int cachedContentTokenCount = 0, int responseTokenCount = 0, int toolUsePromptTokenCount = 0, int thoughtsTokenCount = 0, int totalTokenCount = 0, List<ModalityTokenCount> promptTokensDetails = const [], List<ModalityTokenCount> cacheTokensDetails = const [], List<ModalityTokenCount> responseTokensDetails = const [], List<ModalityTokenCount> toolUsePromptTokensDetails = const []})
UsageMetadata.fromJson(Object? j)
factory

Properties

cachedContentTokenCount int
Number of tokens in the cached part of the prompt (the cached content)
final
cacheTokensDetails List<ModalityTokenCount>
Output only. List of modalities of the cached content in the request input.
final
hashCode int
The hash code for this object.
no setterinherited
promptTokenCount int
Output only. Number of tokens in the prompt. When cached_content is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content.
final
promptTokensDetails List<ModalityTokenCount>
Output only. List of modalities that were processed in the request input.
final
qualifiedName String
The fully qualified name of this message, i.e., google.protobuf.Duration or google.rpc.ErrorInfo.
finalinherited
responseTokenCount int
Output only. Total number of tokens across all the generated response candidates.
final
responseTokensDetails List<ModalityTokenCount>
Output only. List of modalities that were returned in the response.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
thoughtsTokenCount int
Output only. Number of tokens of thoughts for thinking models.
final
toolUsePromptTokenCount int
Output only. Number of tokens present in tool-use prompt(s).
final
toolUsePromptTokensDetails List<ModalityTokenCount>
Output only. List of modalities that were processed for tool-use request inputs.
final
totalTokenCount int
Output only. Total token count for the generation request (prompt + response candidates).
final

Methods

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

Operators

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

Constants

fullyQualifiedName → const String