Skip to main content

AgentSessionSummarizer

Trait AgentSessionSummarizer 

Source
pub trait AgentSessionSummarizer: Send + Sync {
    // Required methods
    fn descriptor(&self) -> SessionSummarizerDescriptor;
    fn summarize<'life0, 'async_trait>(
        &'life0 self,
        input: SessionCompactionInput,
    ) -> Pin<Box<dyn Future<Output = Result<ModelMessage, SessionContextError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn summarize_with_char_budget<'life0, 'async_trait>(
        &'life0 self,
        input: SessionCompactionInput,
        _max_chars: usize,
    ) -> Pin<Box<dyn Future<Output = Result<ModelMessage, SessionContextError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}

Required Methods§

Source

fn descriptor(&self) -> SessionSummarizerDescriptor

Source

fn summarize<'life0, 'async_trait>( &'life0 self, input: SessionCompactionInput, ) -> Pin<Box<dyn Future<Output = Result<ModelMessage, SessionContextError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

fn summarize_with_char_budget<'life0, 'async_trait>( &'life0 self, input: SessionCompactionInput, _max_chars: usize, ) -> Pin<Box<dyn Future<Output = Result<ModelMessage, SessionContextError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

A size hint for pressure compaction, including the summary’s framing text. The runtime still meters the complete candidate model input and never commits a summary that increases its context use. Implementations that do not support adaptive summaries may return their normal result.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§