Premkumar2025 commited on
Commit
78e50da
·
verified ·
1 Parent(s): 2742231

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -18,13 +18,13 @@ def calculate_age(birthdate:str)-> int:
18
  Returns:
19
  The user's age as an integer.
20
  """
21
- try:
22
  birth_date = datetime.strptime(birthdate, "%Y-%m-%d") # Convert string to datetime
23
  today = datetime.today()
24
  age = today.year - birth_date.year - ((today.month, today.day) < (birth_date.month, birth_date.day))
25
  return age
26
  except ValueError:
27
- return "LLM failed to retrive birthday informations, Please use YYYY-MM-DD."
28
 
29
  @tool
30
  def get_current_time_in_timezone(timezone: str) -> str:
 
18
  Returns:
19
  The user's age as an integer.
20
  """
21
+ try:
22
  birth_date = datetime.strptime(birthdate, "%Y-%m-%d") # Convert string to datetime
23
  today = datetime.today()
24
  age = today.year - birth_date.year - ((today.month, today.day) < (birth_date.month, birth_date.day))
25
  return age
26
  except ValueError:
27
+ return "LLM failed to retrive birthday info, Please use YYYY-MM-DD."
28
 
29
  @tool
30
  def get_current_time_in_timezone(timezone: str) -> str: