From cac533c2a8240461e6924e3ef254c44be897a157 Mon Sep 17 00:00:00 2001 From: Jah-yee Date: Sat, 14 Mar 2026 06:11:53 +0800 Subject: [PATCH] fix: convert datetime to ISO string format for PostgreSQL timestamp compatibility Fixes timestamp type mismatch error in tool_registry_writer.py when inserting into LiteLLM_ToolTable. PostgreSQL expects timestamp format not timezone-aware datetime objects. Closes #23585 --- litellm/proxy/db/tool_registry_writer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/proxy/db/tool_registry_writer.py b/litellm/proxy/db/tool_registry_writer.py index 0eda012d515..70163987118 100644 --- a/litellm/proxy/db/tool_registry_writer.py +++ b/litellm/proxy/db/tool_registry_writer.py @@ -83,7 +83,7 @@ async def batch_upsert_tools( data = [item for item in items if item.get("tool_name")] if not data: return - now = datetime.now(timezone.utc) + now = datetime.now(timezone.utc).isoformat() table = prisma_client.db.litellm_tooltable for item in data: tool_name = item.get("tool_name", "")