pub struct LocalFastembedProvider { /* private fields */ }Expand description
EmbeddingProvider backed by a fastembed-managed ONNX model.
Implementations§
Source§impl LocalFastembedProvider
impl LocalFastembedProvider
Sourcepub fn new(key: &str, cache_dir: impl AsRef<Path>) -> Result<Self>
pub fn new(key: &str, cache_dir: impl AsRef<Path>) -> Result<Self>
Build a provider for the curated key (see registry::REGISTRY).
Downloads the model on first use; subsequent runs read from cache.
Sourcepub fn model_info(&self) -> &'static CuratedModel
pub fn model_info(&self) -> &'static CuratedModel
The curated model entry this provider serves.
Trait Implementations§
Source§impl Debug for LocalFastembedProvider
impl Debug for LocalFastembedProvider
Source§impl EmbeddingProvider for LocalFastembedProvider
impl EmbeddingProvider for LocalFastembedProvider
Source§fn embed_batch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
texts: &'life1 [&'life2 str],
task: EmbeddingTask,
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<f32>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn embed_batch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
texts: &'life1 [&'life2 str],
task: EmbeddingTask,
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<f32>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Embed a batch of texts. The provider is responsible for chunking the
batch into model-friendly sizes; the worker calling this owns the
outer batching loop.
Source§fn embed_query<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<f32>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn embed_query<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<f32>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Embed a single query string. Default impl forwards to
embed_batch.Auto Trait Implementations§
impl !Freeze for LocalFastembedProvider
impl RefUnwindSafe for LocalFastembedProvider
impl Send for LocalFastembedProvider
impl Sync for LocalFastembedProvider
impl Unpin for LocalFastembedProvider
impl UnsafeUnpin for LocalFastembedProvider
impl UnwindSafe for LocalFastembedProvider
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