pub struct EmbeddingService<P: EmbeddingProvider> { /* private fields */ }Expand description
Convenience wrapper that adds count-based batch handling on top of a provider.
Implementations§
Source§impl<P: EmbeddingProvider> EmbeddingService<P>
impl<P: EmbeddingProvider> EmbeddingService<P>
Sourcepub fn new(provider: P, batch_size: usize) -> Self
pub fn new(provider: P, batch_size: usize) -> Self
Creates a service with the given provider and batch size.
Sourcepub async fn embed_batch(&self, texts: &[String]) -> Result<EmbeddingResult>
pub async fn embed_batch(&self, texts: &[String]) -> Result<EmbeddingResult>
Embeds texts in batches, concatenating results in input order.
Trait Implementations§
Source§impl<P: Clone + EmbeddingProvider> Clone for EmbeddingService<P>
impl<P: Clone + EmbeddingProvider> Clone for EmbeddingService<P>
Auto Trait Implementations§
impl<P> Freeze for EmbeddingService<P>where
P: Freeze,
impl<P> RefUnwindSafe for EmbeddingService<P>where
P: RefUnwindSafe,
impl<P> Send for EmbeddingService<P>
impl<P> Sync for EmbeddingService<P>
impl<P> Unpin for EmbeddingService<P>where
P: Unpin,
impl<P> UnsafeUnpin for EmbeddingService<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for EmbeddingService<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