Trait anchor_chain::models::embedding_model::EmbeddingModel
source · pub trait EmbeddingModel {
// Required methods
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 dimensions(&self) -> usize;
}Expand description
Defines the interface for an embedding model that can embed text input.
Required Methods§
sourcefn 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.