Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,9 +5,14 @@ import pytz
|
|
| 5 |
import yaml
|
| 6 |
import os
|
| 7 |
from tools.final_answer import FinalAnswerTool
|
|
|
|
|
|
|
| 8 |
|
| 9 |
from Gradio_UI import GradioUI
|
| 10 |
|
|
|
|
|
|
|
|
|
|
| 11 |
@tool
|
| 12 |
def get_weather(city: str) -> str:
|
| 13 |
"""
|
|
@@ -90,7 +95,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 90 |
|
| 91 |
agent = CodeAgent(
|
| 92 |
model=model,
|
| 93 |
-
tools=[final_answer, image_generation_tool, get_current_time_in_timezone, get_weather,
|
| 94 |
max_steps=6,
|
| 95 |
verbosity_level=1,
|
| 96 |
grammar=None,
|
|
|
|
| 5 |
import yaml
|
| 6 |
import os
|
| 7 |
from tools.final_answer import FinalAnswerTool
|
| 8 |
+
from tools.web_search import DuckDuckGoSearchTool
|
| 9 |
+
from tools.visit_webpage import VisitWebpageTool
|
| 10 |
|
| 11 |
from Gradio_UI import GradioUI
|
| 12 |
|
| 13 |
+
web_search_tool = DuckDuckGoSearchTool(max_results=5)
|
| 14 |
+
visit_webpage_tool = VisitWebpageTool()
|
| 15 |
+
|
| 16 |
@tool
|
| 17 |
def get_weather(city: str) -> str:
|
| 18 |
"""
|
|
|
|
| 95 |
|
| 96 |
agent = CodeAgent(
|
| 97 |
model=model,
|
| 98 |
+
tools=[final_answer, image_generation_tool, get_current_time_in_timezone, get_weather, web_search_tool, visit_webpage_tool], ## add your tools here (don't remove final answer)
|
| 99 |
max_steps=6,
|
| 100 |
verbosity_level=1,
|
| 101 |
grammar=None,
|