Client

Trait Client 

Source
pub trait Client: Send + Sync {
    // Required methods
    fn chat<'life0, 'async_trait>(
        &'life0 self,
        request: ChatRequest,
    ) -> Pin<Box<dyn Future<Output = Result<ChatResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_provider(&self) -> &str;
    fn get_model(&self) -> &str;
}
Expand description

Trait for AI client implementations.

Required Methods§

Source

fn chat<'life0, 'async_trait>( &'life0 self, request: ChatRequest, ) -> Pin<Box<dyn Future<Output = Result<ChatResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Sends a chat request and returns the response.

Source

fn get_provider(&self) -> &str

Returns the provider name (e.g., “openai”, “claude”).

Source

fn get_model(&self) -> &str

Returns the model name being used.

Implementors§