Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -23,21 +23,6 @@ def generate_random_password(length: int = 12) -> str:
|
|
23 |
password = ''.join(random.choice(characters) for _ in range(length))
|
24 |
return password
|
25 |
|
26 |
-
@tool
|
27 |
-
def get_current_time_in_timezone(timezone: str) -> str:
|
28 |
-
"""A tool that fetches the current local time in a specified timezone.
|
29 |
-
Args:
|
30 |
-
timezone: A string representing a valid timezone (e.g., 'America/New_York').
|
31 |
-
"""
|
32 |
-
try:
|
33 |
-
# Create timezone object
|
34 |
-
tz = pytz.timezone(timezone)
|
35 |
-
# Get current time in that timezone
|
36 |
-
local_time = datetime.datetime.now(tz).strftime("%Y-%m-%d %H:%M:%S")
|
37 |
-
return f"The current local time in {timezone} is: {local_time}"
|
38 |
-
except Exception as e:
|
39 |
-
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
40 |
-
|
41 |
final_answer = FinalAnswerTool()
|
42 |
|
43 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
|
|
23 |
password = ''.join(random.choice(characters) for _ in range(length))
|
24 |
return password
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
final_answer = FinalAnswerTool()
|
27 |
|
28 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|