pub trait ProviderClient:
AsCompletion
+ AsTranscription
+ AsEmbeddings
+ AsImageGeneration
+ AsAudioGeneration
+ Debug {
// 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§
Sourcefn from_env() -> Selfwhere
Self: Sized,
fn from_env() -> Selfwhere
Self: Sized,
Create a client from the process’s environment. Panics if an environment is improperly configured.
fn from_val(input: ProviderValue) -> Selfwhere
Self: Sized,
Provided Methods§
Sourcefn boxed(self) -> Box<dyn ProviderClient>where
Self: Sized + 'static,
fn boxed(self) -> Box<dyn ProviderClient>where
Self: Sized + 'static,
A helper method to box the client.
Sourcefn from_env_boxed<'a>() -> Box<dyn ProviderClient + 'a>where
Self: Sized + 'a,
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.
Sourcefn from_val_boxed<'a>(input: ProviderValue) -> Box<dyn ProviderClient + 'a>where
Self: Sized + 'a,
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.