Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

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

Charles Packer24dcf5c848f4
diff --git a/letta/schemas/message.py b/letta/schemas/message.py
index 5b7cedb7f..2243cc96b 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,
}