pub trait CompletionProvider: Send + Sync {
type Config: ProviderConfig;
type Response: CompletionResponse;
type Error: ProviderError;
// Required method
fn complete<'life0, 'async_trait>(
&'life0 self,
request: CompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
}
Expand description
Trait for providers that support text completion (non-chat).
This is separate from ChatProvider to allow providers to implement only the capabilities they support.
Required Associated Types§
Sourcetype Config: ProviderConfig
type Config: ProviderConfig
Provider-specific configuration type
Sourcetype Response: CompletionResponse
type Response: CompletionResponse
Provider-specific response type
Sourcetype Error: ProviderError
type Error: ProviderError
Provider-specific error type