fix: delegate collection name sanitization to knowledge store

This commit is contained in:
lucasgomide
2025-03-25 15:06:00 -03:00
committed by Lucas Gomide
parent df25703cc2
commit 6b14ffcffb
9 changed files with 563 additions and 164 deletions

View File

@@ -98,8 +98,11 @@ class KnowledgeStorage(BaseKnowledgeStorage):
else "knowledge"
)
if self.app:
from crewai.utilities.chromadb import sanitize_collection_name
self.collection = self.app.get_or_create_collection(
name=collection_name, embedding_function=self.embedder
name=sanitize_collection_name(collection_name),
embedding_function=self.embedder,
)
else:
raise Exception("Vector Database Client not initialized")