AsyncClient

Trait AsyncClient 

Source
pub trait AsyncClient: Send + Sync {
    // Required methods
    fn chat_completion<'life0, 'async_trait>(
        &'life0 self,
        messages: Vec<ChatMessage>,
    ) -> Pin<Box<dyn Future<Output = RsllmResult<ChatResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn chat_completion_stream<'life0, 'async_trait>(
        &'life0 self,
        messages: Vec<ChatMessage>,
    ) -> Pin<Box<dyn Future<Output = RsllmResult<ChatStream>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn health_check<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RsllmResult<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Async client trait for custom implementations

Required Methods§

Source

fn chat_completion<'life0, 'async_trait>( &'life0 self, messages: Vec<ChatMessage>, ) -> Pin<Box<dyn Future<Output = RsllmResult<ChatResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Chat completion

Source

fn chat_completion_stream<'life0, 'async_trait>( &'life0 self, messages: Vec<ChatMessage>, ) -> Pin<Box<dyn Future<Output = RsllmResult<ChatStream>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Chat completion streaming

Source

fn health_check<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RsllmResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Health check

Implementors§