pub struct FakeEmbeddings { /* private fields */ }Expand description
Deterministic fake embeddings for testing.
Generates vectors by hashing the input text. The same text always produces the same embedding vector, making tests reproducible.
§Examples
use synwire_core::embeddings::FakeEmbeddings;
let embeddings = FakeEmbeddings::new(128);Implementations§
Trait Implementations§
Source§impl Embeddings for FakeEmbeddings
impl Embeddings for FakeEmbeddings
Source§fn embed_documents<'a>(
&'a self,
texts: &'a [String],
) -> BoxFuture<'a, Result<Vec<Vec<f32>>, SynwireError>>
fn embed_documents<'a>( &'a self, texts: &'a [String], ) -> BoxFuture<'a, Result<Vec<Vec<f32>>, SynwireError>>
Embed a list of texts, returning one vector per text. Read more
Source§fn embed_query<'a>(
&'a self,
text: &'a str,
) -> BoxFuture<'a, Result<Vec<f32>, SynwireError>>
fn embed_query<'a>( &'a self, text: &'a str, ) -> BoxFuture<'a, Result<Vec<f32>, SynwireError>>
Embed a single query text. Read more
Auto Trait Implementations§
impl Freeze for FakeEmbeddings
impl RefUnwindSafe for FakeEmbeddings
impl Send for FakeEmbeddings
impl Sync for FakeEmbeddings
impl Unpin for FakeEmbeddings
impl UnsafeUnpin for FakeEmbeddings
impl UnwindSafe for FakeEmbeddings
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