pub trait LlmProvider: Send + Sync {
// Required methods
fn generate<'life0, 'async_trait>(
&'life0 self,
req: LlmRequest,
) -> Pin<Box<dyn Future<Output = Result<LlmResponse>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn name(&self) -> &str;
fn supports_model(&self, model: &str) -> bool;
}Expand description
Trait for LLM providers (Anthropic, OpenAI, Ollama, etc.)
Required Methods§
Sourcefn generate<'life0, 'async_trait>(
&'life0 self,
req: LlmRequest,
) -> Pin<Box<dyn Future<Output = Result<LlmResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate<'life0, 'async_trait>(
&'life0 self,
req: LlmRequest,
) -> Pin<Box<dyn Future<Output = Result<LlmResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate a response (non-streaming)
Sourcefn supports_model(&self, model: &str) -> bool
fn supports_model(&self, model: &str) -> bool
Models supported by this provider (prefix matching)