Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,6 +7,8 @@ from tools.final_answer import FinalAnswerTool
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
|
|
|
|
|
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
# world cup today status
|
| 12 |
@tool
|
|
@@ -16,18 +18,13 @@ def world_cup_today_status()-> str: #it's import to specify the return type
|
|
| 16 |
Get today's FIFA World Cup 2026 match information.
|
| 17 |
|
| 18 |
Returns:
|
| 19 |
-
A summary containing
|
| 20 |
-
- Today's matches
|
| 21 |
-
- Current scores (if available)
|
| 22 |
-
- Tournament round/stage
|
| 23 |
-
- Teams playing
|
| 24 |
"""
|
| 25 |
try:
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
return f"Error fetching World Cup information: {e}"
|
| 31 |
|
| 32 |
@tool
|
| 33 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
@@ -66,7 +63,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 66 |
|
| 67 |
agent = CodeAgent(
|
| 68 |
model=model,
|
| 69 |
-
tools=[final_answer, world_cup_today_status], ## add your tools here (don't remove final answer)
|
| 70 |
max_steps=6,
|
| 71 |
verbosity_level=1,
|
| 72 |
grammar=None,
|
|
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
+
web_search_tool = DuckDuckGoSearchTool(max_results=5, rate_limit=2.0)
|
| 11 |
+
|
| 12 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 13 |
# world cup today status
|
| 14 |
@tool
|
|
|
|
| 18 |
Get today's FIFA World Cup 2026 match information.
|
| 19 |
|
| 20 |
Returns:
|
| 21 |
+
A summary containing today's matches, scores, teams, and tournament stage.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
"""
|
| 23 |
try:
|
| 24 |
+
results = web_search_tool("FIFA World Cup 2026 schedule today matches results no matches")
|
| 25 |
+
return ("Here are the latest World Cup 2026 updates:\n\n" + str(results))
|
| 26 |
+
except Exception:
|
| 27 |
+
return "Unable to retrieve World Cup updates."
|
|
|
|
| 28 |
|
| 29 |
@tool
|
| 30 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 63 |
|
| 64 |
agent = CodeAgent(
|
| 65 |
model=model,
|
| 66 |
+
tools=[final_answer, world_cup_today_status, get_current_time_in_timezone], ## add your tools here (don't remove final answer)
|
| 67 |
max_steps=6,
|
| 68 |
verbosity_level=1,
|
| 69 |
grammar=None,
|