pub struct EmbeddingModel<T> {
pub model: String,
/* private fields */
}Fields§
§model: StringImplementations§
Source§impl<T> EmbeddingModel<T>
impl<T> EmbeddingModel<T>
pub fn new( client: Client<VoyageExt, T>, model: impl Into<String>, ndims: usize, ) -> EmbeddingModel<T>
pub fn with_model( client: Client<VoyageExt, T>, model: &str, ndims: usize, ) -> EmbeddingModel<T>
Trait Implementations§
Source§impl<T> Clone for EmbeddingModel<T>where
T: Clone,
impl<T> Clone for EmbeddingModel<T>where
T: Clone,
Source§fn clone(&self) -> EmbeddingModel<T>
fn clone(&self) -> EmbeddingModel<T>
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<T> EmbeddingModel for EmbeddingModel<T>
impl<T> EmbeddingModel for EmbeddingModel<T>
Source§const MAX_DOCUMENTS: usize = 1024
const MAX_DOCUMENTS: usize = 1024
The maximum number of documents that can be embedded in a single request.
Source§type Client = Client<VoyageExt, T>
type Client = Client<VoyageExt, T>
Provider client type used to construct this embedding model.
Source§fn make(
client: &<EmbeddingModel<T> as EmbeddingModel>::Client,
model: impl Into<String>,
dims: Option<usize>,
) -> EmbeddingModel<T>
fn make( client: &<EmbeddingModel<T> as EmbeddingModel>::Client, model: impl Into<String>, dims: Option<usize>, ) -> EmbeddingModel<T>
Construct a model handle from a provider client, model identifier, and optional dimensions.
Source§async fn embed_texts(
&self,
documents: impl IntoIterator<Item = String>,
) -> Result<Vec<Embedding>, EmbeddingError>
async fn embed_texts( &self, documents: impl IntoIterator<Item = String>, ) -> Result<Vec<Embedding>, EmbeddingError>
Embed multiple text documents in a single request
Source§async fn embed_texts_with_usage(
&self,
documents: impl IntoIterator<Item = String>,
) -> Result<EmbeddingResponse, EmbeddingError>
async fn embed_texts_with_usage( &self, documents: impl IntoIterator<Item = String>, ) -> Result<EmbeddingResponse, EmbeddingError>
Embed multiple text documents in a single request and return token usage. Read more
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.
Source§fn embed_text_with_usage(
&self,
text: &str,
) -> impl Future<Output = Result<EmbeddingResponse, EmbeddingError>> + WasmCompatSend
fn embed_text_with_usage( &self, text: &str, ) -> impl Future<Output = Result<EmbeddingResponse, EmbeddingError>> + WasmCompatSend
Embed a single text document and return token usage. Read more
Auto Trait Implementations§
impl<T> Freeze for EmbeddingModel<T>where
T: Freeze,
impl<T> RefUnwindSafe for EmbeddingModel<T>where
T: RefUnwindSafe,
impl<T> Send for EmbeddingModel<T>where
T: Send,
impl<T> Sync for EmbeddingModel<T>where
T: Sync,
impl<T> Unpin for EmbeddingModel<T>where
T: Unpin,
impl<T> UnsafeUnpin for EmbeddingModel<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for EmbeddingModel<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