pub trait Provider: Send + Sync {
// Required method
fn complete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: &'life1 ChatRequest,
on_delta: &'life2 (dyn for<'a> Fn(&'a str) + Send + Sync),
) -> Pin<Box<dyn Future<Output = Result<(ChatMessage, Usage), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
}Expand description
Legacy provider abstraction preserved by the composition facade.
Required Methods§
Sourcefn complete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: &'life1 ChatRequest,
on_delta: &'life2 (dyn for<'a> Fn(&'a str) + Send + Sync),
) -> Pin<Box<dyn Future<Output = Result<(ChatMessage, Usage), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn complete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: &'life1 ChatRequest,
on_delta: &'life2 (dyn for<'a> Fn(&'a str) + Send + Sync),
) -> Pin<Box<dyn Future<Output = Result<(ChatMessage, Usage), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Run one completion and return its canonical assistant message and usage.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".