Trait LanguageModelProvider

Source
pub trait LanguageModelProvider {
    type Model: LanguageModel;

    // Required methods
    fn list_models(&self) -> impl Future<Output = Vec<String>> + Send;
    fn get_model(&self, name: &str) -> impl Future<Output = Self::Model> + Send;
    fn profile() -> Profile;
}
Expand description

Trait for AI service providers that can list and provide language models.

Required Associated Types§

Source

type Model: LanguageModel

The type of language model this provider creates.

Required Methods§

Source

fn list_models(&self) -> impl Future<Output = Vec<String>> + Send

Lists all available models from this provider.

Source

fn get_model(&self, name: &str) -> impl Future<Output = Self::Model> + Send

Gets a specific model by name from this provider.

Source

fn profile() -> Profile

Returns the provider’s profile information.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§