pub trait EmbeddingsDriver: Send + Sync {
// Required method
fn embed<'life0, 'async_trait>(
&'life0 self,
request: EmbedRequest,
) -> Pin<Box<dyn Future<Output = Result<EmbedResponse, EmbeddingsDriverError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
}Expand description
Driver trait for text embedding services.
Implementors call their provider’s embedding API and return dense float vectors. Used by knowledge-base hybrid retrieval (see specs/knowledge-bases.md and specs/providers.md phase 6).
Required Methods§
Sourcefn embed<'life0, 'async_trait>(
&'life0 self,
request: EmbedRequest,
) -> Pin<Box<dyn Future<Output = Result<EmbedResponse, EmbeddingsDriverError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn embed<'life0, 'async_trait>(
&'life0 self,
request: EmbedRequest,
) -> Pin<Box<dyn Future<Output = Result<EmbedResponse, EmbeddingsDriverError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Embed a batch of texts and return one vector per input.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".