Yular commited on
Commit
970ed7f
·
verified ·
1 Parent(s): 3d20e59

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -3,6 +3,8 @@ import datetime
3
  import requests
4
  import pytz
5
  import yaml
 
 
6
  from tools.final_answer import FinalAnswerTool
7
 
8
  from Gradio_UI import GradioUI
@@ -33,6 +35,8 @@ def get_current_time_in_timezone(timezone: str) -> str:
33
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
34
 
35
 
 
 
36
  final_answer = FinalAnswerTool()
37
 
38
  # 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:
@@ -54,7 +58,7 @@ with open("prompts.yaml", 'r') as stream:
54
 
55
  agent = CodeAgent(
56
  model=model,
57
- tools=[my_custom_tool, get_current_time_in_timezone, final_answer,image_generation_tool], ## add your tools here (don't remove final answer)
58
  max_steps=6,
59
  verbosity_level=1,
60
  grammar=None,
 
3
  import requests
4
  import pytz
5
  import yaml
6
+ from tools.web_search import WebSearchTool
7
+ from tools.visit_webpage import VisitWebpageTool
8
  from tools.final_answer import FinalAnswerTool
9
 
10
  from Gradio_UI import GradioUI
 
35
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
36
 
37
 
38
+ web_search = WebSearchTool()
39
+ visit_webpage = VisitWebpageTool()
40
  final_answer = FinalAnswerTool()
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:
 
58
 
59
  agent = CodeAgent(
60
  model=model,
61
+ tools=[my_custom_tool, get_current_time_in_timezone, web_search, final_answer, visit_webpage, image_generation_tool], ## add your tools here (don't remove final answer)
62
  max_steps=6,
63
  verbosity_level=1,
64
  grammar=None,