mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 00:58: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.
|
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,
|
||||||
limit,
|
limit,
|
||||||
|
|||||||
Reference in New Issue
Block a user