roger33303 commited on
Commit
5956a97
·
verified ·
1 Parent(s): 2ae0759

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -7,15 +7,16 @@ from tools.final_answer import FinalAnswerTool
7
 
8
  from Gradio_UI import GradioUI
9
 
10
- search_tool = DuckDuckGoSearchTool()
11
- def web_search_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 search diffrent websites and give back the contents of the webpage
14
  Args:
15
- arg1: Direct question to search the web.
16
  """
17
- search_result = search_tool(arg1)
18
- return search_result
 
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,