Spaces:
Runtime error
Runtime error
Update my_tools.py
Browse files- my_tools.py +2 -2
my_tools.py
CHANGED
|
@@ -36,8 +36,8 @@ def knowledge_and_intelligence_tool(query: str)-> str:
|
|
| 36 |
|
| 37 |
data = response.json()
|
| 38 |
|
| 39 |
-
if data.get("error"): # Check if there's an error in the response
|
| 40 |
-
return f"Error: {data['error'].get('
|
| 41 |
|
| 42 |
response = ""
|
| 43 |
for result in data.get("queryresult").get("pods")[0].get("subpods"):
|
|
|
|
| 36 |
|
| 37 |
data = response.json()
|
| 38 |
|
| 39 |
+
if data.get("queryresult").get("error"): # Check if there's an error in the response
|
| 40 |
+
return f"Error: {data["queryresult"]['error'].get('msg', 'Unable to fetch Wolfram response.')}"
|
| 41 |
|
| 42 |
response = ""
|
| 43 |
for result in data.get("queryresult").get("pods")[0].get("subpods"):
|