MCPcopy Create free account
hub / github.com/InfinitiBit/graphbit / EmbeddingProviderTrait

Interface EmbeddingProviderTrait

core/src/embeddings.rs:170–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168/// Trait for embedding providers
169#[async_trait]
170pub trait EmbeddingProviderTrait: Send + Sync {
171 /// Generate embeddings for the given request
172 async fn generate_embeddings(
173 &self,
174 request: EmbeddingRequest,
175 ) -> GraphBitResult<EmbeddingResponse>;
176
177 /// Get the provider name
178 fn provider_name(&self) -> &str;
179
180 /// Get the model name
181 fn model_name(&self) -> &str;
182
183 /// Get embedding dimensions for this model
184 async fn get_embedding_dimensions(&self) -> GraphBitResult<usize>;
185
186 /// Check if the provider supports batch processing
187 fn supports_batch(&self) -> bool {
188 true
189 }
190
191 /// Get maximum batch size supported by the provider
192 fn max_batch_size(&self) -> usize {
193 100
194 }
195
196 /// Validate the configuration
197 fn validate_config(&self) -> GraphBitResult<()> {
198 Ok(())
199 }
200}
201
202/// `OpenAI` embedding provider
203#[derive(Debug, Clone)]

Callers

nothing calls this directly

Implementers 2

embeddings.rscore/src/embeddings.rs
python_bridge.rscore/src/embeddings/python_bridge.rs

Calls

no outgoing calls

Tested by

no test coverage detected