Skip to main content

AiService

Trait AiService 

Source
pub trait AiService: Send + Sync {
    // Required method
    fn chat<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        system_prompt: &'life1 str,
        user_content: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided method
    fn translate<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        text: &'life1 str,
        direction: &'life2 TranslateDirection,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
}

Required Methods§

Source

fn chat<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, system_prompt: &'life1 str, user_content: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Provided Methods§

Source

fn translate<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, text: &'life1 str, direction: &'life2 TranslateDirection, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Implementors§