Class BedrockTokenUsage
java.lang.Object
dev.langchain4j.model.output.TokenUsage
dev.langchain4j.model.bedrock.BedrockTokenUsage
Bedrock-specific token usage that includes cache-related metrics.
This class extends TokenUsage to include AWS Bedrock prompt caching
metrics: cacheWriteInputTokens() and cacheReadInputTokens().
- Since:
- 1.0.0-beta2
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(TokenUsage that) static BedrockTokenUsage.Builderbuilder()Returns The total cached token read count, or null if unknown.Returns The total cached token write count, or null if unknown.booleaninthashCode()toString()Methods inherited from class TokenUsage
inputTokenCount, outputTokenCount, sum, sum, totalTokenCount
-
Constructor Details
-
BedrockTokenUsage
-
-
Method Details
-
cacheWriteInputTokens
Returns The total cached token write count, or null if unknown.- Returns:
- The total cached token write count, or null if unknown.
-
cacheReadInputTokens
Returns The total cached token read count, or null if unknown.- Returns:
- The total cached token read count, or null if unknown.
-
add
- Overrides:
addin classTokenUsage
-
equals
- Overrides:
equalsin classTokenUsage
-
hashCode
public int hashCode()- Overrides:
hashCodein classTokenUsage
-
toString
- Overrides:
toStringin classTokenUsage
-
builder
-