pub struct HashEmbeddingProvider { /* private fields */ }Expand description
Deterministic hash-based embedding provider.
Useful for testing the full embedding pipeline without requiring an ML model. The same input text always produces the same embedding vector.
Implementations§
Source§impl HashEmbeddingProvider
impl HashEmbeddingProvider
Sourcepub fn new(dimensions: usize) -> Self
pub fn new(dimensions: usize) -> Self
Create a new hash embedding provider with the given dimensions.
Sourcepub fn default_384() -> Self
pub fn default_384() -> Self
Create a new hash embedding provider with the default 384 dimensions.
Trait Implementations§
Source§impl AsyncEmbeddingProvider for HashEmbeddingProvider
impl AsyncEmbeddingProvider for HashEmbeddingProvider
Source§async fn embed(&self, text: &str) -> MenteResult<Vec<f32>>
async fn embed(&self, text: &str) -> MenteResult<Vec<f32>>
Generate an embedding vector for a single text.
Source§async fn embed_batch(&self, texts: &[&str]) -> MenteResult<Vec<Vec<f32>>>
async fn embed_batch(&self, texts: &[&str]) -> MenteResult<Vec<Vec<f32>>>
Generate embedding vectors for a batch of texts.
Source§fn dimensions(&self) -> usize
fn dimensions(&self) -> usize
The dimensionality of the embedding vectors produced by this provider.
Source§fn model_name(&self) -> &str
fn model_name(&self) -> &str
The name of the model used by this provider.
Source§impl EmbeddingProvider for HashEmbeddingProvider
impl EmbeddingProvider for HashEmbeddingProvider
Source§fn embed(&self, text: &str) -> MenteResult<Vec<f32>>
fn embed(&self, text: &str) -> MenteResult<Vec<f32>>
Generate an embedding vector for a single text.
Source§fn embed_batch(&self, texts: &[&str]) -> MenteResult<Vec<Vec<f32>>>
fn embed_batch(&self, texts: &[&str]) -> MenteResult<Vec<Vec<f32>>>
Generate embedding vectors for a batch of texts.
Source§fn dimensions(&self) -> usize
fn dimensions(&self) -> usize
The dimensionality of the embedding vectors produced by this provider.
Source§fn model_name(&self) -> &str
fn model_name(&self) -> &str
The name of the model used by this provider.
Auto Trait Implementations§
impl Freeze for HashEmbeddingProvider
impl RefUnwindSafe for HashEmbeddingProvider
impl Send for HashEmbeddingProvider
impl Sync for HashEmbeddingProvider
impl Unpin for HashEmbeddingProvider
impl UnsafeUnpin for HashEmbeddingProvider
impl UnwindSafe for HashEmbeddingProvider
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