pub struct MockEmbeddings { /* private fields */ }Expand description
Mock embeddings for testing purposes.
Generates fixed-pattern embedding vectors based on text hash, useful for unit tests without real API calls.
Implementations§
Source§impl MockEmbeddings
impl MockEmbeddings
Sourcepub fn new(dimension: usize) -> MockEmbeddings
pub fn new(dimension: usize) -> MockEmbeddings
Creates a new MockEmbeddings with specified dimension.
Trait Implementations§
Source§impl Default for MockEmbeddings
impl Default for MockEmbeddings
Source§fn default() -> MockEmbeddings
fn default() -> MockEmbeddings
Returns the “default value” for a type. Read more
Source§impl Embeddings for MockEmbeddings
impl Embeddings for MockEmbeddings
Source§fn embed_query<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<f32>, EmbeddingError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MockEmbeddings: 'async_trait,
fn embed_query<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<f32>, EmbeddingError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MockEmbeddings: 'async_trait,
Generate an embedding vector for a single text. Read more
Source§fn model_name(&self) -> &str
fn model_name(&self) -> &str
Get the model name.
Source§fn embed_documents<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
texts: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<f32>>, EmbeddingError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn embed_documents<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
texts: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<f32>>, EmbeddingError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Generate embedding vectors for multiple documents. Read more
Auto Trait Implementations§
impl Freeze for MockEmbeddings
impl RefUnwindSafe for MockEmbeddings
impl Send for MockEmbeddings
impl Sync for MockEmbeddings
impl Unpin for MockEmbeddings
impl UnsafeUnpin for MockEmbeddings
impl UnwindSafe for MockEmbeddings
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