Skip to main content

MockEmbeddingModel

Struct MockEmbeddingModel 

Source
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

Source§

fn name(&self) -> &str

Stable name stored in models.model_name.
Source§

fn version(&self) -> &str

Version string stored in models.model_version.
Source§

fn dimension(&self) -> u32

Output dimension — must match stored embeddings (RFC-008 §11).
Source§

fn embed_batch(&self, texts: &[&str]) -> OrbokResult<Vec<Vec<f32>>>

Embed a batch of normalized texts. Returns one vector per input, each L2-normalized.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.