svoss commited on
Commit
6881f15
·
verified ·
1 Parent(s): 2a43bb6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -7,6 +7,16 @@ from tools.final_answer import FinalAnswerTool
7
 
8
  from Gradio_UI import GradioUI
9
 
 
 
 
 
 
 
 
 
 
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
11
  @tool
12
  def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
 
7
 
8
  from Gradio_UI import GradioUI
9
 
10
+ from smolagents import tool
11
+ from smolagents.tools import DuckDuckGoSearchTool
12
+
13
+ _ddg = DuckDuckGoSearchTool()
14
+
15
+ @tool
16
+ def web_search(query: str) -> str:
17
+ """Search the web using DuckDuckGo and return the results."""
18
+ return _ddg(query)
19
+
20
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
21
  @tool
22
  def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type