pub struct Client<T = Client> { /* private fields */ }Expand description
Provider client: Client
Implementations§
Source§impl Client<Client>
impl Client<Client>
Sourcepub fn rerank_model(&self, model: &str, endpoint: Option<String>) -> RerankModel
pub fn rerank_model(&self, model: &str, endpoint: Option<String>) -> RerankModel
Create a rerank model bound to this client (DashScope endpoint).
Trait Implementations§
Source§impl CompletionClient for Client<Client>
impl CompletionClient for Client<Client>
Source§type CompletionModel = CompletionModel
type CompletionModel = CompletionModel
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.
Source§impl EmbeddingsClient for Client<Client>
impl EmbeddingsClient for Client<Client>
Source§type EmbeddingModel = EmbeddingModel
type EmbeddingModel = EmbeddingModel
The type of EmbeddingModel used by the Client
Source§fn embedding_model(&self, model: impl Into<String>) -> Self::EmbeddingModel
fn embedding_model(&self, model: impl Into<String>) -> Self::EmbeddingModel
Create an embedding model with the given model. Read more
Source§fn embedding_model_with_ndims(
&self,
model: impl Into<String>,
ndims: usize,
) -> Self::EmbeddingModel
fn embedding_model_with_ndims( &self, model: impl Into<String>, ndims: usize, ) -> Self::EmbeddingModel
Create an embedding model with the given model identifier string and the number of dimensions in the embedding generated by the model.
This is the suggested method if you need to use a model not included in
Self::EmbeddingModel::Models Read moreSource§fn embeddings<D>(
&self,
model: impl Into<String>,
) -> EmbeddingsBuilder<Self::EmbeddingModel, D>where
D: Embed,
fn embeddings<D>(
&self,
model: impl Into<String>,
) -> EmbeddingsBuilder<Self::EmbeddingModel, D>where
D: Embed,
Create an embedding builder with the given embedding model. Read more
Source§fn embeddings_with_ndims<D>(
&self,
model: &str,
ndims: usize,
) -> EmbeddingsBuilder<Self::EmbeddingModel, D>where
D: Embed,
fn embeddings_with_ndims<D>(
&self,
model: &str,
ndims: usize,
) -> EmbeddingsBuilder<Self::EmbeddingModel, D>where
D: Embed,
Create an embedding builder with the given name and the number of dimensions in the embedding generated by the model. Read more
Source§impl ProviderClient for Client<Client>
impl ProviderClient for Client<Client>
Auto Trait Implementations§
impl<T> Freeze for Client<T>where
T: Freeze,
impl<T> RefUnwindSafe for Client<T>where
T: RefUnwindSafe,
impl<T> Send for Client<T>where
T: Send,
impl<T> Sync for Client<T>where
T: Sync,
impl<T> Unpin for Client<T>where
T: Unpin,
impl<T> UnwindSafe for Client<T>where
T: UnwindSafe,
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> 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>
👎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<M, T> EmbeddingsClientDyn for Twhere
T: EmbeddingsClient<EmbeddingModel = M>,
M: EmbeddingModel + 'static,
impl<M, T> EmbeddingsClientDyn for Twhere
T: EmbeddingsClient<EmbeddingModel = M>,
M: EmbeddingModel + 'static,
Source§fn embedding_model<'a>(&self, model: &str) -> Box<dyn EmbeddingModelDyn + 'a>
fn embedding_model<'a>(&self, model: &str) -> Box<dyn EmbeddingModelDyn + '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 EmbeddingsClient instead.Create an embedding model with the given name.
Note: default embedding dimension of 0 will be used if model is not known.
If this is the case, it’s better to use function
embedding_model_with_ndimsSource§fn embedding_model_with_ndims<'a>(
&self,
model: &str,
ndims: usize,
) -> Box<dyn EmbeddingModelDyn + 'a>
fn embedding_model_with_ndims<'a>( &self, model: &str, ndims: usize, ) -> Box<dyn EmbeddingModelDyn + '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 EmbeddingsClient instead.Create an embedding model with the given name and the number of dimensions in the embedding generated by the model.