Package dev.langchain4j.model.anthropic
Class AnthropicTokenUsage
java.lang.Object
dev.langchain4j.model.output.TokenUsage
dev.langchain4j.model.anthropic.AnthropicTokenUsage
-
Constructor Summary
ConstructorDescriptionAnthropicTokenUsage
(Integer inputTokenCount, Integer outputTokenCount, Integer cacheCreationInputTokens, Integer cacheReadInputTokens) Creates a newAnthropicTokenUsage
instance with the given input, output token counts and cache creation/read input tokens. -
Method Summary
Modifier and TypeMethodDescriptionReturns The total cached token created count, or null if unknown.Returns The total cached token read count, or null if unknown.Methods inherited from class dev.langchain4j.model.output.TokenUsage
add, equals, hashCode, inputTokenCount, outputTokenCount, sum, toString, totalTokenCount
-
Constructor Details
-
AnthropicTokenUsage
public AnthropicTokenUsage(Integer inputTokenCount, Integer outputTokenCount, Integer cacheCreationInputTokens, Integer cacheReadInputTokens) Creates a newAnthropicTokenUsage
instance with the given input, output token counts and cache creation/read input tokens.- Parameters:
inputTokenCount
- The input token count, or null if unknown.outputTokenCount
- The output token count, or null if unknown.cacheCreationInputTokens
- The total cached token created count, or null if unknown.cacheReadInputTokens
- The total cached token read count, or null if unknown.
-
-
Method Details
-
cacheCreationInputTokens
Returns The total cached token created count, or null if unknown.- Returns:
- The total cached token created 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.
-