Upload tool
Browse files
tool.py
CHANGED
|
@@ -41,7 +41,7 @@ class GetCurrentDateAndTime(Tool):
|
|
| 41 |
return f"In {timezone}, it is {day_of_week}, {formatted_date} at {formatted_time}"
|
| 42 |
|
| 43 |
def forward(self, timezone: str) -> str:
|
| 44 |
-
#
|
| 45 |
from datetime import datetime
|
| 46 |
|
| 47 |
try:
|
|
@@ -53,10 +53,7 @@ class GetCurrentDateAndTime(Tool):
|
|
| 53 |
raise ValueError(str(ve))
|
| 54 |
|
| 55 |
except Exception as e: # Handle any unexpected errors
|
| 56 |
-
raise ValueError(
|
| 57 |
-
f"An unexpected error occurred while getting date and time: {str(e)}. "
|
| 58 |
-
"Please try again or contact support if the issue persists."
|
| 59 |
-
)
|
| 60 |
|
| 61 |
def __init__(self, *args, **kwargs):
|
| 62 |
self.is_initialized = False
|
|
|
|
| 41 |
return f"In {timezone}, it is {day_of_week}, {formatted_date} at {formatted_time}"
|
| 42 |
|
| 43 |
def forward(self, timezone: str) -> str:
|
| 44 |
+
# Forward function
|
| 45 |
from datetime import datetime
|
| 46 |
|
| 47 |
try:
|
|
|
|
| 53 |
raise ValueError(str(ve))
|
| 54 |
|
| 55 |
except Exception as e: # Handle any unexpected errors
|
| 56 |
+
raise ValueError(f"Unexpected error getting date and time: {str(e)}")
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
def __init__(self, *args, **kwargs):
|
| 59 |
self.is_initialized = False
|