Package dev.langchain4j.model.googleai
Class GoogleAiGeminiTokenizer
java.lang.Object
dev.langchain4j.model.googleai.GoogleAiGeminiTokenizer
- All Implemented Interfaces:
Tokenizer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
int
estimateTokenCountInMessage
(ChatMessage message) Estimates the count of tokens in the given message.int
estimateTokenCountInMessages
(Iterable<ChatMessage> messages) Estimates the count of tokens in the given messages.int
Estimates the count of tokens in the given text.int
estimateTokenCountInToolExecutionRequests
(Iterable<ToolExecutionRequest> toolExecutionRequests) int
estimateTokenCountInToolSpecifications
(Iterable<ToolSpecification> toolSpecifications)
-
Method Details
-
builder
-
estimateTokenCountInText
Description copied from interface:Tokenizer
Estimates the count of tokens in the given text.- Specified by:
estimateTokenCountInText
in interfaceTokenizer
- Parameters:
text
- the text.- Returns:
- the estimated count of tokens.
-
estimateTokenCountInMessage
Description copied from interface:Tokenizer
Estimates the count of tokens in the given message.- Specified by:
estimateTokenCountInMessage
in interfaceTokenizer
- Parameters:
message
- the message.- Returns:
- the estimated count of tokens.
-
estimateTokenCountInToolExecutionRequests
public int estimateTokenCountInToolExecutionRequests(Iterable<ToolExecutionRequest> toolExecutionRequests) -
estimateTokenCountInMessages
Description copied from interface:Tokenizer
Estimates the count of tokens in the given messages.- Specified by:
estimateTokenCountInMessages
in interfaceTokenizer
- Parameters:
messages
- the messages.- Returns:
- the estimated count of tokens.
-
estimateTokenCountInToolSpecifications
-