tiinav commited on
Commit
2cf19d5
·
verified ·
1 Parent(s): 9e10941

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -42,14 +42,14 @@ def get_current_time_in_timezone(timezone: str) -> datetime:
42
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
43
  @tool
44
  def get_time_zone_string(local_time: datetime, timezone:str) -> str:
45
- """A tool that converts the datetime obejct to a string format for a response to the user.
46
  Args:
47
  local_time: A datetime object of the local time zone
48
  timezone: A string representing a valid timezone (e.g., 'America/New_York').
49
  """
50
  try:
51
- local_time = local_time.strftime("%Y-%m-%d %H:%M:%S")
52
- return f"Local time in {timezone} is {local_time}"
53
  except Exception as e:
54
  return f"Error converting '{local_time}' to string: {str(e)}"
55
 
 
42
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
43
  @tool
44
  def get_time_zone_string(local_time: datetime, timezone:str) -> str:
45
+ """A tool that converts the datetime object to a string format for a response to the user.
46
  Args:
47
  local_time: A datetime object of the local time zone
48
  timezone: A string representing a valid timezone (e.g., 'America/New_York').
49
  """
50
  try:
51
+ local_time_str = local_time.strftime("%Y-%m-%d %H:%M:%S")
52
+ return f"Local time in {timezone} is {local_time_str}"
53
  except Exception as e:
54
  return f"Error converting '{local_time}' to string: {str(e)}"
55