Spaces:
Sleeping
Sleeping
Stoyan Georgiev
commited on
Commit
·
473200a
1
Parent(s):
d3cfa61
Updated the Space with new features
Browse files
app.py
CHANGED
@@ -21,26 +21,19 @@ def my_cutom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
21 |
|
22 |
@tool
|
23 |
def get_current_time_in_timezone(timezone: str) -> str:
|
24 |
-
|
25 |
-
|
26 |
|
27 |
-
|
28 |
-
timezone (str): The timezone
|
29 |
|
30 |
Returns:
|
31 |
-
str: The current time
|
32 |
"""
|
33 |
# Falls der Nutzer eine Stadt statt eines gültigen Zeitzonen-IDs angibt,
|
34 |
# können wir eine Mapping-Tabelle verwenden.
|
35 |
-
|
36 |
-
|
37 |
-
"new york city": "America/New_York",
|
38 |
-
"nyc": "America/New_York",
|
39 |
-
# Füge hier weitere Mappings hinzu, falls nötig
|
40 |
-
}
|
41 |
-
key = timezone.lower().strip()
|
42 |
-
if key in timezone_mapping:
|
43 |
-
timezone = timezone_mapping[key]
|
44 |
|
45 |
try:
|
46 |
tz = pytz.timezone(timezone)
|
|
|
21 |
|
22 |
@tool
|
23 |
def get_current_time_in_timezone(timezone: str) -> str:
|
24 |
+
"""
|
25 |
+
Get the current time in a specified timezone.
|
26 |
|
27 |
+
Args:
|
28 |
+
timezone (str): The name of the timezone (e.g., 'America/New_York').
|
29 |
|
30 |
Returns:
|
31 |
+
str: The current time in the specified timezone in ISO 8601 format.
|
32 |
"""
|
33 |
# Falls der Nutzer eine Stadt statt eines gültigen Zeitzonen-IDs angibt,
|
34 |
# können wir eine Mapping-Tabelle verwenden.
|
35 |
+
def get_current_time_in_timezone(timezone: str) -> str:
|
36 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
try:
|
39 |
tz = pytz.timezone(timezone)
|