mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-11 22:51:28 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
parent
5b61b54431
commit
464a5a128e
1 changed files with 1 additions and 1 deletions
|
|
@ -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).
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue