pub struct EmbeddingModelRequest<M: EmbeddingModel> {
pub model: M,
/* private fields */
}Expand description
Options for embedding generation requests to be used by embed.
Fields§
§model: MThe embedding model to use for generating embeddings.
Implementations§
Source§impl<M: EmbeddingModel> EmbeddingModelRequest<M>
impl<M: EmbeddingModel> EmbeddingModelRequest<M>
Sourcepub fn builder() -> EmbeddingModelRequestBuilder<M>
pub fn builder() -> EmbeddingModelRequestBuilder<M>
Creates a new builder for constructing an EmbeddingModelRequest.
This method initiates the type-state builder pattern, starting with the
ModelStage where you must specify the embedding model.
Sourcepub async fn embed(&self) -> Result<EmbeddingModelResponse>
pub async fn embed(&self) -> Result<EmbeddingModelResponse>
Generates embeddings for the input text.
§Returns
A Result containing a vector of embedding vectors, where each embedding is a vector of floats, or an error if the embedding request fails.
Trait Implementations§
Source§impl<M: Clone + EmbeddingModel> Clone for EmbeddingModelRequest<M>
impl<M: Clone + EmbeddingModel> Clone for EmbeddingModelRequest<M>
Source§fn clone(&self) -> EmbeddingModelRequest<M>
fn clone(&self) -> EmbeddingModelRequest<M>
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<M: Debug + EmbeddingModel> Debug for EmbeddingModelRequest<M>
impl<M: Debug + EmbeddingModel> Debug for EmbeddingModelRequest<M>
Source§impl<M: EmbeddingModel> Deref for EmbeddingModelRequest<M>
impl<M: EmbeddingModel> Deref for EmbeddingModelRequest<M>
Source§impl<M: EmbeddingModel> DerefMut for EmbeddingModelRequest<M>
impl<M: EmbeddingModel> DerefMut for EmbeddingModelRequest<M>
Auto Trait Implementations§
impl<M> Freeze for EmbeddingModelRequest<M>where
M: Freeze,
impl<M> RefUnwindSafe for EmbeddingModelRequest<M>where
M: RefUnwindSafe,
impl<M> Send for EmbeddingModelRequest<M>
impl<M> Sync for EmbeddingModelRequest<M>
impl<M> Unpin for EmbeddingModelRequest<M>where
M: Unpin,
impl<M> UnsafeUnpin for EmbeddingModelRequest<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for EmbeddingModelRequest<M>where
M: 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