Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix localtime_to_timestamp tool throws 'no attribute localize error' when it executes without specifying a timezone parameter (#23517)
goofyad1b1193faec
diff --git a/api/core/tools/builtin_tool/providers/time/tools/localtime_to_timestamp.py b/api/core/tools/builtin_tool/providers/time/tools/localtime_to_timestamp.pyindex 1639dd687f5..a8fd6ec2cdf 100644--- a/api/core/tools/builtin_tool/providers/time/tools/localtime_to_timestamp.py+++ b/api/core/tools/builtin_tool/providers/time/tools/localtime_to_timestamp.py@@ -37,12 +37,12 @@ class LocaltimeToTimestampTool(BuiltinTool):@staticmethoddef localtime_to_timestamp(localtime: str, time_format: str, local_tz=None) -> int | None:try:+ local_time = datetime.strptime(localtime, time_format)if local_tz is None:- local_tz = datetime.now().astimezone().tzinfo- if isinstance(local_tz, str):+ localtime = local_time.astimezone() # type: ignore+ elif isinstance(local_tz, str):local_tz = pytz.timezone(local_tz)- local_time = datetime.strptime(localtime, time_format)- localtime = local_tz.localize(local_time) # type: ignore+ localtime = local_tz.localize(local_time) # type: ignoretimestamp = int(localtime.timestamp()) # type: ignorereturn timestampexcept Exception as e: