Skip to main content

EmbeddingProvider

Trait EmbeddingProvider 

Source
pub trait EmbeddingProvider: Send + Sync {
Show 15 methods // Required methods fn provider_id(&self) -> &str; fn model_id(&self) -> &str; fn model_version(&self) -> &str; fn dimension(&self) -> u32; fn normalization(&self) -> EmbeddingNormalization; fn preprocessing_version(&self) -> &str; fn embed( &self, request: EmbeddingRequest<'_>, ) -> Result<EmbeddingResponse, EmbeddingError>; // Provided methods fn provider_version(&self) -> &str { ... } fn model_artifact_sha256(&self) -> [u8; 32] { ... } fn tokenizer_sha256(&self) -> [u8; 32] { ... } fn preprocessing_sha256(&self) -> [u8; 32] { ... } fn semantic_identity(&self) -> EmbeddingProviderRef { ... } fn execution_mode(&self) -> ProviderExecutionMode { ... } fn health(&self) -> ProviderHealth { ... } fn embed_async<'a>( &'a self, request: EmbeddingRequest<'a>, ) -> Pin<Box<dyn Future<Output = Result<EmbeddingResponse, EmbeddingError>> + Send + 'a>> { ... }
}

Required Methods§

Source

fn provider_id(&self) -> &str

Source

fn model_id(&self) -> &str

Source

fn model_version(&self) -> &str

Source

fn dimension(&self) -> u32

Source

fn normalization(&self) -> EmbeddingNormalization

Source

fn preprocessing_version(&self) -> &str

Source

fn embed( &self, request: EmbeddingRequest<'_>, ) -> Result<EmbeddingResponse, EmbeddingError>

Controlled synchronous inference used by transactional generated columns. Implementations must checkpoint during long work.

Provided Methods§

Source

fn provider_version(&self) -> &str

Source

fn model_artifact_sha256(&self) -> [u8; 32]

Source

fn tokenizer_sha256(&self) -> [u8; 32]

Source

fn preprocessing_sha256(&self) -> [u8; 32]

Source

fn semantic_identity(&self) -> EmbeddingProviderRef

Source

fn execution_mode(&self) -> ProviderExecutionMode

Source

fn health(&self) -> ProviderHealth

Source

fn embed_async<'a>( &'a self, request: EmbeddingRequest<'a>, ) -> Pin<Box<dyn Future<Output = Result<EmbeddingResponse, EmbeddingError>> + Send + 'a>>

Async transport hook for remote providers. The default is suitable only for short cooperative local inference; heavy local implementations must override this and use a bounded blocking executor.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§