Expand description
Message Compressor Module
This module provides message compression functionality to reduce context size while preserving important content. It supports:
- Code block compression (keeping head and tail lines)
- Tool output compression
- File content compression
- Incremental compression on message addition
- Progressive pruning based on context usage
§Example
ⓘ
use aster::context::compressor::MessageCompressor;
let code = "fn main() {\n // 100 lines of code\n}";
let compressed = MessageCompressor::compress_code_block(code, 50);Structs§
- Message
Compressor - Message compressor for reducing context size while preserving important content.
Constants§
- DEFAULT_
CODE_ BLOCK_ MAX_ LINES - Default maximum lines for code blocks before compression
- DEFAULT_
FILE_ CONTENT_ MAX_ CHARS - Default maximum characters for file content before compression
- DEFAULT_
TOOL_ OUTPUT_ MAX_ CHARS - Default maximum characters for tool output before compression