pub struct OpenAiEmbedding { /* private fields */ }Expand description
OpenAI-compatible embedding provider
Implementations§
Trait Implementations§
Source§impl EmbeddingProvider for OpenAiEmbedding
impl EmbeddingProvider for OpenAiEmbedding
Source§fn dimensions(&self) -> usize
fn dimensions(&self) -> usize
Embedding dimensions
Source§fn embed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
texts: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<f32>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn embed<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
texts: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<f32>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Embed a batch of texts into vectors
Auto Trait Implementations§
impl Freeze for OpenAiEmbedding
impl !RefUnwindSafe for OpenAiEmbedding
impl Send for OpenAiEmbedding
impl Sync for OpenAiEmbedding
impl Unpin for OpenAiEmbedding
impl UnsafeUnpin for OpenAiEmbedding
impl !UnwindSafe for OpenAiEmbedding
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