Spaces:
Runtime error
Runtime error
Thomas Bartlett
commited on
Commit
·
a010141
1
Parent(s):
88547ee
Add DuckDuckGoSearchTool to agent's tools
Browse files
app.py
CHANGED
|
@@ -5,6 +5,7 @@ import pytz
|
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
| 7 |
from tools.visit_webpage import VisitWebpageTool
|
|
|
|
| 8 |
|
| 9 |
from Gradio_UI import GradioUI
|
| 10 |
|
|
@@ -51,13 +52,14 @@ custom_role_conversions=None,
|
|
| 51 |
# Import tool from Hub
|
| 52 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 53 |
visit_webpage_tool = VisitWebpageTool()
|
|
|
|
| 54 |
|
| 55 |
with open("prompts.yaml", 'r') as stream:
|
| 56 |
prompt_templates = yaml.safe_load(stream)
|
| 57 |
|
| 58 |
agent = CodeAgent(
|
| 59 |
model=model,
|
| 60 |
-
tools=[final_answer, image_generation_tool, visit_webpage_tool], ## add your tools here (don't remove final answer)
|
| 61 |
max_steps=6,
|
| 62 |
verbosity_level=1,
|
| 63 |
grammar=None,
|
|
|
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
| 7 |
from tools.visit_webpage import VisitWebpageTool
|
| 8 |
+
from tools.web_search import DuckDuckGoSearchTool
|
| 9 |
|
| 10 |
from Gradio_UI import GradioUI
|
| 11 |
|
|
|
|
| 52 |
# Import tool from Hub
|
| 53 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 54 |
visit_webpage_tool = VisitWebpageTool()
|
| 55 |
+
web_search_tool = DuckDuckGoSearchTool()
|
| 56 |
|
| 57 |
with open("prompts.yaml", 'r') as stream:
|
| 58 |
prompt_templates = yaml.safe_load(stream)
|
| 59 |
|
| 60 |
agent = CodeAgent(
|
| 61 |
model=model,
|
| 62 |
+
tools=[final_answer, image_generation_tool, visit_webpage_tool, web_search_tool], ## add your tools here (don't remove final answer)
|
| 63 |
max_steps=6,
|
| 64 |
verbosity_level=1,
|
| 65 |
grammar=None,
|