Skip to main content

TextMessageCompressor

A transform for compressing text messages in a conversation history.
It uses a specified text compression method to reduce the token count of messages, which can lead to more efficient processing and response generation by downstream models.
Parameters:

Instance Methods

apply_transform

Applies compression to messages in a conversation history based on the specified configuration.
The function processes each message according to the compression_args and min_tokens settings, applying the specified compression configuration and returning a new list of messages with reduced token counts where possible.
Parameters: Returns:

get_logs

Parameters: