Skip to main content

BaseEventsSummarizer

Trait BaseEventsSummarizer 

Source
pub trait BaseEventsSummarizer: Send + Sync {
    // Required method
    fn summarize_events<'life0, 'life1, 'async_trait>(
        &'life0 self,
        events: &'life1 [Event],
    ) -> Pin<Box<dyn Future<Output = Result<Option<Event>, AdkError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
}
Expand description

Core traits and types.

Always available regardless of feature flags. Includes:

  • Agent - The fundamental trait for all agents
  • Tool / Toolset - For extending agents with capabilities
  • Session / State - For managing conversation context
  • Event - For streaming agent responses
  • AdkError / Result - Unified error handling Trait for summarizing events during context compaction.

Implementations receive a window of events and produce a single compacted event containing a summary. The runner calls this when the compaction interval is reached.

Required Methods§

Source

fn summarize_events<'life0, 'life1, 'async_trait>( &'life0 self, events: &'life1 [Event], ) -> Pin<Box<dyn Future<Output = Result<Option<Event>, AdkError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Summarize the given events into a single compacted event. Returns None if no compaction is needed (e.g., empty input).

Implementors§