pub trait LlmProvider:
Send
+ Sync
+ 'static {
// Required methods
fn complete<'life0, 'async_trait>(
&'life0 self,
req: CompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<CompletionResponse>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn stream<'life0, 'async_trait>(
&'life0 self,
req: CompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'_, Result<StreamChunk>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn name(&self) -> &str;
}Expand description
Unified contract for chat-completion capable LLM providers.
Required Methods§
Sourcefn complete<'life0, 'async_trait>(
&'life0 self,
req: CompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<CompletionResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn complete<'life0, 'async_trait>(
&'life0 self,
req: CompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<CompletionResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Executes a single non-streaming completion request.