pub struct EmbeddingModelHandle { /* private fields */ }Expand description
A handle to a loaded embedding model that implements Rig’s rig::embeddings::EmbeddingModel trait.
Obtained via EmbeddingClient::embedding_model.
Trait Implementations§
Source§impl Clone for EmbeddingModelHandle
impl Clone for EmbeddingModelHandle
Source§fn clone(&self) -> EmbeddingModelHandle
fn clone(&self) -> EmbeddingModelHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl EmbeddingModel for EmbeddingModelHandle
impl EmbeddingModel for EmbeddingModelHandle
Source§const MAX_DOCUMENTS: usize = 256
const MAX_DOCUMENTS: usize = 256
The maximum number of documents that can be embedded in a single request.
type Client = EmbeddingClient
fn make( client: &EmbeddingClient, model: impl Into<String>, dims: Option<usize>, ) -> Self
Source§async fn embed_texts(
&self,
texts: impl IntoIterator<Item = String> + Send,
) -> Result<Vec<Embedding>, EmbeddingError>
async fn embed_texts( &self, texts: impl IntoIterator<Item = String> + Send, ) -> Result<Vec<Embedding>, EmbeddingError>
Embed multiple text documents in a single request
Source§fn embed_text(
&self,
text: &str,
) -> impl Future<Output = Result<Embedding, EmbeddingError>> + WasmCompatSend
fn embed_text( &self, text: &str, ) -> impl Future<Output = Result<Embedding, EmbeddingError>> + WasmCompatSend
Embed a single text document.
Auto Trait Implementations§
impl Freeze for EmbeddingModelHandle
impl RefUnwindSafe for EmbeddingModelHandle
impl Send for EmbeddingModelHandle
impl Sync for EmbeddingModelHandle
impl Unpin for EmbeddingModelHandle
impl UnsafeUnpin for EmbeddingModelHandle
impl UnwindSafe for EmbeddingModelHandle
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