Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,20 +7,25 @@ from tools.final_answer import FinalAnswerTool
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
-
#
|
| 11 |
@tool
|
| 12 |
-
def
|
| 13 |
-
|
| 14 |
-
|
| 15 |
Args:
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
| 18 |
"""
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
@tool
|
| 26 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
| 10 |
+
#Marathon trining plan tool
|
| 11 |
@tool
|
| 12 |
+
def fetch_marathon_plan(goal_time: str) -> str:
|
| 13 |
+
"""Fetches a marathon training plan based on a goal time.
|
| 14 |
+
|
| 15 |
Args:
|
| 16 |
+
goal_time: Desired marathon completion time (e.g., '4:00', '3:30').
|
| 17 |
+
|
| 18 |
+
Returns:
|
| 19 |
+
A link to a training plan or summary of key details.
|
| 20 |
"""
|
| 21 |
+
search_tool = DuckDuckGoSearchTool()
|
| 22 |
+
query = f"marathon training plan {goal_time} site:runnersworld.com"
|
| 23 |
+
results = search_tool.search(query)
|
| 24 |
+
|
| 25 |
+
if results:
|
| 26 |
+
return f"Here is a recommended training plan for {goal_time}: {results[0]['url']}"
|
| 27 |
+
else:
|
| 28 |
+
return f"Could not find a specific plan for {goal_time}, but you can check Runner's World for more details."
|
| 29 |
|
| 30 |
@tool
|
| 31 |
def get_current_time_in_timezone(timezone: str) -> str:
|