ronnybehrens commited on
Commit
c131651
·
verified ·
1 Parent(s): a45aa10

Included my own function, and instantiated web search correctly

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -53,12 +53,16 @@ custom_role_conversions=None,
53
  # Import tool from Hub
54
  image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
55
 
 
 
 
 
56
  with open("prompts.yaml", 'r') as stream:
57
  prompt_templates = yaml.safe_load(stream)
58
 
59
  agent = CodeAgent(
60
  model=model,
61
- tools=[get_current_time_in_timezone, image_generation_tool, final_answer, DuckDuckGoSearchTool], ## add your tools here (don't remove final answer)
62
  max_steps=6,
63
  verbosity_level=1,
64
  grammar=None,
 
53
  # Import tool from Hub
54
  image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
55
 
56
+ # Use web search
57
+ web_search_tool = DuckDuckGoSearchTool(max_results=5, rate_limit=2.0)
58
+
59
+
60
  with open("prompts.yaml", 'r') as stream:
61
  prompt_templates = yaml.safe_load(stream)
62
 
63
  agent = CodeAgent(
64
  model=model,
65
+ tools=[get_current_time_in_timezone, image_generation_tool, final_answer, produce_a_farty_text, web_search_tool], ## add your tools here (don't remove final answer)
66
  max_steps=6,
67
  verbosity_level=1,
68
  grammar=None,