pub enum Client {
Show 17 variants
Anthropic(Client),
Azure(Client),
Cohere(Client),
DeepSeek(Client),
Galadriel(Client),
Gemini(Client),
Groq(Client),
HuggingFace(Client),
Hyperbolic(Client),
Mira(Client),
Moonshot(Client),
OpenAI(Client),
OpenRouter(Client),
Ollama(Client),
Perplexity(Client),
Together(Client),
Xai(Client),
}Variants§
Anthropic(Client)
Azure(Client)
Cohere(Client)
DeepSeek(Client)
Galadriel(Client)
Gemini(Client)
Groq(Client)
HuggingFace(Client)
Hyperbolic(Client)
Mira(Client)
Moonshot(Client)
OpenAI(Client)
OpenRouter(Client)
Ollama(Client)
Perplexity(Client)
Together(Client)
Xai(Client)
Implementations§
Source§impl Client
impl Client
Sourcepub async fn completion_model(&self, model: &str) -> Box<dyn CompletionModel>
pub async fn completion_model(&self, model: &str) -> Box<dyn CompletionModel>
Returns a completion model wrapper for the given provider and model name.
Sourcepub async fn rig_completion_model(
&self,
model: &str,
) -> RigCompletionModelAdapter
pub async fn rig_completion_model( &self, model: &str, ) -> RigCompletionModelAdapter
Returns a completion model compatible with rig::completion::CompletionModel.
Sourcepub async fn embedding_model(
&self,
model: &str,
input_type: Option<&str>,
) -> Option<Box<dyn DynEmbeddingModel>>
pub async fn embedding_model( &self, model: &str, input_type: Option<&str>, ) -> Option<Box<dyn DynEmbeddingModel>>
Returns an embedding model wrapper for the given provider and model name.
Returns None if the provider does not support embeddings or
if improper input type is provided (cohere requires a input type).
pub async fn embedding_model_with_ndims( &self, model: &str, ndims: usize, input_type: Option<&str>, ) -> Option<Box<dyn DynEmbeddingModel>>
Trait Implementations§
Source§impl CompletionClient for Client
impl CompletionClient for Client
Source§type CompletionModel = RigClientCompletionModelAdapter
type CompletionModel = RigClientCompletionModelAdapter
The type of CompletionModel used by the client.
Source§fn completion_model(&self, model: impl Into<String>) -> Self::CompletionModel
fn completion_model(&self, model: impl Into<String>) -> Self::CompletionModel
Create a completion model with the given model. Read more
Source§fn agent(&self, model: impl Into<String>) -> AgentBuilder<Self::CompletionModel>
fn agent(&self, model: impl Into<String>) -> AgentBuilder<Self::CompletionModel>
Create an agent builder with the given completion model. Read more
Source§fn extractor<T>(
&self,
model: impl Into<String>,
) -> ExtractorBuilder<Self::CompletionModel, T>
fn extractor<T>( &self, model: impl Into<String>, ) -> ExtractorBuilder<Self::CompletionModel, T>
Create an extractor builder with the given completion model.
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
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>
👎Deprecated since 0.25.0:
DynClientBuilder and related features have been deprecated and will be removed in a future release. In this case, use CompletionClient instead.
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>>
👎Deprecated since 0.25.0:
DynClientBuilder and related features have been deprecated and will be removed in a future release. In this case, use CompletionClient instead.
Create an agent builder with the given completion model.
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