pub struct OpenAICompatibleEmbeddingModel { /* private fields */ }
Expand description
An embedder that uses OpenAI’s API for the a remote embedding model.
Implementations§
Source§impl OpenAICompatibleEmbeddingModel
impl OpenAICompatibleEmbeddingModel
Sourcepub fn builder() -> OpenAICompatibleEmbeddingModelBuilder<false>
pub fn builder() -> OpenAICompatibleEmbeddingModelBuilder<false>
Create a new builder for OpenAICompatibleEmbeddingModel
Trait Implementations§
Source§impl Embedder for OpenAICompatibleEmbeddingModel
impl Embedder for OpenAICompatibleEmbeddingModel
Source§async fn embed_string(&self, input: String) -> Result<Embedding, Self::Error>
async fn embed_string(&self, input: String) -> Result<Embedding, Self::Error>
Embed a single string.
Source§async fn embed_vec(
&self,
input: Vec<String>,
) -> Result<Vec<Embedding>, Self::Error>
async fn embed_vec( &self, input: Vec<String>, ) -> Result<Vec<Embedding>, Self::Error>
Embed a single string.
Source§type Error = OpenAICompatibleEmbeddingModelError
type Error = OpenAICompatibleEmbeddingModelError
The error type that can occur when embedding a string.
Source§fn embed_for(
&self,
input: EmbeddingInput,
) -> impl Future<Output = Result<Embedding, Self::Error>> + Send
fn embed_for( &self, input: EmbeddingInput, ) -> impl Future<Output = Result<Embedding, Self::Error>> + Send
Embed a
EmbeddingInput
into a vector spaceSource§fn embed_vec_for(
&self,
inputs: Vec<EmbeddingInput>,
) -> impl Future<Output = Result<Vec<Embedding>, Self::Error>> + Send
fn embed_vec_for( &self, inputs: Vec<EmbeddingInput>, ) -> impl Future<Output = Result<Vec<Embedding>, Self::Error>> + Send
Embed a
Vec<String>
into a vector space. Returns a list of embeddings in the same order as the inputs.Auto Trait Implementations§
impl !Freeze for OpenAICompatibleEmbeddingModel
impl !RefUnwindSafe for OpenAICompatibleEmbeddingModel
impl Send for OpenAICompatibleEmbeddingModel
impl Sync for OpenAICompatibleEmbeddingModel
impl Unpin for OpenAICompatibleEmbeddingModel
impl !UnwindSafe for OpenAICompatibleEmbeddingModel
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
Source§impl<M> EmbedderCacheExt for Mwhere
M: Embedder,
impl<M> EmbedderCacheExt for Mwhere
M: Embedder,
Source§fn cached(self, cache_size: NonZeroUsize) -> CachedEmbeddingModel<Self>where
Self: Sized,
fn cached(self, cache_size: NonZeroUsize) -> CachedEmbeddingModel<Self>where
Self: Sized,
Wrap the embedder with a cache for previously computed embeddings. Read more
Source§impl<E> EmbedderExt for Ewhere
E: Embedder,
impl<E> EmbedderExt for Ewhere
E: Embedder,
Source§fn into_any_embedder(self) -> DynEmbedder
fn into_any_embedder(self) -> DynEmbedder
Convert this embedder into an embedder trait object.
Source§fn embed(
&self,
input: impl ToString,
) -> impl Future<Output = Result<Embedding, Self::Error>> + Send
fn embed( &self, input: impl ToString, ) -> impl Future<Output = Result<Embedding, Self::Error>> + Send
Embed some text into a vector space
Source§fn embed_query(
&self,
input: impl ToString,
) -> impl Future<Output = Result<Embedding, Self::Error>> + Send
fn embed_query( &self, input: impl ToString, ) -> impl Future<Output = Result<Embedding, Self::Error>> + Send
Embed a query into a vector space
Source§fn embed_batch(
&self,
inputs: impl IntoIterator<Item = impl ToString>,
) -> impl Future<Output = Result<Vec<Embedding>, Self::Error>> + Send
fn embed_batch( &self, inputs: impl IntoIterator<Item = impl ToString>, ) -> impl Future<Output = Result<Vec<Embedding>, Self::Error>> + Send
Embed a batch of text into a vector space. Returns a list of embeddings in the same order as the inputs.
Source§fn embed_batch_for(
&self,
inputs: impl IntoIterator<Item = EmbeddingInput>,
) -> impl Future<Output = Result<Vec<Embedding>, Self::Error>> + Send
fn embed_batch_for( &self, inputs: impl IntoIterator<Item = EmbeddingInput>, ) -> impl Future<Output = Result<Vec<Embedding>, Self::Error>> + Send
Embed a batch of
EmbeddingInput
into a vector space. Returns a list of embeddings in the same order as the inputs.