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: drop name param for anthropic messages (#982)

cthomas55868eb41e8c
diff --git a/letta/schemas/message.py b/letta/schemas/message.py
index 722a749b1..f86e7c153 100644
--- a/letta/schemas/message.py
+++ b/letta/schemas/message.py
@@ -570,19 +570,12 @@ class Message(BaseMessage):
"role": "user",
}
- # Optional field, do not include if null
- if self.name is not None:
- anthropic_message["name"] = self.name
-
elif self.role == "user":
assert all([v is not None for v in [self.text, self.role]]), vars(self)
anthropic_message = {
"content": self.text,
"role": self.role,
}
- # Optional field, do not include if null
- if self.name is not None:
- anthropic_message["name"] = self.name
elif self.role == "assistant":
assert self.tool_calls is not None or self.text is not None
@@ -624,10 +617,6 @@ class Message(BaseMessage):
# TODO support multi-modal
anthropic_message["content"] = content
- # Optional fields, do not include if null
- if self.name is not None:
- anthropic_message["name"] = self.name
-
elif self.role == "tool":
# NOTE: Anthropic uses role "user" for "tool" responses
assert all([v is not None for v in [self.role, self.tool_call_id]]), vars(self)