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() -> DynClientBuilder
pub fn register<Ext, H, Models>(
self,
provider_name: &'static str,
model: Models,
) -> DynClientBuilderwhere
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.
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§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
Source§impl Default for DynClientBuilder
impl Default for DynClientBuilder
Source§fn default() -> DynClientBuilder
fn default() -> DynClientBuilder
Returns the “default value” for a type. Read more
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§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)