migolan commited on
Commit
490aca0
·
verified ·
1 Parent(s): eb3aded

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -4,6 +4,7 @@ import requests
4
  import pytz
5
  import yaml
6
  from tools.final_answer import FinalAnswerTool
 
7
 
8
  from Gradio_UI import GradioUI
9
 
@@ -36,6 +37,7 @@ def get_current_time_in_timezone(timezone: str) -> str:
36
 
37
  final_answer = FinalAnswerTool()
38
  duck_duck_go_search = DuckDuckGoSearchTool()
 
39
 
40
  # 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:
41
  # model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
@@ -51,12 +53,14 @@ custom_role_conversions=None,
51
  # Import tool from Hub
52
  image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
53
 
 
 
54
  with open("prompts.yaml", 'r') as stream:
55
  prompt_templates = yaml.safe_load(stream)
56
 
57
  agent = CodeAgent(
58
  model=model,
59
- tools=[final_answer, duck_duck_go_search, get_current_time_in_timezone], ## add your tools here (don't remove final answer)
60
  max_steps=6,
61
  verbosity_level=1,
62
  grammar=None,
 
4
  import pytz
5
  import yaml
6
  from tools.final_answer import FinalAnswerTool
7
+ from tools.visit_webpage import VisitWebpageTool
8
 
9
  from Gradio_UI import GradioUI
10
 
 
37
 
38
  final_answer = FinalAnswerTool()
39
  duck_duck_go_search = DuckDuckGoSearchTool()
40
+ visit_webpage = VisitWebpageTool()
41
 
42
  # 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:
43
  # model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
 
53
  # Import tool from Hub
54
  image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
55
 
56
+ image_generation = image_generation_tool()
57
+
58
  with open("prompts.yaml", 'r') as stream:
59
  prompt_templates = yaml.safe_load(stream)
60
 
61
  agent = CodeAgent(
62
  model=model,
63
+ tools=[final_answer, duck_duck_go_search, get_current_time_in_timezone, visit_webpage, image_generation], ## add your tools here (don't remove final answer)
64
  max_steps=6,
65
  verbosity_level=1,
66
  grammar=None,