pub trait Provider:
Send
+ Sync
+ 'static {
// Required method
fn stream<'a>(
&'a self,
model: &'a Model,
context: &'a Context,
options: Option<StreamOptions>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = ProviderEvent> + Send>>, ProviderError>> + Send + 'a>>;
}Expand description
Stable since 0.63.0
LLM provider trait
Implement this trait to add support for new LLM providers.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".