Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
| 23 |
-
"""
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
"""
|
| 28 |
-
|
|
|
|
| 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(),
|
| 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,
|