Skip to main content

LLMClient

Trait LLMClient 

Source
pub trait LLMClient: Send + Sync {
    // Required methods
    fn generate_summary<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        text: &'life1 str,
        prompt: &'life2 str,
        max_tokens: usize,
        temperature: f32,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn model_name(&self) -> &str;

    // Provided method
    fn generate_summary_batch<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        texts: &'life1 [(&'life2 str, &'life3 str)],
        max_tokens: usize,
        temperature: f32,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait { ... }
}
Expand description

Trait for LLM client to be used in summarization

Required Methods§

Source

fn generate_summary<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, text: &'life1 str, prompt: &'life2 str, max_tokens: usize, temperature: f32, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Generate a summary for the given text

Source

fn model_name(&self) -> &str

Get model name

Provided Methods§

Source

fn generate_summary_batch<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, texts: &'life1 [(&'life2 str, &'life3 str)], max_tokens: usize, temperature: f32, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Generate summary in batch for multiple texts

Implementors§