harryab commited on
Commit
db6b157
·
verified ·
1 Parent(s): 5366cae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -11
app.py CHANGED
@@ -7,20 +7,25 @@ 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
  @tool
12
- def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
13
- #Keep this format for the description / args / args description but feel free to modify the tool
14
- """A tool that does nothing yet
15
  Args:
16
- arg1: the first argument
17
- arg2: the second argument
 
 
18
  """
19
- return "What magic will you build ?"
20
-
21
- def calculator(a: int, b: int) -> int:
22
- """Multiply two integers."""
23
- return a * b
 
 
 
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: