mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 13:18:18 +00:00
Raise value error if research pick next tool isn't a dictionary
This will give a better error message with response content than the failed to get errors from non dictionary response we were getting earlier.
This commit is contained in:
@@ -198,6 +198,8 @@ async def apick_next_tool(
|
||||
|
||||
try:
|
||||
response = load_complex_json(response)
|
||||
if not isinstance(response, dict):
|
||||
raise ValueError(f"Expected dict response, got {type(response).__name__}: {response}")
|
||||
selected_tool = response.get("tool", None)
|
||||
generated_query = response.get("query", None)
|
||||
scratchpad = response.get("scratchpad", None)
|
||||
|
||||
Reference in New Issue
Block a user