Class Usage
java.lang.Object
com.google.genai.gaos.models.interactions.Usage
Usage
Statistics on the interaction request's token usage.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionUsage()Usage(List<ModalityTokens> cachedTokensByModality, List<GroundingToolCount> groundingToolCount, List<ModalityTokens> inputTokensByModality, List<ModalityTokens> outputTokensByModality, List<ModalityTokens> toolUseTokensByModality, Integer totalCachedTokens, Integer totalInputTokens, Integer totalOutputTokens, Integer totalThoughtTokens, Integer totalTokens, Integer totalToolUseTokens) -
Method Summary
Modifier and TypeMethodDescriptionstatic Usage.Builderbuilder()A breakdown of cached token usage by modality.booleanGrounding tool count.inthashCode()A breakdown of input token usage by modality.A breakdown of output token usage by modality.A breakdown of tool-use token usage by modality.toString()Number of tokens in the cached part of the prompt (the cached content).Number of tokens in the prompt (context).Total number of tokens across all the generated responses.Number of tokens of thoughts for thinking models.Total token count for the interaction request (prompt + responses + other internal tokens).Number of tokens present in tool-use prompt(s).withCachedTokensByModality(List<ModalityTokens> cachedTokensByModality) A breakdown of cached token usage by modality.withGroundingToolCount(List<GroundingToolCount> groundingToolCount) Grounding tool count.withInputTokensByModality(List<ModalityTokens> inputTokensByModality) A breakdown of input token usage by modality.withOutputTokensByModality(List<ModalityTokens> outputTokensByModality) A breakdown of output token usage by modality.withToolUseTokensByModality(List<ModalityTokens> toolUseTokensByModality) A breakdown of tool-use token usage by modality.withTotalCachedTokens(Integer totalCachedTokens) Number of tokens in the cached part of the prompt (the cached content).withTotalInputTokens(Integer totalInputTokens) Number of tokens in the prompt (context).withTotalOutputTokens(Integer totalOutputTokens) Total number of tokens across all the generated responses.withTotalThoughtTokens(Integer totalThoughtTokens) Number of tokens of thoughts for thinking models.withTotalTokens(Integer totalTokens) Total token count for the interaction request (prompt + responses + other internal tokens).withTotalToolUseTokens(Integer totalToolUseTokens) Number of tokens present in tool-use prompt(s).
-
Constructor Details
-
Usage
public Usage(@Nullable List<ModalityTokens> cachedTokensByModality, @Nullable List<GroundingToolCount> groundingToolCount, @Nullable List<ModalityTokens> inputTokensByModality, @Nullable List<ModalityTokens> outputTokensByModality, @Nullable List<ModalityTokens> toolUseTokensByModality, @Nullable Integer totalCachedTokens, @Nullable Integer totalInputTokens, @Nullable Integer totalOutputTokens, @Nullable Integer totalThoughtTokens, @Nullable Integer totalTokens, @Nullable Integer totalToolUseTokens) -
Usage
public Usage()
-
-
Method Details
-
cachedTokensByModality
A breakdown of cached token usage by modality. -
groundingToolCount
Grounding tool count. -
inputTokensByModality
A breakdown of input token usage by modality. -
outputTokensByModality
A breakdown of output token usage by modality. -
toolUseTokensByModality
A breakdown of tool-use token usage by modality. -
totalCachedTokens
Number of tokens in the cached part of the prompt (the cached content). -
totalInputTokens
Number of tokens in the prompt (context). -
totalOutputTokens
Total number of tokens across all the generated responses. -
totalThoughtTokens
Number of tokens of thoughts for thinking models. -
totalTokens
Total token count for the interaction request (prompt + responses + other internal tokens). -
totalToolUseTokens
Number of tokens present in tool-use prompt(s). -
builder
-
withCachedTokensByModality
A breakdown of cached token usage by modality. -
withGroundingToolCount
Grounding tool count. -
withInputTokensByModality
A breakdown of input token usage by modality. -
withOutputTokensByModality
A breakdown of output token usage by modality. -
withToolUseTokensByModality
A breakdown of tool-use token usage by modality. -
withTotalCachedTokens
Number of tokens in the cached part of the prompt (the cached content). -
withTotalInputTokens
Number of tokens in the prompt (context). -
withTotalOutputTokens
Total number of tokens across all the generated responses. -
withTotalThoughtTokens
Number of tokens of thoughts for thinking models. -
withTotalTokens
Total token count for the interaction request (prompt + responses + other internal tokens). -
withTotalToolUseTokens
Number of tokens present in tool-use prompt(s). -
equals
-
hashCode
public int hashCode() -
toString
-