Skip to main content

MessageHistoryLimiter

Limits the number of messages considered by an agent for response generation.
This transform keeps only the most recent messages up to the specified maximum number of messages (max_messages).
It trims the conversation history by removing older messages, retaining only the most recent messages.
Parameters:

Instance Methods

apply_transform

Truncates the conversation history to the specified maximum number of messages.
This method returns a new list containing the most recent messages up to the specified maximum number of messages (max_messages). If max_messages is None, it returns the original list of messages unmodified.
Parameters: Returns:

get_logs

Parameters: