Record Class Interaction.Usage
java.lang.Object
java.lang.Record
io.github.glaforge.gemini.interactions.model.Interaction.Usage
- Record Components:
totalInputTokens- Total input tokens.inputTokensByModality- Input tokens broken down by modality.totalCachedTokens- Total cached tokens.cachedTokensByModality- Cached tokens broken down by modality.totalOutputTokens- Total output tokens.outputTokensByModality- Output tokens broken down by modality.totalToolUseTokens- Total tool use tokens.toolUseTokensByModality- Tool use tokens broken down by modality.totalThoughtTokens- Total thought (reasoning) tokens.totalTokens- Total tokens.
- Enclosing class:
Interaction
public static record Interaction.Usage(Integer totalInputTokens, List<Interaction.ModalityTokens> inputTokensByModality, Integer totalCachedTokens, List<Interaction.ModalityTokens> cachedTokensByModality, Integer totalOutputTokens, List<Interaction.ModalityTokens> outputTokensByModality, Integer totalToolUseTokens, List<Interaction.ModalityTokens> toolUseTokensByModality, Integer totalThoughtTokens, Integer totalTokens)
extends Record
Token usage details.
-
Constructor Summary
ConstructorsConstructorDescriptionUsage(Integer totalInputTokens, List<Interaction.ModalityTokens> inputTokensByModality, Integer totalCachedTokens, List<Interaction.ModalityTokens> cachedTokensByModality, Integer totalOutputTokens, List<Interaction.ModalityTokens> outputTokensByModality, Integer totalToolUseTokens, List<Interaction.ModalityTokens> toolUseTokensByModality, Integer totalThoughtTokens, Integer totalTokens) Creates an instance of aUsagerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecachedTokensByModalityrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theinputTokensByModalityrecord component.Returns the value of theoutputTokensByModalityrecord component.Returns the value of thetoolUseTokensByModalityrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetotalCachedTokensrecord component.Returns the value of thetotalInputTokensrecord component.Returns the value of thetotalOutputTokensrecord component.Returns the value of thetotalThoughtTokensrecord component.Returns the value of thetotalTokensrecord component.Returns the value of thetotalToolUseTokensrecord component.
-
Constructor Details
-
Usage
public Usage(Integer totalInputTokens, List<Interaction.ModalityTokens> inputTokensByModality, Integer totalCachedTokens, List<Interaction.ModalityTokens> cachedTokensByModality, Integer totalOutputTokens, List<Interaction.ModalityTokens> outputTokensByModality, Integer totalToolUseTokens, List<Interaction.ModalityTokens> toolUseTokensByModality, Integer totalThoughtTokens, Integer totalTokens) Creates an instance of aUsagerecord class.- Parameters:
totalInputTokens- the value for thetotalInputTokensrecord componentinputTokensByModality- the value for theinputTokensByModalityrecord componenttotalCachedTokens- the value for thetotalCachedTokensrecord componentcachedTokensByModality- the value for thecachedTokensByModalityrecord componenttotalOutputTokens- the value for thetotalOutputTokensrecord componentoutputTokensByModality- the value for theoutputTokensByModalityrecord componenttotalToolUseTokens- the value for thetotalToolUseTokensrecord componenttoolUseTokensByModality- the value for thetoolUseTokensByModalityrecord componenttotalThoughtTokens- the value for thetotalThoughtTokensrecord componenttotalTokens- the value for thetotalTokensrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
totalInputTokens
Returns the value of thetotalInputTokensrecord component.- Returns:
- the value of the
totalInputTokensrecord component
-
inputTokensByModality
Returns the value of theinputTokensByModalityrecord component.- Returns:
- the value of the
inputTokensByModalityrecord component
-
totalCachedTokens
Returns the value of thetotalCachedTokensrecord component.- Returns:
- the value of the
totalCachedTokensrecord component
-
cachedTokensByModality
Returns the value of thecachedTokensByModalityrecord component.- Returns:
- the value of the
cachedTokensByModalityrecord component
-
totalOutputTokens
Returns the value of thetotalOutputTokensrecord component.- Returns:
- the value of the
totalOutputTokensrecord component
-
outputTokensByModality
Returns the value of theoutputTokensByModalityrecord component.- Returns:
- the value of the
outputTokensByModalityrecord component
-
totalToolUseTokens
Returns the value of thetotalToolUseTokensrecord component.- Returns:
- the value of the
totalToolUseTokensrecord component
-
toolUseTokensByModality
Returns the value of thetoolUseTokensByModalityrecord component.- Returns:
- the value of the
toolUseTokensByModalityrecord component
-
totalThoughtTokens
Returns the value of thetotalThoughtTokensrecord component.- Returns:
- the value of the
totalThoughtTokensrecord component
-
totalTokens
Returns the value of thetotalTokensrecord component.- Returns:
- the value of the
totalTokensrecord component
-