Class AnthropicTokenUsage

java.lang.Object
dev.langchain4j.model.output.TokenUsage
dev.langchain4j.model.anthropic.AnthropicTokenUsage

public class AnthropicTokenUsage extends TokenUsage
  • Constructor Details

    • AnthropicTokenUsage

      public AnthropicTokenUsage(Integer inputTokenCount, Integer outputTokenCount, Integer cacheCreationInputTokens, Integer cacheReadInputTokens)
      Creates a new AnthropicTokenUsage 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

      public Integer cacheCreationInputTokens()
      Returns The total cached token created count, or null if unknown.
      Returns:
      The total cached token created count, or null if unknown.
    • cacheReadInputTokens

      public Integer cacheReadInputTokens()
      Returns The total cached token read count, or null if unknown.
      Returns:
      The total cached token read count, or null if unknown.