Class TokenUsage
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<TokenUsage.Builder,TokenUsage>
The token consumption statistics for language model operations during evaluation. Provides detailed breakdown of input, output, and total tokens used for cost tracking and performance monitoring.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic TokenUsage.Builderbuilder()final booleanfinal booleanequalsBySdkFields(Object obj) final <T> Optional<T>getValueForField(String fieldName, Class<T> clazz) final inthashCode()final IntegerThe number of tokens consumed for input processing during the evaluation.final IntegerThe number of tokens generated by the evaluator model in its response.static Class<? extends TokenUsage.Builder>final StringtoString()Returns a string representation of this object.final IntegerThe total number of tokens consumed during the evaluation, calculated as the sum of input and output tokens.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
inputTokens
The number of tokens consumed for input processing during the evaluation. Includes tokens from the evaluation prompt, agent traces, and any additional context provided to the evaluator model.
- Returns:
- The number of tokens consumed for input processing during the evaluation. Includes tokens from the evaluation prompt, agent traces, and any additional context provided to the evaluator model.
-
outputTokens
The number of tokens generated by the evaluator model in its response. Includes tokens for the score, explanation, and any additional output produced during the evaluation process.
- Returns:
- The number of tokens generated by the evaluator model in its response. Includes tokens for the score, explanation, and any additional output produced during the evaluation process.
-
totalTokens
The total number of tokens consumed during the evaluation, calculated as the sum of input and output tokens. Used for cost calculation and rate limiting within the service limits.
- Returns:
- The total number of tokens consumed during the evaluation, calculated as the sum of input and output tokens. Used for cost calculation and rate limiting within the service limits.
-
toBuilder
- Specified by:
toBuilderin interfaceToCopyableBuilder<TokenUsage.Builder,TokenUsage>
-
builder
-
serializableBuilderClass
-
hashCode
public final int hashCode() -
equals
-
equalsBySdkFields
- Specified by:
equalsBySdkFieldsin interfaceSdkPojo
-
toString
Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value. -
getValueForField
-
sdkFields
-
sdkFieldNameToField
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo
-