Package-level declarations
Types
A caching implementation of the PromptTokenizer
interface that optimizes token counting by storing previously computed token counts for messages. This reduces redundant computations when the same message is processed multiple times.
The MessageTokenizer feature is responsible for handling tokenization of messages using a provided Tokenizer implementation. It serves as a feature that can be installed into an AIAgentPipeline
. The tokenizer behavior can be configured with caching or on-demand tokenization based on the provided configuration.
Configuration class for message tokenization settings.
An implementation of the PromptTokenizer interface that delegates token counting to an instance of the Tokenizer interface. The class provides methods to estimate the token count for individual messages and for the entirety of a prompt.
An interface that provides utilities for tokenizing and calculating token usage in messages and prompts.