text_compressors
autogen.agentchat.contrib.capabilities.text_compressors.TextCompressor
TextCompressor
Defines a protocol for text compression to optimize agent interactions.
Parameters:Name | Description |
---|---|
*args | |
**kwargs |
Instance Methods
compress_text
This method takes a string as input and returns a dictionary containing the compressed text and other
relevant information. The compressed text should be stored under the ‘compressed_text’ key in the dictionary.
To calculate the number of saved tokens, the dictionary should include ‘origin_tokens’ and ‘compressed_tokens’ keys.
Name | Description |
---|---|
text | Type: str |
**compression_params |