pub trait ChatProvider: Send + Sync {
type Config: ProviderConfig;
type Response: ChatResponse;
type Error: ProviderError;
// Required method
fn chat<'life0, 'async_trait>(
&'life0 self,
request: ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
}
Expand description
Base trait for chat-based LLM providers.
This trait defines the core chat functionality that most LLM providers support. Providers implement this trait to provide conversational AI capabilities.
Required Associated Types§
Sourcetype Config: ProviderConfig
type Config: ProviderConfig
Provider-specific configuration type
Sourcetype Response: ChatResponse
type Response: ChatResponse
Provider-specific response type
Sourcetype Error: ProviderError
type Error: ProviderError
Provider-specific error type