Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,15 +7,16 @@ from tools.final_answer import FinalAnswerTool
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
-
|
| 11 |
-
def
|
| 12 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 13 |
-
"""A tool that can
|
| 14 |
Args:
|
| 15 |
-
arg1:
|
| 16 |
"""
|
| 17 |
-
|
| 18 |
-
|
|
|
|
| 19 |
|
| 20 |
@tool
|
| 21 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
@@ -57,7 +58,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 57 |
|
| 58 |
agent = CodeAgent(
|
| 59 |
model=model,
|
| 60 |
-
tools=[final_answer,get_current_time_in_timezone,web_search_tool], ## add your tools here (don't remove final answer)
|
| 61 |
max_steps=6,
|
| 62 |
verbosity_level=1,
|
| 63 |
grammar=None,
|
|
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
+
|
| 11 |
+
def string_reverse_tool(arg1:str)-> str: #it's import to specify the return type
|
| 12 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 13 |
+
"""A tool that can reverse any string
|
| 14 |
Args:
|
| 15 |
+
arg1: string.
|
| 16 |
"""
|
| 17 |
+
s = arg1[::-1]
|
| 18 |
+
|
| 19 |
+
return s
|
| 20 |
|
| 21 |
@tool
|
| 22 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 58 |
|
| 59 |
agent = CodeAgent(
|
| 60 |
model=model,
|
| 61 |
+
tools=[final_answer,get_current_time_in_timezone,web_search_tool,string_reverse_tool,image_generation_tool], ## add your tools here (don't remove final answer)
|
| 62 |
max_steps=6,
|
| 63 |
verbosity_level=1,
|
| 64 |
grammar=None,
|