Class GoogleAiGeminiTokenCountEstimator
java.lang.Object
dev.langchain4j.model.googleai.GoogleAiGeminiTokenCountEstimator
- All Implemented Interfaces:
TokenCountEstimator
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionbuilder()intestimateTokenCountInMessage(ChatMessage message) Estimates the count of tokens in the given message.intestimateTokenCountInMessages(Iterable<ChatMessage> messages) Estimates the count of tokens in the given messages.intEstimates the count of tokens in the given text.intestimateTokenCountInToolExecutionRequests(Iterable<ToolExecutionRequest> toolExecutionRequests) intestimateTokenCountInToolSpecifications(Iterable<ToolSpecification> toolSpecifications)
-
Constructor Details
-
GoogleAiGeminiTokenCountEstimator
-
-
Method Details
-
builder
-
estimateTokenCountInText
Description copied from interface:TokenCountEstimatorEstimates the count of tokens in the given text.- Specified by:
estimateTokenCountInTextin interfaceTokenCountEstimator- Parameters:
text- the text.- Returns:
- the estimated count of tokens.
-
estimateTokenCountInMessage
Description copied from interface:TokenCountEstimatorEstimates the count of tokens in the given message.- Specified by:
estimateTokenCountInMessagein interfaceTokenCountEstimator- Parameters:
message- the message.- Returns:
- the estimated count of tokens.
-
estimateTokenCountInToolExecutionRequests
public int estimateTokenCountInToolExecutionRequests(Iterable<ToolExecutionRequest> toolExecutionRequests) -
estimateTokenCountInMessages
Description copied from interface:TokenCountEstimatorEstimates the count of tokens in the given messages.- Specified by:
estimateTokenCountInMessagesin interfaceTokenCountEstimator- Parameters:
messages- the messages.- Returns:
- the estimated count of tokens.
-
estimateTokenCountInToolSpecifications
-