pub struct EmbeddingClient { /* private fields */ }👎Deprecated since 2.0.0:
The OpenAI direct clients are deprecated; use the Session API instead (EmbeddingsSession::new(&model)).
Expand description
Client for OpenAI-compatible embedding generation backed by a local model.
Implementations§
Source§impl EmbeddingClient
impl EmbeddingClient
Sourcepub async fn generate_embedding(
&self,
input: &str,
) -> Result<CreateEmbeddingResponse, FoundryLocalError>
pub async fn generate_embedding( &self, input: &str, ) -> Result<CreateEmbeddingResponse, FoundryLocalError>
Generate embeddings for a single input text.
Sourcepub async fn generate_embeddings(
&self,
inputs: &[&str],
) -> Result<CreateEmbeddingResponse, FoundryLocalError>
pub async fn generate_embeddings( &self, inputs: &[&str], ) -> Result<CreateEmbeddingResponse, FoundryLocalError>
Generate embeddings for multiple input texts in a single request.
Auto Trait Implementations§
impl Freeze for EmbeddingClient
impl RefUnwindSafe for EmbeddingClient
impl Send for EmbeddingClient
impl Sync for EmbeddingClient
impl Unpin for EmbeddingClient
impl UnsafeUnpin for EmbeddingClient
impl UnwindSafe for EmbeddingClient
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