pub struct OpenAICompatibleProvider { /* private fields */ }Expand description
Provider that talks to any OpenAI-compatible /embeddings endpoint.
Implementations§
Source§impl OpenAICompatibleProvider
impl OpenAICompatibleProvider
Sourcepub fn new(config: EmbeddingConfig) -> Result<Self>
pub fn new(config: EmbeddingConfig) -> Result<Self>
Creates a provider; fails fast when the config is incomplete.
Sourcepub fn config(&self) -> &EmbeddingConfig
pub fn config(&self) -> &EmbeddingConfig
Returns the provider configuration.
Sourcepub fn preprocessor(&self) -> &PreprocessorImpl
pub fn preprocessor(&self) -> &PreprocessorImpl
Returns the active text preprocessor.
Trait Implementations§
Source§impl Debug for OpenAICompatibleProvider
impl Debug for OpenAICompatibleProvider
Source§impl EmbeddingProvider for OpenAICompatibleProvider
impl EmbeddingProvider for OpenAICompatibleProvider
Source§fn embed<'life0, 'life1, 'async_trait>(
&'life0 self,
texts: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<EmbeddingResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn embed<'life0, 'life1, 'async_trait>(
&'life0 self,
texts: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<EmbeddingResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Embeds a batch of texts, returning vectors in input order.
Source§fn model_name(&self) -> &str
fn model_name(&self) -> &str
Model name served by this provider.
Auto Trait Implementations§
impl !RefUnwindSafe for OpenAICompatibleProvider
impl !UnwindSafe for OpenAICompatibleProvider
impl Freeze for OpenAICompatibleProvider
impl Send for OpenAICompatibleProvider
impl Sync for OpenAICompatibleProvider
impl Unpin for OpenAICompatibleProvider
impl UnsafeUnpin for OpenAICompatibleProvider
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