mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-26 08:38:15 +00:00
- introduce baseembeddingsprovider and helper for embedding functions - add core embedding types and migrate providers, factory, and storage modules - remove unused type aliases and fix pydantic schema error - update providers with env var support and related fixes
20 lines
659 B
Python
20 lines
659 B
Python
"""Custom embeddings provider for user-defined embedding functions."""
|
|
|
|
from pydantic import Field
|
|
from pydantic_settings import SettingsConfigDict
|
|
|
|
from crewai.rag.core.base_embeddings_provider import BaseEmbeddingsProvider
|
|
from crewai.rag.embeddings.providers.custom.embedding_callable import (
|
|
CustomEmbeddingFunction,
|
|
)
|
|
|
|
|
|
class CustomProvider(BaseEmbeddingsProvider[CustomEmbeddingFunction]):
|
|
"""Custom embeddings provider for user-defined embedding functions."""
|
|
|
|
embedding_callable: type[CustomEmbeddingFunction] = Field(
|
|
..., description="Custom embedding function class"
|
|
)
|
|
|
|
model_config = SettingsConfigDict(extra="allow")
|