pub struct MockMultiVectorEmbedder { /* private fields */ }Expand description
Mock multi-vector embedder for testing.
Generates deterministic pseudo-random embeddings based on token content. Useful for testing the retrieval pipeline without requiring a real model.
§Example
use trueno_rag::multivector::MockMultiVectorEmbedder;
use trueno_rag::multivector::MultiVectorEmbedder;
let embedder = MockMultiVectorEmbedder::new(128, 512);
let emb1 = embedder.embed_tokens("hello world").unwrap();
let emb2 = embedder.embed_tokens("hello world").unwrap();
// Same input produces same output
assert_eq!(emb1.as_slice(), emb2.as_slice());Implementations§
Trait Implementations§
Source§impl Clone for MockMultiVectorEmbedder
impl Clone for MockMultiVectorEmbedder
Source§fn clone(&self) -> MockMultiVectorEmbedder
fn clone(&self) -> MockMultiVectorEmbedder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MockMultiVectorEmbedder
impl Debug for MockMultiVectorEmbedder
Source§impl MultiVectorEmbedder for MockMultiVectorEmbedder
impl MultiVectorEmbedder for MockMultiVectorEmbedder
Source§fn embed_tokens(&self, text: &str) -> Result<MultiVectorEmbedding>
fn embed_tokens(&self, text: &str) -> Result<MultiVectorEmbedding>
Embed text into token-level vectors. Read more
Source§fn embed_tokens_batch(
&self,
texts: &[&str],
) -> Result<Vec<MultiVectorEmbedding>>
fn embed_tokens_batch( &self, texts: &[&str], ) -> Result<Vec<MultiVectorEmbedding>>
Batch embed multiple texts. Read more
Source§fn token_dimension(&self) -> usize
fn token_dimension(&self) -> usize
Get the token embedding dimension.
Source§fn max_tokens(&self) -> usize
fn max_tokens(&self) -> usize
Get the maximum tokens per document.
Auto Trait Implementations§
impl Freeze for MockMultiVectorEmbedder
impl RefUnwindSafe for MockMultiVectorEmbedder
impl Send for MockMultiVectorEmbedder
impl Sync for MockMultiVectorEmbedder
impl Unpin for MockMultiVectorEmbedder
impl UnsafeUnpin for MockMultiVectorEmbedder
impl UnwindSafe for MockMultiVectorEmbedder
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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