fix: handle None storage in Knowledge.query for type checks

Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
Devin AI
2024-12-27 20:51:50 +00:00
parent 81759e8c72
commit b56c4c52c0

View File

@@ -49,7 +49,12 @@ class Knowledge(BaseModel):
""" """
Query across all knowledge sources to find the most relevant information. Query across all knowledge sources to find the most relevant information.
Returns the top_k most relevant chunks. Returns the top_k most relevant chunks.
Raises:
ValueError: If no storage is configured for querying.
""" """
if self.storage is None:
raise ValueError("No storage found to perform query.")
results = self.storage.search( results = self.storage.search(
query, query,