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 'life0: 'async_trait,
Self: 'async_trait;
fn health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), EmbeddingProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: '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
'life0: 'async_trait,
Self: 'async_trait,
fn health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), EmbeddingProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl EmbeddingProviderV1 for OnnxEmbeddingProvider
impl EmbeddingProviderV1 for OnnxEmbeddingProvider
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
'life0: 'async_trait,
OnnxEmbeddingProvider: 'async_trait,
fn health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), EmbeddingProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
OnnxEmbeddingProvider: 'async_trait,
Source§impl EmbeddingProviderV1 for RemoteEmbeddingProvider
impl EmbeddingProviderV1 for RemoteEmbeddingProvider
Source§fn health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), EmbeddingProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
RemoteEmbeddingProvider: 'async_trait,
fn health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), EmbeddingProviderError>> + Send + 'async_trait>>where
'life0: 'async_trait,
RemoteEmbeddingProvider: 'async_trait,
One short request. The endpoint has no cheaper probe that every compatible server implements, so readiness costs one embedding.