pub struct EmbeddingsBuilder<M: Embeddings, T: Embed> { /* private fields */ }Expand description
The main builder struct for generating embeddings
Implementations§
Source§impl<M: Embeddings, T: Embed> EmbeddingsBuilder<M, T>
impl<M: Embeddings, T: Embed> EmbeddingsBuilder<M, T>
Sourcepub fn document(self, document: T) -> Result<Self, EmbedError>
pub fn document(self, document: T) -> Result<Self, EmbedError>
Add a single document to the builder
Sourcepub fn documents(
self,
documents: impl IntoIterator<Item = T>,
) -> Result<Self, EmbedError>
pub fn documents( self, documents: impl IntoIterator<Item = T>, ) -> Result<Self, EmbedError>
Add multiple documents to the builder
Source§impl<M: Embeddings, T: Embed + Send> EmbeddingsBuilder<M, T>
impl<M: Embeddings, T: Embed + Send> EmbeddingsBuilder<M, T>
Sourcepub async fn build(
self,
) -> Result<Vec<(T, Vec<EmbeddingsData>)>, EmbeddingsError>
pub async fn build( self, ) -> Result<Vec<(T, Vec<EmbeddingsData>)>, EmbeddingsError>
Generate embeddings for all documents
Auto Trait Implementations§
impl<M, T> Freeze for EmbeddingsBuilder<M, T>where
M: Freeze,
impl<M, T> RefUnwindSafe for EmbeddingsBuilder<M, T>where
M: RefUnwindSafe,
T: RefUnwindSafe,
impl<M, T> Send for EmbeddingsBuilder<M, T>where
T: Send,
impl<M, T> Sync for EmbeddingsBuilder<M, T>where
T: Sync,
impl<M, T> Unpin for EmbeddingsBuilder<M, T>
impl<M, T> UnsafeUnpin for EmbeddingsBuilder<M, T>where
M: UnsafeUnpin,
impl<M, T> UnwindSafe for EmbeddingsBuilder<M, T>where
M: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more