ProviderClient

Trait ProviderClient 

Source
pub trait ProviderClient:
    AsCompletion
    + AsTranscription
    + AsEmbeddings
    + AsImageGeneration
    + AsAudioGeneration
    + Debug
    + WasmCompatSend
    + WasmCompatSync {
    // Required methods
    fn from_env() -> Self
       where Self: Sized;
    fn from_val(input: ProviderValue) -> Self
       where Self: Sized;

    // Provided methods
    fn boxed(self) -> Box<dyn ProviderClient>
       where Self: Sized + 'static { ... }
    fn from_env_boxed<'a>() -> Box<dyn ProviderClient + 'a>
       where Self: Sized + 'a { ... }
    fn from_val_boxed<'a>(input: ProviderValue) -> Box<dyn ProviderClient + 'a>
       where Self: Sized + 'a { ... }
}
Expand description

The base ProviderClient trait, facilitates conversion between client types and creating a client from the environment.

All conversion traits must be implemented, they are automatically implemented if the respective client trait is implemented.

Required Methods§

Source

fn from_env() -> Self
where Self: Sized,

Create a client from the process’s environment. Panics if an environment is improperly configured.

Source

fn from_val(input: ProviderValue) -> Self
where Self: Sized,

Provided Methods§

Source

fn boxed(self) -> Box<dyn ProviderClient>
where Self: Sized + 'static,

A helper method to box the client.

Source

fn from_env_boxed<'a>() -> Box<dyn ProviderClient + 'a>
where Self: Sized + 'a,

Create a boxed client from the process’s environment. Panics if an environment is improperly configured.

Source

fn from_val_boxed<'a>(input: ProviderValue) -> Box<dyn ProviderClient + 'a>
where Self: Sized + 'a,

Create a boxed client from the process’s environment. Panics if an environment is improperly configured.

Implementors§

Source§

impl<T> ProviderClient for rig::providers::anthropic::client::Client<T>
where T: HttpClientExt + Clone + Debug + Default + 'static,

Source§

impl<T> ProviderClient for rig::providers::azure::Client<T>
where T: HttpClientExt + Clone + Debug + Default + Send + 'static,

Source§

impl<T> ProviderClient for rig::providers::cohere::client::Client<T>
where T: HttpClientExt + Clone + Debug + Default + WasmCompatSend + 'static,

Source§

impl<T> ProviderClient for rig::providers::deepseek::Client<T>
where T: HttpClientExt + Clone + Debug + Default + Send + 'static,

Source§

impl<T> ProviderClient for rig::providers::galadriel::Client<T>
where T: HttpClientExt + Clone + Debug + Default + Send + 'static,

Source§

impl<T> ProviderClient for rig::providers::gemini::client::Client<T>
where T: HttpClientExt + Clone + Debug + Default + WasmCompatSend + 'static,

Source§

impl<T> ProviderClient for rig::providers::groq::Client<T>
where T: HttpClientExt + Clone + Send + Debug + Default + 'static,

Source§

impl<T> ProviderClient for rig::providers::huggingface::client::Client<T>
where T: HttpClientExt + Clone + Debug + Default + 'static,

Source§

impl<T> ProviderClient for rig::providers::hyperbolic::Client<T>
where T: HttpClientExt + Clone + Default + Debug + Send + 'static,

Source§

impl<T> ProviderClient for rig::providers::mira::Client<T>
where T: HttpClientExt + Clone + Debug + Default + Send + 'static,

Source§

impl<T> ProviderClient for rig::providers::mistral::client::Client<T>
where T: HttpClientExt + Clone + Default + Debug + Send + 'static,

Source§

impl<T> ProviderClient for rig::providers::moonshot::Client<T>
where T: HttpClientExt + Clone + Debug + Default + Send + 'static,

Source§

impl<T> ProviderClient for rig::providers::ollama::Client<T>
where T: HttpClientExt + Clone + Debug + Default + Send + 'static,

Source§

impl<T> ProviderClient for rig::providers::openai::client::Client<T>
where T: HttpClientExt + Clone + Debug + Default + Send + 'static,

Source§

impl<T> ProviderClient for rig::providers::openrouter::client::Client<T>
where T: HttpClientExt + Clone + Debug + Default + 'static,

Source§

impl<T> ProviderClient for rig::providers::perplexity::Client<T>
where T: HttpClientExt + Clone + Debug + Default + Send + 'static,

Source§

impl<T> ProviderClient for rig::providers::together::client::Client<T>
where T: HttpClientExt + Clone + Default + Debug + Send + 'static,

Source§

impl<T> ProviderClient for rig::providers::voyageai::Client<T>
where T: HttpClientExt + Clone + Debug + Default + 'static,

Source§

impl<T> ProviderClient for rig::providers::xai::client::Client<T>
where T: HttpClientExt + Clone + Default + Debug + Send + 'static,