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
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