Skip to main content

Module manager

Module manager 

Source
Expand description

Enhanced Context Manager Module

This module provides comprehensive context management functionality including:

  • Conversation turn storage with token estimates
  • Automatic compression when threshold is exceeded
  • AI-powered and simple summarization
  • Export/import of context state
  • Statistics and reporting
  • Tool reference collapsing

§Example

use aster::context::manager::EnhancedContextManager;
use aster::context::types::ContextConfig;

let config = ContextConfig::default();
let mut manager = EnhancedContextManager::new(config);
manager.set_system_prompt("You are a helpful assistant.");

// Add conversation turns
manager.add_turn(user_message, assistant_message, Some(usage));

// Get messages for API call
let messages = manager.get_messages();

Structs§

EnhancedContextManager
Enhanced context manager with compression, summarization, and statistics.