From 464a5a128e916506107963121f82dd0fa421b403 Mon Sep 17 00:00:00 2001 From: stevejaker Date: Tue, 10 Mar 2026 15:09:41 -0600 Subject: [PATCH] fix: use empty string instead of "null" for None tool content When a tool message has content: None, using the literal string "null" could confuse the model into thinking the tool returned that word. Empty string is a safer sentinel for "no content". Co-Authored-By: Claude Opus 4.6 --- litellm/llms/snowflake/chat/transformation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/llms/snowflake/chat/transformation.py b/litellm/llms/snowflake/chat/transformation.py index 95e88f43abc..0e19f45bfa7 100644 --- a/litellm/llms/snowflake/chat/transformation.py +++ b/litellm/llms/snowflake/chat/transformation.py @@ -338,7 +338,7 @@ class SnowflakeConfig(SnowflakeBaseConfig, OpenAIGPTConfig): # Get content - could be string, list, or None content = tool_msg.get("content") if content is None: - content = "null" + content = "" elif isinstance(content, list): # Flatten OpenAI multipart tool content to a plain string. # Filter out empty strings from non-text parts (e.g., images).