pub trait Summarizer:
Send
+ Sync
+ 'static {
// Required method
fn summarize<'life0, 'life1, 'async_trait>(
&'life0 self,
messages: Vec<Message>,
ctx: &'life1 ExecutionContext,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Reduces a buffer of conversation messages to a summary string.
Implementations decide how to summarise — typically by calling
an LLM. The trait stays provider-agnostic; concrete impls (such
as entelix_agents::RunnableToSummarizerAdapter) wire in the model.
Required Methods§
Sourcefn summarize<'life0, 'life1, 'async_trait>(
&'life0 self,
messages: Vec<Message>,
ctx: &'life1 ExecutionContext,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn summarize<'life0, 'life1, 'async_trait>(
&'life0 self,
messages: Vec<Message>,
ctx: &'life1 ExecutionContext,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Summarise messages into a single string. Returning Err
signals a transient failure — the consolidating buffer
keeps the original messages and re-attempts next call.