pub struct BgeM3Provider { /* private fields */ }Expand description
BGE-M3 embedding provider.
Uses fastembed for ONNX inference. 1024-dimensional embeddings, supports 100+ languages.
Implementations§
Source§impl BgeM3Provider
impl BgeM3Provider
Sourcepub fn new() -> Result<Self, EmbedError>
pub fn new() -> Result<Self, EmbedError>
Create a new BGE-M3 provider with default settings.
Sourcepub fn with_cache_size(cache_size: usize) -> Result<Self, EmbedError>
pub fn with_cache_size(cache_size: usize) -> Result<Self, EmbedError>
Create a new BGE-M3 provider with custom cache size.
Trait Implementations§
Source§impl EmbeddingProvider for BgeM3Provider
impl EmbeddingProvider for BgeM3Provider
Source§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,
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,
Generate embeddings for a batch of texts. Read more
Source§fn dimensions(&self) -> usize
fn dimensions(&self) -> usize
Vector dimensionality of this provider.
Source§fn max_batch_size(&self) -> usize
fn max_batch_size(&self) -> usize
Maximum batch size supported.
Auto Trait Implementations§
impl !Freeze for BgeM3Provider
impl RefUnwindSafe for BgeM3Provider
impl Send for BgeM3Provider
impl Sync for BgeM3Provider
impl Unpin for BgeM3Provider
impl UnsafeUnpin for BgeM3Provider
impl UnwindSafe for BgeM3Provider
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