Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
feat: filter nulls for token counter (#5247)
cthomasf023dea1eaf5
diff --git a/letta/schemas/message.py b/letta/schemas/message.pyindex 4c316a5d3..2c1223dfb 100644--- a/letta/schemas/message.py+++ b/letta/schemas/message.py@@ -1442,7 +1442,7 @@ class Message(BaseMessage):native_content: bool = False,strip_request_heartbeat: bool = False,) -> List[dict]:- messages = Message.filter_messages_for_llm_api(messages)+ messages = [m for m in messages if m is not None]result = [m.to_anthropic_dict(current_model=current_model,