priyar84 commited on
Commit
b3ecf73
·
verified ·
1 Parent(s): 639894e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -21,19 +21,19 @@ from Gradio_UI import GradioUI
21
  #return "What magic will you build ?"
22
 
23
  @tool
24
- def get_current_time_in_timezone(timezone: str) -> str:
25
- """A tool that fetches the current local time in a specified timezone.
26
- Args:
27
- timezone: A string representing a valid timezone (e.g., 'America/New_York').
28
- """
29
- try:
30
- # Create timezone object
31
- tz = pytz.timezone(timezone)
32
  # Get current time in that timezone
33
- local_time = datetime.datetime.now(tz).strftime("%Y-%m-%d %H:%M:%S")
34
- return f"The current local time in {timezone} is: {local_time}"
35
- except Exception as e:
36
- return f"Error fetching time for timezone '{timezone}': {str(e)}"
37
 
38
 
39
  final_answer = FinalAnswerTool()
 
21
  #return "What magic will you build ?"
22
 
23
  @tool
24
+ #def get_current_time_in_timezone(timezone: str) -> str:
25
+ # """A tool that fetches the current local time in a specified timezone.
26
+ # Args:
27
+ # timezone: A string representing a valid timezone (e.g., 'America/New_York').
28
+ # """
29
+ # try:
30
+ ## # Create timezone object
31
+ ## tz = pytz.timezone(timezone)
32
  # Get current time in that timezone
33
+ ## local_time = datetime.datetime.now(tz).strftime("%Y-%m-%d %H:%M:%S")
34
+ ## return f"The current local time in {timezone} is: {local_time}"
35
+ ## except Exception as e:
36
+ ## return f"Error fetching time for timezone '{timezone}': {str(e)}"
37
 
38
 
39
  final_answer = FinalAnswerTool()