gui commited on
Commit
4f6ad25
·
verified ·
1 Parent(s): a9aaddd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -7
app.py CHANGED
@@ -19,13 +19,19 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
19
  return "What magic will you build ?"
20
 
21
  @tool
22
- def add_two_numbers(n1:float, n2:float)-> float:
23
- """A tool that adds two integer or float numbers.
24
- Args:
25
- n1: float
26
- n2: float
 
 
 
 
 
27
  """
28
- return n1 + n2
 
29
 
30
  @tool
31
  def get_current_time_in_timezone(timezone: str) -> str:
@@ -64,7 +70,7 @@ with open("prompts.yaml", 'r') as stream:
64
 
65
  agent = CodeAgent(
66
  model=model,
67
- tools=[final_answer, get_current_time_in_timezone, DuckDuckGoSearchTool(), add_two_numbers], ## add your tools here (don't remove final answer)
68
  max_steps=6,
69
  verbosity_level=1,
70
  grammar=None,
 
19
  return "What magic will you build ?"
20
 
21
  @tool
22
+ def add_numbers(a: float, b: float) -> float:
23
+ """
24
+ Adds two numbers and returns the result.
25
+
26
+ Parameters:
27
+ - a (float): The first number.
28
+ - b (float): The second number.
29
+
30
+ Returns:
31
+ - float: The sum of a and b.
32
  """
33
+ c = a + b
34
+ return f"The result of adding {a} plus {b} equals {c}"
35
 
36
  @tool
37
  def get_current_time_in_timezone(timezone: str) -> str:
 
70
 
71
  agent = CodeAgent(
72
  model=model,
73
+ tools=[final_answer, get_current_time_in_timezone, DuckDuckGoSearchTool(), add_numbers], ## add your tools here (don't remove final answer)
74
  max_steps=6,
75
  verbosity_level=1,
76
  grammar=None,