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: type error in agent step (#6287)

cthomas2ebf86399808
diff --git a/letta/llm_api/anthropic_client.py b/letta/llm_api/anthropic_client.py
index 7861af864..21ec3473d 100644
--- a/letta/llm_api/anthropic_client.py
+++ b/letta/llm_api/anthropic_client.py
@@ -937,10 +937,14 @@ def is_heartbeat(message: dict, is_ping: bool = False) -> bool:
except:
return False
+ # Check if message_json is a dict (not int, str, list, etc.)
+ if not isinstance(message_json, dict):
+ return False
+
if "reason" not in message_json:
return False
- if message_json["type"] != "heartbeat":
+ if message_json.get("type") != "heartbeat":
return False
if not is_ping: