Spaces:
Sleeping
Sleeping
Fix error with DuckDuckGoSearchTool
Browse filesDuckDuckGoSearchTool is not of type Tool and thus causes an error.
Pass an instantiation of DuckDuckGoSearchTool to CodeAgent.
app.py
CHANGED
@@ -46,13 +46,14 @@ custom_role_conversions=None,
|
|
46 |
|
47 |
# Import tool from Hub
|
48 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
|
|
49 |
|
50 |
with open("prompts.yaml", 'r') as stream:
|
51 |
prompt_templates = yaml.safe_load(stream)
|
52 |
|
53 |
agent = CodeAgent(
|
54 |
model=model,
|
55 |
-
tools=[final_answer,
|
56 |
max_steps=6,
|
57 |
verbosity_level=1,
|
58 |
grammar=None,
|
|
|
46 |
|
47 |
# Import tool from Hub
|
48 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
49 |
+
search_tool = DuckDuckGoSearchTool()
|
50 |
|
51 |
with open("prompts.yaml", 'r') as stream:
|
52 |
prompt_templates = yaml.safe_load(stream)
|
53 |
|
54 |
agent = CodeAgent(
|
55 |
model=model,
|
56 |
+
tools=[final_answer, search_tool, get_papers_url_for_date, get_current_time_in_timezone],
|
57 |
max_steps=6,
|
58 |
verbosity_level=1,
|
59 |
grammar=None,
|