pub trait Provider: Send + Sync {
// Required methods
fn id(&self) -> &str;
fn default_model(&self) -> &str;
fn complete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 CompletionRequest,
sink: Option<&'life2 StreamSink>,
) -> Pin<Box<dyn Future<Output = Result<CompletionResponse>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Required Methods§
Sourcefn default_model(&self) -> &str
fn default_model(&self) -> &str
Model used when the caller doesn’t name one.
Sourcefn complete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 CompletionRequest,
sink: Option<&'life2 StreamSink>,
) -> Pin<Box<dyn Future<Output = Result<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,
req: &'life1 CompletionRequest,
sink: Option<&'life2 StreamSink>,
) -> Pin<Box<dyn Future<Output = Result<CompletionResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Run one turn. With sink, stream and emit deltas as they arrive; the
accumulated response is still returned.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".