MessageTokenizer

class MessageTokenizer(val promptTokenizer: PromptTokenizer)(source)

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.

Constructors

Link copied to clipboard
constructor(promptTokenizer: PromptTokenizer)

Types

Link copied to clipboard

Companion object implementing the AIAgentFeature interface for the MessageTokenizer feature. This feature integrates a message tokenizer into the agent pipeline, allowing for tokenization of input messages. It supports both caching and non-caching tokenization strategies based on the configuration.

Properties

Link copied to clipboard

An instance of PromptTokenizer used to process tokenization of messages and prompts.