pub struct Client { /* private fields */ }
Implementations§
Trait Implementations§
Source§impl AsEmbeddings for Client
impl AsEmbeddings for Client
fn as_embeddings(&self) -> Option<Box<dyn EmbeddingsClientDyn>>
Source§impl AsTranscription for Client
impl AsTranscription for Client
fn as_transcription(&self) -> Option<Box<dyn TranscriptionClientDyn>>
Source§impl AudioGenerationClient for Client
Available on crate feature image
only.
impl AudioGenerationClient for Client
Available on crate feature
image
only.Source§fn audio_generation_model(&self, language: &str) -> AudioGenerationModel
Available on crate feature audio
only.
fn audio_generation_model(&self, language: &str) -> AudioGenerationModel
audio
only.Create a completion model with the given name.
§Example
use rig::providers::hyperbolic::{Client, self};
// Initialize the Hyperbolic client
let hyperbolic = Client::new("your-hyperbolic-api-key");
let tts = hyperbolic.audio_generation_model("EN");
Source§type AudioGenerationModel = AudioGenerationModel
type AudioGenerationModel = AudioGenerationModel
Available on crate feature
audio
only.The AudioGenerationModel used by the Client
Source§impl CompletionClient for Client
impl CompletionClient for Client
Source§fn completion_model(&self, model: &str) -> CompletionModel
fn completion_model(&self, model: &str) -> CompletionModel
Create a completion model with the given name.
§Example
use rig::providers::hyperbolic::{Client, self};
// Initialize the Hyperbolic client
let hyperbolic = Client::new("your-hyperbolic-api-key");
let llama_3_1_8b = hyperbolic.completion_model(hyperbolic::LLAMA_3_1_8B);
Source§type CompletionModel = CompletionModel
type CompletionModel = CompletionModel
The type of CompletionModel used by the client.
Source§fn agent(&self, model: &str) -> AgentBuilder<Self::CompletionModel>
fn agent(&self, model: &str) -> AgentBuilder<Self::CompletionModel>
Create an agent builder with the given completion model. Read more
Source§fn extractor<T>(
&self,
model: &str,
) -> ExtractorBuilder<Self::CompletionModel, T>
fn extractor<T>( &self, model: &str, ) -> ExtractorBuilder<Self::CompletionModel, T>
Create an extractor builder with the given completion model.
Source§impl ImageGenerationClient for Client
Available on crate feature image
only.
impl ImageGenerationClient for Client
Available on crate feature
image
only.Source§fn image_generation_model(&self, model: &str) -> ImageGenerationModel
fn image_generation_model(&self, model: &str) -> ImageGenerationModel
Create an image generation model with the given name.
§Example
use rig::providers::hyperbolic::{Client, self};
// Initialize the Hyperbolic client
let hyperbolic = Client::new("your-hyperbolic-api-key");
let llama_3_1_8b = hyperbolic.image_generation_model(hyperbolic::SSD);
Source§type ImageGenerationModel = ImageGenerationModel
type ImageGenerationModel = ImageGenerationModel
The ImageGenerationModel used by the Client
Source§impl ProviderClient for Client
impl ProviderClient for Client
Source§fn from_env() -> Self
fn from_env() -> Self
Create a new Hyperbolic client from the HYPERBOLIC_API_KEY
environment variable.
Panics if the environment variable is not set.
fn from_val(input: ProviderValue) -> Self
Source§fn 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.
Source§fn 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.
Source§fn 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.
Source§impl VerifyClient for Client
impl VerifyClient for Client
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> AsAudioGeneration for Twhere
T: AudioGenerationClientDyn + Clone + 'static,
impl<T> AsAudioGeneration for Twhere
T: AudioGenerationClientDyn + Clone + 'static,
Source§fn as_audio_generation(&self) -> Option<Box<dyn AudioGenerationClientDyn>>
fn as_audio_generation(&self) -> Option<Box<dyn AudioGenerationClientDyn>>
Available on crate feature
audio
only.Source§impl<T> AsCompletion for Twhere
T: CompletionClientDyn + Clone + 'static,
impl<T> AsCompletion for Twhere
T: CompletionClientDyn + Clone + 'static,
fn as_completion(&self) -> Option<Box<dyn CompletionClientDyn>>
Source§impl<T> AsImageGeneration for Twhere
T: ImageGenerationClientDyn + Clone + 'static,
impl<T> AsImageGeneration for Twhere
T: ImageGenerationClientDyn + Clone + 'static,
Source§fn as_image_generation(&self) -> Option<Box<dyn ImageGenerationClientDyn>>
fn as_image_generation(&self) -> Option<Box<dyn ImageGenerationClientDyn>>
Available on crate feature
image
only.Source§impl<T> AsVerify for Twhere
T: VerifyClientDyn + Clone + 'static,
impl<T> AsVerify for Twhere
T: VerifyClientDyn + Clone + 'static,
Source§impl<T, M> AudioGenerationClientDyn for Twhere
T: AudioGenerationClient<AudioGenerationModel = M>,
M: AudioGenerationModel + 'static,
impl<T, M> AudioGenerationClientDyn for Twhere
T: AudioGenerationClient<AudioGenerationModel = M>,
M: AudioGenerationModel + 'static,
Source§fn audio_generation_model<'a>(
&self,
model: &str,
) -> Box<dyn AudioGenerationModelDyn + 'a>
fn audio_generation_model<'a>( &self, model: &str, ) -> Box<dyn AudioGenerationModelDyn + 'a>
Available on crate feature
audio
only.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, M, R> CompletionClientDyn for Twhere
T: CompletionClient<CompletionModel = M>,
M: CompletionModel<StreamingResponse = R> + 'static,
R: Clone + Unpin + GetTokenUsage + 'static,
impl<T, M, R> CompletionClientDyn for Twhere
T: CompletionClient<CompletionModel = M>,
M: CompletionModel<StreamingResponse = R> + 'static,
R: Clone + Unpin + GetTokenUsage + 'static,
Source§fn completion_model<'a>(&self, model: &str) -> Box<dyn CompletionModelDyn + 'a>
fn completion_model<'a>(&self, model: &str) -> Box<dyn CompletionModelDyn + 'a>
Create a completion model with the given name.
Source§fn agent<'a>(&self, model: &str) -> AgentBuilder<CompletionModelHandle<'a>>
fn agent<'a>(&self, model: &str) -> AgentBuilder<CompletionModelHandle<'a>>
Create an agent builder with the given completion model.
Source§impl<T, M> ImageGenerationClientDyn for Twhere
T: ImageGenerationClient<ImageGenerationModel = M>,
M: ImageGenerationModel + 'static,
impl<T, M> ImageGenerationClientDyn for Twhere
T: ImageGenerationClient<ImageGenerationModel = M>,
M: ImageGenerationModel + 'static,
Source§fn image_generation_model<'a>(
&self,
model: &str,
) -> Box<dyn ImageGenerationModelDyn + 'a>
fn image_generation_model<'a>( &self, model: &str, ) -> Box<dyn ImageGenerationModelDyn + 'a>
Available on crate feature
image
only.Create an image generation model with the given name.
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more