Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,8 +19,10 @@ def calculator_tool(expression: str)-> str: # Returns a string result
|
|
| 19 |
The result of the calculation.
|
| 20 |
"""
|
| 21 |
try:
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
| 24 |
|
| 25 |
if response.status_code == 200:
|
| 26 |
return f"Result: {response.json()}"
|
|
|
|
| 19 |
The result of the calculation.
|
| 20 |
"""
|
| 21 |
try:
|
| 22 |
+
app_id = "963LYK-E4A8XXUHW4" # Your Wolfram Alpha App ID
|
| 23 |
+
api_url = f"https://api.wolframalpha.com/v1/result?appid={app_id}&i={expression}"
|
| 24 |
+
|
| 25 |
+
response = requests.get(api_url)
|
| 26 |
|
| 27 |
if response.status_code == 200:
|
| 28 |
return f"Result: {response.json()}"
|