Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
band aid, error instead of send to anthropic [LET-5478] (#5396)
Ari Webb8ab2cf258c45
diff --git a/letta/schemas/message.py b/letta/schemas/message.pyindex 7be48d0ac..051040e62 100644--- a/letta/schemas/message.py+++ b/letta/schemas/message.py@@ -1490,6 +1490,8 @@ class Message(BaseMessage):# NOTE: Anthropic uses role "user" for "tool" responsescontent = []for tool_return in self.tool_returns:+ if not tool_return.tool_call_id:+ raise TypeError("Anthropic API requires tool_use_id to be set.")content.append({"type": "tool_result",@@ -1503,6 +1505,8 @@ class Message(BaseMessage):"content": content,}else:+ if not self.tool_call_id:+ raise TypeError("Anthropic API requires tool_use_id to be set.")# This is for legacy reasonsanthropic_message = {"role": "user", # NOTE: diff