Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,15 @@ from Gradio_UI import GradioUI
|
|
8 |
# Define tool for fetching current time in a timezone
|
9 |
@tool
|
10 |
def get_current_time_in_timezone(timezone: str) -> str:
|
11 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
try:
|
13 |
tz = pytz.timezone(timezone)
|
14 |
local_time = datetime.datetime.now(tz).strftime("%Y-%m-%d %H:%M:%S")
|
@@ -16,6 +24,7 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
16 |
except Exception as e:
|
17 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
18 |
|
|
|
19 |
# Define tool for AI research paper search
|
20 |
@tool
|
21 |
def fetch_ai_research_papers(query: str) -> str:
|
|
|
8 |
# Define tool for fetching current time in a timezone
|
9 |
@tool
|
10 |
def get_current_time_in_timezone(timezone: str) -> str:
|
11 |
+
"""
|
12 |
+
Fetches the current local time in a specified timezone.
|
13 |
+
|
14 |
+
Args:
|
15 |
+
timezone (str): A valid timezone string (e.g., 'Asia/Kolkata', 'America/New_York').
|
16 |
+
|
17 |
+
Returns:
|
18 |
+
str: The current time in the given timezone or an error message.
|
19 |
+
"""
|
20 |
try:
|
21 |
tz = pytz.timezone(timezone)
|
22 |
local_time = datetime.datetime.now(tz).strftime("%Y-%m-%d %H:%M:%S")
|
|
|
24 |
except Exception as e:
|
25 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
26 |
|
27 |
+
|
28 |
# Define tool for AI research paper search
|
29 |
@tool
|
30 |
def fetch_ai_research_papers(query: str) -> str:
|