Package-level declarations

Types

Link copied to clipboard

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.

Link copied to clipboard
class MessageTokenizer(val promptTokenizer: PromptTokenizer)

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.

Link copied to clipboard

Configuration class for message tokenization settings.

Link copied to clipboard

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.

Link copied to clipboard
interface PromptTokenizer

An interface that provides utilities for tokenizing and calculating token usage in messages and prompts.

Properties

Link copied to clipboard

Provides access to the PromptTokenizer instance used within the AI agent's context.