pwinslow commited on
Commit
f6d5adb
·
verified ·
1 Parent(s): dbb0ec4

add search and text-to-image tools

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -49,6 +49,7 @@ def get_current_time_in_timezone(timezone: str) -> str:
49
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
50
 
51
 
 
52
  final_answer = FinalAnswerTool()
53
 
54
  # If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
@@ -70,7 +71,7 @@ with open("prompts.yaml", 'r') as stream:
70
 
71
  agent = CodeAgent(
72
  model=model,
73
- tools=[final_answer, get_current_time_in_timezone, convert_timezone], ## add your tools here (don't remove final answer)
74
  max_steps=6,
75
  verbosity_level=1,
76
  grammar=None,
 
49
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
50
 
51
 
52
+ search_tool = DuckDuckGoSearchTool(max_results=5, rate_limit=2.0)
53
  final_answer = FinalAnswerTool()
54
 
55
  # If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
 
71
 
72
  agent = CodeAgent(
73
  model=model,
74
+ tools=[final_answer, get_current_time_in_timezone, convert_timezone, search_tool, image_generation_tool], ## add your tools here (don't remove final answer)
75
  max_steps=6,
76
  verbosity_level=1,
77
  grammar=None,