pub struct MockEmbedder { /* private fields */ }Expand description
Deterministic embedder for unit tests.
Generates consistent embeddings based on a hash of the input text. Same text always produces the same embedding. Output is normalized.
Implementations§
Trait Implementations§
Source§impl Embedder for MockEmbedder
impl Embedder for MockEmbedder
Source§fn embed<'a>(&'a self, text: &'a str) -> EmbedFuture<'a>
fn embed<'a>(&'a self, text: &'a str) -> EmbedFuture<'a>
Embed a single text. Returns a vector of f32.
Source§fn embed_batch<'a>(&'a self, texts: Vec<String>) -> EmbedBatchFuture<'a>
fn embed_batch<'a>(&'a self, texts: Vec<String>) -> EmbedBatchFuture<'a>
Embed multiple texts in a batch. Read more
Source§fn model_name(&self) -> &str
fn model_name(&self) -> &str
The model name this embedder uses.
Source§fn dimensions(&self) -> usize
fn dimensions(&self) -> usize
Expected embedding dimensions.
Auto Trait Implementations§
impl Freeze for MockEmbedder
impl RefUnwindSafe for MockEmbedder
impl Send for MockEmbedder
impl Sync for MockEmbedder
impl Unpin for MockEmbedder
impl UnsafeUnpin for MockEmbedder
impl UnwindSafe for MockEmbedder
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