pub struct Client<T = Client> { /* private fields */ }Expand description
Provider client: Client
Implementations§
Source§impl<T> Client<T>where
T: Default,
impl<T> Client<T>where
T: Default,
pub fn builder<'a>() -> ClientBuilder<'a, T>
pub fn new() -> Self
Source§impl Client<Client>
impl Client<Client>
Sourcepub async fn predict(
&self,
inputs: impl IntoIterator<Item = String>,
) -> Result<PredictResponse, PredictError>
pub async fn predict( &self, inputs: impl IntoIterator<Item = String>, ) -> Result<PredictResponse, PredictError>
Predict/classify inputs using TEI router endpoint (customizable via ClientBuilder)
Source§impl Client<Client>
impl Client<Client>
Sourcepub async fn rerank(
&self,
query: &str,
texts: impl IntoIterator<Item = String>,
top_n: Option<usize>,
) -> Result<Vec<RerankResult>, RerankError>
pub async fn rerank( &self, query: &str, texts: impl IntoIterator<Item = String>, top_n: Option<usize>, ) -> Result<Vec<RerankResult>, RerankError>
Rerank endpoint (customizable via ClientBuilder): POST {endpoints.rerank}
Trait Implementations§
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<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.