pub struct MockEmbeddingModel;Expand description
Deterministic 8-dimensional mock embedding model.
Uses the SHA-256 of the input text as a pseudo-random source for 8 f32 components, then L2-normalizes the result. Never use for semantic search — the outputs are semantically meaningless. Suitable for pipeline correctness tests (RFC-008 §24 tests 1–10).
Trait Implementations§
Source§impl EmbeddingModel for MockEmbeddingModel
impl EmbeddingModel for MockEmbeddingModel
Source§fn embed_batch(&self, texts: &[&str]) -> OrbokResult<Vec<Vec<f32>>>
fn embed_batch(&self, texts: &[&str]) -> OrbokResult<Vec<Vec<f32>>>
Embed a batch of normalized texts. Returns one vector per input,
each L2-normalized.
Source§fn embed_batch_with_stats(
&self,
texts: &[&str],
) -> OrbokResult<(Vec<Vec<f32>>, Option<EmbeddingBatchStats>)>
fn embed_batch_with_stats( &self, texts: &[&str], ) -> OrbokResult<(Vec<Vec<f32>>, Option<EmbeddingBatchStats>)>
embed_batch, plus this call’s batch statistics (RFC-048 Task 011)
— None when a backend doesn’t track them. The default
implementation delegates to embed_batch and reports no stats, so
every existing backend and call site is unaffected; a backend that
can report real figures overrides this instead, as a byproduct of
work it already performs, adding no cost to plain embed_batch.Auto Trait Implementations§
impl Freeze for MockEmbeddingModel
impl RefUnwindSafe for MockEmbeddingModel
impl Send for MockEmbeddingModel
impl Sync for MockEmbeddingModel
impl Unpin for MockEmbeddingModel
impl UnsafeUnpin for MockEmbeddingModel
impl UnwindSafe for MockEmbeddingModel
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