Class GoogleGenAiTokenCountEstimator

java.lang.Object
dev.langchain4j.model.google.genai.GoogleGenAiTokenCountEstimator
All Implemented Interfaces:
dev.langchain4j.model.TokenCountEstimator

public class GoogleGenAiTokenCountEstimator extends Object implements dev.langchain4j.model.TokenCountEstimator
  • Method Details

    • builder

      public static GoogleGenAiTokenCountEstimator.Builder builder()
    • estimateTokenCountInText

      public int estimateTokenCountInText(String text)
      Specified by:
      estimateTokenCountInText in interface dev.langchain4j.model.TokenCountEstimator
    • estimateTokenCountInMessage

      public int estimateTokenCountInMessage(dev.langchain4j.data.message.ChatMessage message)
      Specified by:
      estimateTokenCountInMessage in interface dev.langchain4j.model.TokenCountEstimator
    • estimateTokenCountInMessages

      public int estimateTokenCountInMessages(Iterable<dev.langchain4j.data.message.ChatMessage> messages)
      Specified by:
      estimateTokenCountInMessages in interface dev.langchain4j.model.TokenCountEstimator
    • estimateTokenCountInToolExecutionRequests

      public int estimateTokenCountInToolExecutionRequests(Iterable<dev.langchain4j.agent.tool.ToolExecutionRequest> toolExecutionRequests)
    • estimateTokenCountInToolSpecifications

      public int estimateTokenCountInToolSpecifications(Iterable<dev.langchain4j.agent.tool.ToolSpecification> toolSpecifications)