pub struct InMemoryBackend { /* private fields */ }Expand description
In-memory embedding backend for unit tests.
Returns a deterministic f32 blob for any input. The blob contains
dimensions floats, each set to 0.1. Tracks call count for assertions.
Implementations§
Trait Implementations§
Source§impl EmbeddingBackend for InMemoryBackend
impl EmbeddingBackend for InMemoryBackend
Source§fn embed(
&self,
_input: &str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + '_>>
fn embed( &self, _input: &str, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + '_>>
Embed a single text string. Read more
Source§fn dimensions(&self) -> usize
fn dimensions(&self) -> usize
Number of dimensions this provider/model produces.
Source§fn model_name(&self) -> &str
fn model_name(&self) -> &str
Model identifier string (e.g.
"text-embedding-3-small").Auto Trait Implementations§
impl !Freeze for InMemoryBackend
impl RefUnwindSafe for InMemoryBackend
impl Send for InMemoryBackend
impl Sync for InMemoryBackend
impl Unpin for InMemoryBackend
impl UnsafeUnpin for InMemoryBackend
impl UnwindSafe for InMemoryBackend
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