mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-21 05:48:14 +00:00
Fix #2755: Add support for custom knowledge storage with pre-existing embeddings
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
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
|
||||
Reference in New Issue
Block a user