mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 16:18:30 +00:00
fix: handle None storage in Knowledge.query for type checks
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -49,8 +49,13 @@ class Knowledge(BaseModel):
|
||||
"""
|
||||
Query across all knowledge sources to find the most relevant information.
|
||||
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(
|
||||
query,
|
||||
limit,
|
||||
|
||||
Reference in New Issue
Block a user