pub trait EmbeddingProviderV1:
Send
+ Sync
+ 'static {
// Required methods
fn embedding_space(&self) -> &EmbeddingSpaceId;
fn dimension(&self) -> u32;
fn embed<'life0, 'async_trait>(
&'life0 self,
req: EmbedRequest,
) -> Pin<Box<dyn Future<Output = Result<EmbedResponse, EmbeddingProviderError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), EmbeddingProviderError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
The embedding-provider plugin contract
(cpt-cf-graph-storage-contract-embedding-provider).
Required Methods§
Sourcefn embedding_space(&self) -> &EmbeddingSpaceId
fn embedding_space(&self) -> &EmbeddingSpaceId
Model artifact, tokenizer artifact, preprocessing and pooling configuration — not just a dimension.
fn dimension(&self) -> u32
fn embed<'life0, 'async_trait>(
&'life0 self,
req: EmbedRequest,
) -> Pin<Box<dyn Future<Output = Result<EmbedResponse, EmbeddingProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), EmbeddingProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".