pub trait LLMClient: Send + Sync {
// Required methods
fn generate<'life0, 'life1, 'async_trait>(
&'life0 mut self,
prompt: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<LLMResponse, LLMError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn model_id(&self) -> &str;
}Expand description
Unified LLM client trait.
Note: backend_kind() lives on LLMProvider
rather than here, following the single responsibility principle — the
provider knows its own backend identity.
Required Methods§
fn generate<'life0, 'life1, 'async_trait>(
&'life0 mut self,
prompt: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<LLMResponse, LLMError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn model_id(&self) -> &str
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".