pub struct FastEmbedProvider { /* private fields */ }Expand description
FastEmbed embedding provider
This provider uses FastEmbed for local embedding generation, eliminating the need for external API calls and providing fast, reliable embedding generation.
Implementations§
Source§impl FastEmbedProvider
impl FastEmbedProvider
Sourcepub async fn new(model: FastEmbedModel, config: FastEmbedConfig) -> Result<Self>
pub async fn new(model: FastEmbedModel, config: FastEmbedConfig) -> Result<Self>
Create a new FastEmbed provider with the specified model
Sourcepub async fn with_model(model: FastEmbedModel) -> Result<Self>
pub async fn with_model(model: FastEmbedModel) -> Result<Self>
Create a new FastEmbed provider with default configuration
Sourcepub fn model_config(&self) -> &FastEmbedModel
pub fn model_config(&self) -> &FastEmbedModel
Get the model configuration
Sourcepub fn config(&self) -> &FastEmbedConfig
pub fn config(&self) -> &FastEmbedConfig
Get the provider configuration
Trait Implementations§
Source§impl EmbeddingModel for FastEmbedProvider
impl EmbeddingModel for FastEmbedProvider
Source§type Config = FastEmbedConfig
type Config = FastEmbedConfig
Model-specific configuration type
Source§fn embed_text<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vector, VectorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn embed_text<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vector, VectorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Generate embedding for a single text
Source§fn embed_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
texts: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<Vec<Vector>, VectorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn embed_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
texts: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<Vec<Vector>, VectorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Generate embeddings for multiple texts (batch processing)
Source§fn dimensions(&self) -> usize
fn dimensions(&self) -> usize
Get the dimension of embeddings produced by this model
Source§fn model_name(&self) -> &str
fn model_name(&self) -> &str
Get the model name/identifier
Source§fn max_input_length(&self) -> Option<usize>
fn max_input_length(&self) -> Option<usize>
Get the maximum input length supported by the model
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), VectorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), VectorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if the model is available/healthy
Auto Trait Implementations§
impl Freeze for FastEmbedProvider
impl !RefUnwindSafe for FastEmbedProvider
impl Send for FastEmbedProvider
impl Sync for FastEmbedProvider
impl Unpin for FastEmbedProvider
impl !UnwindSafe for FastEmbedProvider
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