dball commited on
Commit
13e97e7
·
verified ·
1 Parent(s): 70fb4da

Fix error with DuckDuckGoSearchTool

Browse files

DuckDuckGoSearchTool is not of type Tool and thus causes an error.

Pass an instantiation of DuckDuckGoSearchTool to CodeAgent.

Files changed (1) hide show
  1. app.py +2 -1
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, DuckDuckGoSearchTool, get_papers_url_for_date, get_current_time_in_timezone],
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,