pub trait LanguageModelProvider {
type Model: LanguageModel;
type Error: Error;
// Required methods
fn list_models(
&self,
) -> impl Future<Output = Result<Vec<Profile>, Self::Error>> + Send;
fn get_model(
&self,
name: &str,
) -> impl Future<Output = Result<Self::Model, Self::Error>> + Send;
fn profile() -> Profile;
}Expand description
Trait for AI service providers that can list and provide language models.
Required Associated Types§
Sourcetype Model: LanguageModel
type Model: LanguageModel
The type of language model this provider creates.
Required Methods§
Sourcefn list_models(
&self,
) -> impl Future<Output = Result<Vec<Profile>, Self::Error>> + Send
fn list_models( &self, ) -> impl Future<Output = Result<Vec<Profile>, Self::Error>> + Send
Lists all available models from this provider.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".