mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-12 01:28:30 +00:00
21 lines
638 B
Python
21 lines
638 B
Python
from typing import Optional
|
|
|
|
from pydantic import Field
|
|
|
|
from crewai.knowledge.source.base_knowledge_source import BaseKnowledgeSource
|
|
from crewai.knowledge.storage.knowledge_storage import KnowledgeStorage
|
|
|
|
|
|
class CustomStorageKnowledgeSource(BaseKnowledgeSource):
|
|
"""A knowledge source that uses a pre-existing storage with embeddings."""
|
|
|
|
collection_name: Optional[str] = Field(default=None)
|
|
|
|
def validate_content(self):
|
|
"""No content to validate as we're using pre-existing storage."""
|
|
pass
|
|
|
|
def add(self) -> None:
|
|
"""No need to add content as we're using pre-existing storage."""
|
|
pass
|