pub struct RecordingEmbedder { /* private fields */ }Expand description
Embedding provider that records every embed call and returns a
deterministic content-derived vector unique to the input text. Used to
verify the extraction pipeline hands distinct embeddings to distinct facts
(so Layer 2 dedup makes the right call). new returns the double together
with the shared call-log handle so the test body can assert on it.
Implementations§
Trait Implementations§
Source§impl EmbeddingProvider for RecordingEmbedder
impl EmbeddingProvider for RecordingEmbedder
Source§async fn embed(&self, text: &str) -> Result<Option<Vec<f32>>, ProviderError>
async fn embed(&self, text: &str) -> Result<Option<Vec<f32>>, ProviderError>
Embed a single text.
None is returned when the provider cannot
produce an embedding (e.g. input is empty after normalisation).Source§async fn embed_batch(
&self,
texts: &[&str],
) -> Result<Vec<Option<Vec<f32>>>, ProviderError>
async fn embed_batch( &self, texts: &[&str], ) -> Result<Vec<Option<Vec<f32>>>, ProviderError>
Embed many texts. Default loops
embed; override for batch endpoints.Auto Trait Implementations§
impl Freeze for RecordingEmbedder
impl RefUnwindSafe for RecordingEmbedder
impl Send for RecordingEmbedder
impl Sync for RecordingEmbedder
impl Unpin for RecordingEmbedder
impl UnsafeUnpin for RecordingEmbedder
impl UnwindSafe for RecordingEmbedder
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