mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 08:08:32 +00:00
fix: handle optional storage with null checks (#1808)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: João Moura <joaomdmoura@gmail.com>
This commit is contained in:
committed by
Devin AI
parent
c02be4a7f5
commit
ccd9eacc1c
@@ -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 storage is not initialized.
|
||||||
"""
|
"""
|
||||||
|
if self.storage is None:
|
||||||
|
raise ValueError("Storage is not initialized.")
|
||||||
|
|
||||||
results = self.storage.search(
|
results = self.storage.search(
|
||||||
query,
|
query,
|
||||||
limit,
|
limit,
|
||||||
|
|||||||
Reference in New Issue
Block a user