pub struct Embedder<P> { /* private fields */ }Implementations§
Source§impl<P: EmbedProvide> Embedder<P>
impl<P: EmbedProvide> Embedder<P>
pub fn new(provider: P, model: impl Into<String>) -> Self
pub async fn embed_chunks( &self, chunks: Vec<Chunk>, ) -> Result<Vec<EmbeddedChunk>, EmbedError>
pub async fn embed_texts( &self, texts: Vec<String>, ) -> Result<Vec<Vec<f32>>, EmbedError>
pub async fn embed_text( &self, text: impl Into<String>, ) -> Result<Vec<f32>, EmbedError>
Auto Trait Implementations§
impl<P> Freeze for Embedder<P>where
P: Freeze,
impl<P> RefUnwindSafe for Embedder<P>where
P: RefUnwindSafe,
impl<P> Send for Embedder<P>where
P: Send,
impl<P> Sync for Embedder<P>where
P: Sync,
impl<P> Unpin for Embedder<P>where
P: Unpin,
impl<P> UnsafeUnpin for Embedder<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for Embedder<P>where
P: UnwindSafe,
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