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§
Sourcefn 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 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.
Sourcefn get_provider(&self) -> &str
fn get_provider(&self) -> &str
Returns the provider name (e.g., “openai”, “claude”).