Aakash010 commited on
Commit
5dbbfb7
·
verified ·
1 Parent(s): f76072a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -35,7 +35,7 @@ def get_current_time_in_timezone(timezone: str) -> str:
35
  final_answer = FinalAnswerTool()
36
 
37
  # ✅ web_search_tool is defined here
38
- web_search_tool = DuckDuckGoSearchTool(max_results=5)
39
 
40
  model = HfApiModel(
41
  max_tokens=2096,
@@ -44,7 +44,7 @@ model = HfApiModel(
44
  custom_role_conversions=None,
45
  )
46
 
47
- image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
48
 
49
  with open("prompts.yaml", 'r') as stream:
50
  prompt_templates = yaml.safe_load(stream)
@@ -52,7 +52,7 @@ with open("prompts.yaml", 'r') as stream:
52
  agent = CodeAgent(
53
  model=model,
54
  # ✅ web_search_tool is NOW included in the tools list
55
- tools=[final_answer, my_custom_tool, get_current_time_in_timezone, web_search_tool, image_generation_tool],
56
  max_steps=6,
57
  verbosity_level=1,
58
  grammar=None,
 
35
  final_answer = FinalAnswerTool()
36
 
37
  # ✅ web_search_tool is defined here
38
+ web_search = DuckDuckGoSearchTool(max_results=5)
39
 
40
  model = HfApiModel(
41
  max_tokens=2096,
 
44
  custom_role_conversions=None,
45
  )
46
 
47
+ image_generator = load_tool("agents-course/text-to-image", trust_remote_code=True)
48
 
49
  with open("prompts.yaml", 'r') as stream:
50
  prompt_templates = yaml.safe_load(stream)
 
52
  agent = CodeAgent(
53
  model=model,
54
  # ✅ web_search_tool is NOW included in the tools list
55
+ tools=[final_answer, my_custom_tool, get_current_time_in_timezone, web_search, image_generator],
56
  max_steps=6,
57
  verbosity_level=1,
58
  grammar=None,