Spaces:
Runtime error
Runtime error
Update my_tools.py
Browse files- my_tools.py +1 -1
my_tools.py
CHANGED
@@ -37,7 +37,7 @@ def knowledge_and_intelligence_tool(query: str)-> str:
|
|
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[
|
41 |
|
42 |
response = ""
|
43 |
for result in data.get("queryresult").get("pods")[0].get("subpods"):
|
|
|
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"):
|