Skip to main content

SummarizerClient

Trait SummarizerClient 

Source
pub trait SummarizerClient: Send + Sync {
    // Required method
    fn create_message<'life0, 'life1, 'async_trait>(
        &'life0 self,
        messages: Vec<Message>,
        system_prompt: Option<&'life1 str>,
    ) -> Pin<Box<dyn Future<Output = Result<SummarizerResponse, ContextError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait for clients that can generate AI summaries.

This trait abstracts the LLM client interface, allowing for different implementations (e.g., Anthropic, OpenAI) or mock clients for testing.

Required Methods§

Source

fn create_message<'life0, 'life1, 'async_trait>( &'life0 self, messages: Vec<Message>, system_prompt: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<SummarizerResponse, ContextError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create a message using the LLM.

§Arguments
  • messages - The conversation messages to send
  • system_prompt - Optional system prompt to guide the response
§Returns

A SummarizerResponse containing the generated content and usage stats.

Implementors§