Struct swiftide_indexing::transformers::embed::Embed
source · pub struct Embed { /* private fields */ }
Expand description
A transformer that can generate embeddings for an Node
This file defines the Embed
struct and its implementation of the BatchableTransformer
trait.
Implementations§
source§impl Embed
impl Embed
sourcepub fn new(model: impl EmbeddingModel + 'static) -> Self
pub fn new(model: impl EmbeddingModel + 'static) -> Self
pub fn with_concurrency(self, concurrency: usize) -> Self
Trait Implementations§
source§impl BatchableTransformer for Embed
impl BatchableTransformer for Embed
source§fn batch_transform<'life0, 'async_trait>(
&'life0 self,
nodes: Vec<Node>,
) -> Pin<Box<dyn Future<Output = IndexingStream> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn batch_transform<'life0, 'async_trait>(
&'life0 self,
nodes: Vec<Node>,
) -> Pin<Box<dyn Future<Output = IndexingStream> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Transforms a batch of Node
objects by generating embeddings for them.
§Parameters
nodes
- A vector ofNode
objects to be transformed.
§Returns
An IndexingStream
containing the transformed Node
objects with their embeddings.
§Errors
If the embedding process fails, the function returns a stream with the error.
source§fn concurrency(&self) -> Option<usize>
fn concurrency(&self) -> Option<usize>
Overrides the default concurrency of the pipeline
Auto Trait Implementations§
impl Freeze for Embed
impl !RefUnwindSafe for Embed
impl Send for Embed
impl Sync for Embed
impl Unpin for Embed
impl !UnwindSafe for Embed
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
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