pub trait LLMProvider: Send + Sync {
// Required methods
fn complete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: Vec<Message>,
options: &'life1 CompletionOptions,
client: &'life2 Client,
) -> Pin<Box<dyn Future<Output = AgentResult<CompletionResponse>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn provider_name(&self) -> &'static str;
fn is_configured(&self) -> bool;
}Expand description
LLM provider trait for abstracting different LLM APIs.
Required Methods§
Sourcefn complete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: Vec<Message>,
options: &'life1 CompletionOptions,
client: &'life2 Client,
) -> Pin<Box<dyn Future<Output = AgentResult<CompletionResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn complete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: Vec<Message>,
options: &'life1 CompletionOptions,
client: &'life2 Client,
) -> Pin<Box<dyn Future<Output = AgentResult<CompletionResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Send a completion request and return the response text.
Sourcefn provider_name(&self) -> &'static str
fn provider_name(&self) -> &'static str
Provider name for logging/debugging.
Sourcefn is_configured(&self) -> bool
fn is_configured(&self) -> bool
Check if the provider is properly configured.