pub struct ConstantEmbedder(pub Vec<f32>);Expand description
Embedding provider that always returns the same vector regardless of input.
Tuple Fields§
§0: Vec<f32>Trait Implementations§
Source§impl EmbeddingProvider for ConstantEmbedder
impl EmbeddingProvider for ConstantEmbedder
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 ConstantEmbedder
impl RefUnwindSafe for ConstantEmbedder
impl Send for ConstantEmbedder
impl Sync for ConstantEmbedder
impl Unpin for ConstantEmbedder
impl UnsafeUnpin for ConstantEmbedder
impl UnwindSafe for ConstantEmbedder
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