Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,14 +12,14 @@ from Gradio_UI import GradioUI
|
|
| 12 |
|
| 13 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 14 |
@tool
|
| 15 |
-
def
|
| 16 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 17 |
-
"""A tool
|
| 18 |
Args:
|
| 19 |
arg1: the first argument
|
| 20 |
-
arg2: the second argument
|
| 21 |
"""
|
| 22 |
-
|
|
|
|
| 23 |
|
| 24 |
@tool
|
| 25 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
@@ -56,7 +56,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 56 |
|
| 57 |
agent = CodeAgent(
|
| 58 |
model=model,
|
| 59 |
-
tools=[final_answer, visit, webPage, get_current_time_in_timezone, image_generation_tool], ## add your tools here (don't remove final answer)
|
| 60 |
max_steps=6,
|
| 61 |
verbosity_level=1,
|
| 62 |
grammar=None,
|
|
|
|
| 12 |
|
| 13 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 14 |
@tool
|
| 15 |
+
def calculateFiveYear(salary:int)-> int: #it's import to specify the return type
|
| 16 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 17 |
+
"""A tool calculate salary in five years
|
| 18 |
Args:
|
| 19 |
arg1: the first argument
|
|
|
|
| 20 |
"""
|
| 21 |
+
salary = salary * 52
|
| 22 |
+
return salary
|
| 23 |
|
| 24 |
@tool
|
| 25 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 56 |
|
| 57 |
agent = CodeAgent(
|
| 58 |
model=model,
|
| 59 |
+
tools=[final_answer, visit, webPage, get_current_time_in_timezone, image_generation_tool, calculateFiveYear], ## add your tools here (don't remove final answer)
|
| 60 |
max_steps=6,
|
| 61 |
verbosity_level=1,
|
| 62 |
grammar=None,
|