Expand description
Session management and context compaction. LLM session management with automatic context compaction.
Structs§
- Compact
Result - Result of a manual compaction operation.
Used by
force_compact()to report what happened during compaction. - Compaction
Config - Configuration for conversation compaction
- Compaction
Result - Result of a compaction operation.
- LLMCompactor
- LLM-based compactor that summarizes older conversation using an LLM. It replaces older messages with a single summary message while preserving recent turns.
- LLMCompactor
Config - Configuration for LLM-based conversation compaction.
- LLMSession
- A session that manages communication with an LLM
- LLMSession
Config - Configuration for creating an LLM session
- LLMSession
Manager - Manages multiple LLM sessions
- Session
Status - Current status of an LLM session
- Threshold
Compactor - Compacts when context usage exceeds a threshold. It identifies turns to keep (most recent N) and applies the configured compaction strategy to older tool results.
- Token
Usage - Token usage statistics for the session
Enums§
- Compaction
Error - Error type for async compaction operations.
- Compactor
Config Error - Error type for compactor configuration.
- Compactor
Type - Type of compaction strategy to use.
- LLMProvider
- LLM provider type
- Tool
Compaction - Defines how tool results are handled during compaction.
Traits§
- Async
Compactor - Trait for async compaction strategies that require LLM calls.
Implementors must also implement
Compactorwithis_async() -> true. - Compactor
- Trait for conversation compaction strategies. Implementations decide when and how to compact conversation history to reduce token usage while preserving important context.