pub struct DynClientBuilder(/* private fields */);๐Deprecated since 0.25.0:
DynClientBuilder and related features have been deprecated and will be removed in a future release.Implementationsยง
Sourceยงimpl DynClientBuilder
impl DynClientBuilder
pub fn new() -> Self
pub fn register<Ext, H, Models>(
self,
provider_name: &'static str,
model: Models,
) -> Selfwhere
Ext: Provider + Capabilities + WasmCompatSend + WasmCompatSync + 'static,
H: Default + WasmCompatSend + WasmCompatSync + 'static,
Client<Ext, H>: ProviderClient + WasmCompatSend + WasmCompatSync + 'static,
Models: ToString,
pub fn from_env<T, Models>(
&self,
provider_name: &'static str,
model: Models,
) -> Result<AnyClient, Error>where
T: 'static,
Models: ToString,
pub fn factory<Models>(
&self,
provider_name: &'static str,
model: Models,
) -> Option<&ProviderFactory>where
Models: ToString,
Sourcepub fn agent<Models>(
&self,
provider_name: impl Into<&'static str>,
model: Models,
) -> Result<AgentBuilder<CompletionModelHandle<'_>>, Error>where
Models: ToString,
pub fn agent<Models>(
&self,
provider_name: impl Into<&'static str>,
model: Models,
) -> Result<AgentBuilder<CompletionModelHandle<'_>>, Error>where
Models: ToString,
Get a boxed agent based on the provider and model, as well as an API key.
Sourcepub fn completion<Models>(
&self,
provider_name: &'static str,
model: Models,
) -> Result<Box<dyn CompletionModelDyn>, Error>where
Models: ToString,
pub fn completion<Models>(
&self,
provider_name: &'static str,
model: Models,
) -> Result<Box<dyn CompletionModelDyn>, Error>where
Models: ToString,
Get a boxed completion model based on the provider and model.
Sourcepub fn embeddings<Models>(
&self,
provider_name: &'static str,
model: Models,
) -> Result<Box<dyn EmbeddingModelDyn>, Error>where
Models: ToString,
pub fn embeddings<Models>(
&self,
provider_name: &'static str,
model: Models,
) -> Result<Box<dyn EmbeddingModelDyn>, Error>where
Models: ToString,
Get a boxed embedding model based on the provider and model.
Sourcepub fn transcription<Models>(
&self,
provider_name: &'static str,
model: Models,
) -> Result<Box<dyn TranscriptionModelDyn>, Error>where
Models: ToString,
pub fn transcription<Models>(
&self,
provider_name: &'static str,
model: Models,
) -> Result<Box<dyn TranscriptionModelDyn>, Error>where
Models: ToString,
Get a boxed transcription model based on the provider and model.
pub fn image_generation<Models>(
&self,
provider_name: &'static str,
model: Models,
) -> Result<Box<dyn ImageGenerationModelDyn>, Error>where
Models: ToString,
Available on crate feature
image only.pub fn audio_generation<Models>(
&self,
provider_name: &'static str,
model: Models,
) -> Result<Box<dyn AudioGenerationModelDyn>, Error>where
Models: ToString,
Available on crate feature
audio only.Sourcepub async fn stream_completion<Models>(
&self,
provider_name: &'static str,
model: Models,
request: CompletionRequest,
) -> Result<StreamingCompletionResponse<FinalCompletionResponse>, Error>where
Models: ToString,
pub async fn stream_completion<Models>(
&self,
provider_name: &'static str,
model: Models,
request: CompletionRequest,
) -> Result<StreamingCompletionResponse<FinalCompletionResponse>, Error>where
Models: ToString,
Stream a completion request to the specified provider and model.
Sourcepub async fn stream_prompt<Models, Prompt>(
&self,
provider_name: impl Into<&'static str>,
model: Models,
prompt: Prompt,
) -> Result<StreamingCompletionResponse<FinalCompletionResponse>, Error>
pub async fn stream_prompt<Models, Prompt>( &self, provider_name: impl Into<&'static str>, model: Models, prompt: Prompt, ) -> Result<StreamingCompletionResponse<FinalCompletionResponse>, Error>
Stream a simple prompt to the specified provider and model.
Sourcepub async fn stream_chat<Models, Prompt>(
&self,
provider_name: &'static str,
model: Models,
prompt: Prompt,
history: Vec<Message>,
) -> Result<StreamingCompletionResponse<FinalCompletionResponse>, Error>
pub async fn stream_chat<Models, Prompt>( &self, provider_name: &'static str, model: Models, prompt: Prompt, history: Vec<Message>, ) -> Result<StreamingCompletionResponse<FinalCompletionResponse>, Error>
Stream a chat with history to the specified provider and model.
Trait Implementationsยง
Sourceยงimpl Clone for DynClientBuilder
impl Clone for DynClientBuilder
Sourceยงfn clone(&self) -> DynClientBuilder
fn clone(&self) -> DynClientBuilder
Returns a duplicate of the value. Read more
1.0.0 ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSourceยงimpl Debug for DynClientBuilder
impl Debug for DynClientBuilder
Auto Trait Implementationsยง
impl Freeze for DynClientBuilder
impl RefUnwindSafe for DynClientBuilder
impl Send for DynClientBuilder
impl Sync for DynClientBuilder
impl Unpin for DynClientBuilder
impl UnwindSafe for DynClientBuilder
Blanket Implementationsยง
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> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
fn clone_storage(&self) -> Box<dyn CloneDebuggableStorage>
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<T> CloneableStorage for T
impl<T> CloneableStorage for T
fn clone_storage(&self) -> Box<dyn CloneableStorage>
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