Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,13 +20,11 @@ def my_custom_tool(expr:str)-> str: #it's import to specify the return type
|
|
| 20 |
res = eval(arg1)
|
| 21 |
|
| 22 |
except SyntaxError as se:
|
| 23 |
-
|
| 24 |
-
(f"Error: Invalid Syntax in the expression {se}") from se
|
| 25 |
except Exception as e:
|
| 26 |
-
|
| 27 |
-
("Error: evaluatiopn failed with error {e}") from e
|
| 28 |
|
| 29 |
-
return str(res)
|
| 30 |
|
| 31 |
@tool
|
| 32 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 20 |
res = eval(arg1)
|
| 21 |
|
| 22 |
except SyntaxError as se:
|
| 23 |
+
return f"Error: Invalid Syntax in the expression: {str(se)}"
|
|
|
|
| 24 |
except Exception as e:
|
| 25 |
+
return f"Error: evaluatiopn failed with error {str(e)}"
|
|
|
|
| 26 |
|
| 27 |
+
return f"{expr} evaluates to {str(res)}"
|
| 28 |
|
| 29 |
@tool
|
| 30 |
def get_current_time_in_timezone(timezone: str) -> str:
|