From d2f5bb676f66c748504cd6bcf9d8d430802cd215 Mon Sep 17 00:00:00 2001 From: Charles Packer Date: Sun, 6 Jul 2025 15:24:45 -0700 Subject: [PATCH] fix: patch bug will `None` content when assistant messages have no tool calls (#3172) --- letta/schemas/message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/letta/schemas/message.py b/letta/schemas/message.py index 5b7cedb7..2243cc96 100644 --- a/letta/schemas/message.py +++ b/letta/schemas/message.py @@ -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, }