Struct anchor_chain::models::openai::OpenAIEmbeddingModel   
source · pub struct OpenAIEmbeddingModel { /* private fields */ }Expand description
Node for making requests to OpenAI embedding models.
Trait Implementations§
source§impl Clone for OpenAIEmbeddingModel
 
impl Clone for OpenAIEmbeddingModel
source§fn clone(&self) -> OpenAIEmbeddingModel
 
fn clone(&self) -> OpenAIEmbeddingModel
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moresource§impl Debug for OpenAIEmbeddingModel
 
impl Debug for OpenAIEmbeddingModel
source§impl Default for OpenAIEmbeddingModel
 
impl Default for OpenAIEmbeddingModel
source§impl EmbeddingModel for OpenAIEmbeddingModel
 
impl EmbeddingModel for OpenAIEmbeddingModel
source§fn embed<'life0, 'async_trait>(
    &'life0 self,
    input: String
) -> Pin<Box<dyn Future<Output = Result<Vec<f32>, AnchorChainError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
 
fn embed<'life0, 'async_trait>(
    &'life0 self,
    input: String
) -> Pin<Box<dyn Future<Output = Result<Vec<f32>, AnchorChainError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
Embeds the given input text and returns the resulting vector.
fn dimensions(&self) -> usize
source§impl Node for OpenAIEmbeddingModel
 
impl Node for OpenAIEmbeddingModel
source§fn process<'life0, 'async_trait>(
    &'life0 self,
    input: Self::Input
) -> Pin<Box<dyn Future<Output = Result<Self::Output, AnchorChainError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
 
fn process<'life0, 'async_trait>(
    &'life0 self,
    input: Self::Input
) -> Pin<Box<dyn Future<Output = Result<Self::Output, AnchorChainError>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
Sends the input to the OpenAI API and processes the response.
Constructs a request based on the input and the system prompt, then parses the model’s response to extract and return the processed content.
Auto Trait Implementations§
impl Freeze for OpenAIEmbeddingModel
impl !RefUnwindSafe for OpenAIEmbeddingModel
impl Send for OpenAIEmbeddingModel
impl Sync for OpenAIEmbeddingModel
impl Unpin for OpenAIEmbeddingModel
impl !UnwindSafe for OpenAIEmbeddingModel
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