makatony commited on
Commit
deecaa0
·
verified ·
1 Parent(s): 7b02262

Update app.py

Browse files

add new tool add_two_numbers

Files changed (1) hide show
  1. app.py +13 -0
app.py CHANGED
@@ -18,6 +18,19 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
18
  """
19
  return "What magic will you build ?"
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  @tool
22
  def get_current_time_in_timezone(timezone: str) -> str:
23
  """A tool that fetches the current local time in a specified timezone.
 
18
  """
19
  return "What magic will you build ?"
20
 
21
+ @tool
22
+ def add_two_numbers(arg1:float, arg2:float)-> float: #it's import to specify the return type
23
+ """A tool to add two numbers
24
+ Args:
25
+ arg1: the first number
26
+ arg2: the second number
27
+ """
28
+ try:
29
+ output = arg1 + arg2
30
+ return f"The addition result is {output}"
31
+ except Exception as e:
32
+ return f"Error adding numbers '{arg1}' and '{arg2}': {str(e)}"
33
+
34
  @tool
35
  def get_current_time_in_timezone(timezone: str) -> str:
36
  """A tool that fetches the current local time in a specified timezone.