debasishdas commited on
Commit
f0d372d
·
verified ·
1 Parent(s): b1f2d8e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
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
- raise SystemError
24
- (f"Error: Invalid Syntax in the expression {se}") from se
25
  except Exception as e:
26
- raise Exception
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: