Merge pull request #180 from tmchow/fix/bird-x-list-response
fix(bird_x): normalize list responses from Bird search
This commit is contained in:
@@ -213,7 +213,10 @@ def _run_bird_search(query: str, count: int, timeout: int) -> Dict[str, Any]:
|
|||||||
if not output:
|
if not output:
|
||||||
return {"items": []}
|
return {"items": []}
|
||||||
|
|
||||||
return json.loads(output)
|
parsed = json.loads(output)
|
||||||
|
if isinstance(parsed, list):
|
||||||
|
return {"items": parsed}
|
||||||
|
return parsed
|
||||||
|
|
||||||
except json.JSONDecodeError as e:
|
except json.JSONDecodeError as e:
|
||||||
return {"error": f"Invalid JSON response: {e}", "items": []}
|
return {"error": f"Invalid JSON response: {e}", "items": []}
|
||||||
|
|||||||
Reference in New Issue
Block a user