fix: patch bug will None content when assistant messages have no tool calls (#3172)

This commit is contained in:
Charles Packer
2025-07-06 15:24:45 -07:00
committed by GitHub
parent bbcc948213
commit d2f5bb676f

View File

@@ -698,7 +698,7 @@ class Message(BaseMessage):
elif self.role == "assistant":
assert self.tool_calls is not None or text_content is not None
openai_message = {
"content": None if put_inner_thoughts_in_kwargs else text_content,
"content": None if (put_inner_thoughts_in_kwargs and self.tool_calls is not None) else text_content,
"role": self.role,
}