Update app.py
Browse files
app.py
CHANGED
@@ -22,12 +22,11 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
22 |
cache = {}
|
23 |
|
24 |
|
25 |
-
web_search = Tool(
|
26 |
-
name="duck_duck_go_search",
|
27 |
-
func=DuckDuckGoSearch().run,
|
28 |
-
description="Use this tool to search the web using DuckDuckGo."
|
29 |
-
)
|
30 |
|
|
|
|
|
|
|
|
|
31 |
google_search = GoogleSearchTool(provider="serper")
|
32 |
python_interpreter = PythonInterpreterTool(authorized_imports = [
|
33 |
# standard library
|
@@ -132,7 +131,7 @@ class BasicAgent:
|
|
132 |
print("BasicAgent initialized.")
|
133 |
self.agent = CodeAgent(
|
134 |
model=model,
|
135 |
-
tools=[google_search,
|
136 |
max_steps=10,
|
137 |
verbosity_level=1,
|
138 |
grammar=None,
|
|
|
22 |
cache = {}
|
23 |
|
24 |
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
+
class WebSearchTool(DuckDuckGoSearchTool):
|
27 |
+
name = "web_search_ddg"
|
28 |
+
description = "Search the web using DuckDuckGo"
|
29 |
+
web_search_ddf = WebSearchTool()
|
30 |
google_search = GoogleSearchTool(provider="serper")
|
31 |
python_interpreter = PythonInterpreterTool(authorized_imports = [
|
32 |
# standard library
|
|
|
131 |
print("BasicAgent initialized.")
|
132 |
self.agent = CodeAgent(
|
133 |
model=model,
|
134 |
+
tools=[google_search,web_search_ddf, python_interpreter, visit_webpage_tool, wiki_tool,lc_wikipedia,lc_arxiv,lc_pubmed,lc_stackechange],
|
135 |
max_steps=10,
|
136 |
verbosity_level=1,
|
137 |
grammar=None,
|