Skip to main content

Module conversation

Module conversation 

Source
Expand description

Conversation management for context window handling.

This module provides utilities for managing long-running conversations, including automatic summarization and token management.

§Overview

  • ManagedConversation: Tracks messages and provides utilities
  • CompactingConversation: Auto-summarizes when approaching limits
  • ConversationConfig: Configuration for behavior

§Example

use liteforge::conversation::{ManagedConversation, ConversationConfig};
use liteforge::Message;

let mut conv = ManagedConversation::new();

conv.add_user_message("Hello!");
conv.add_assistant_message("Hi! How can I help?");

let messages = conv.messages();

Structs§

CompactingConversation
A conversation that automatically compacts when approaching token limits.
ConversationConfig
Configuration for conversation management.
ManagedConversation
A managed conversation that tracks messages and their metadata.

Enums§

SummarizationStrategy
Strategy for summarizing conversations.