pub struct FastEmbedder { /* private fields */ }Implementations§
Source§impl FastEmbedder
impl FastEmbedder
pub fn new() -> Result<Self, EmbedError>
pub fn with_model(model: EmbeddingModel) -> Result<Self, EmbedError>
Trait Implementations§
Source§impl Embedder for FastEmbedder
impl Embedder for FastEmbedder
fn embed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
texts: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<Vec<Embedding>, EmbedError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn dimension(&self) -> usize
fn dimension(&self) -> usize
Number of dimensions every vector this embedder produces has. Read more
Source§fn model_id(&self) -> &str
fn model_id(&self) -> &str
Stable identifier for the model behind this embedder, e.g.
"fastembed:AllMiniLML6V2" or "openai:text-embedding-3-small". Read morefn embed_one<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Embedding, EmbedError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn max_batch_size(&self) -> usize
fn max_batch_size(&self) -> usize
Largest number of texts a single
embed call should
receive. Callers indexing many chunks split their work into groups of at
most this size, bounding peak memory (local models) and request size
(remote APIs). The default suits the on-device models; raise or lower it
to match a backend’s limits.Source§fn fingerprint(&self) -> String
fn fingerprint(&self) -> String
Fingerprint an index stores to detect that it was built with a different
embedder. Re-indexing is required whenever this changes.
Auto Trait Implementations§
impl !Freeze for FastEmbedder
impl !RefUnwindSafe for FastEmbedder
impl !UnwindSafe for FastEmbedder
impl Send for FastEmbedder
impl Sync for FastEmbedder
impl Unpin for FastEmbedder
impl UnsafeUnpin for FastEmbedder
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