Expand description
Context Compression Engine (Phase 2 - ENG-34)
Provides token counting and context budget management for LLM interactions. Uses tiktoken-rs for accurate token counting with explicit error handling.
Structs§
- Context
Budget Input - Input for context budget checking
- Context
Budget Result - Result of context budget check
- Memory
Token Count - Token count for a single memory
Enums§
- Compression
Strategy - Compression strategy for memory content
- Token
Encoding - Supported encoding types for token counting
Functions§
- check_
context_ budget - Check token budget for a set of memories
- count_
tokens - Count tokens in text using the specified model or encoding.
- detect_
encoding - Detect the appropriate encoding for a model name
- parse_
encoding - Parse encoding string to TokenEncoding