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 in Anthropic code path (#1395)

Charles Packer3e04afa62b6a
diff --git a/letta/llm_api/anthropic.py b/letta/llm_api/anthropic.py
index 2d47a8176..fd8d11953 100644
--- a/letta/llm_api/anthropic.py
+++ b/letta/llm_api/anthropic.py
@@ -743,6 +743,8 @@ def anthropic_chat_completions_request(
anthropic_client = anthropic.Anthropic(api_key=anthropic_override_key)
elif model_settings.anthropic_api_key:
anthropic_client = anthropic.Anthropic()
+ else:
+ raise ValueError("No available Anthropic API key")
data = _prepare_anthropic_request(
data=data,
inner_thoughts_xml_tag=inner_thoughts_xml_tag,
diff --git a/tests/test_agent_serialization.py b/tests/test_agent_serialization.py
index 6d8c25c97..14a4bb35e 100644
--- a/tests/test_agent_serialization.py
+++ b/tests/test_agent_serialization.py
@@ -351,9 +351,9 @@ def test_append_copy_suffix_simple(local_client, server, serialize_test_agent, d
"""Test deserializing JSON into an Agent instance."""
result = server.agent_manager.serialize(agent_id=serialize_test_agent.id, actor=default_user)
- # write file
+ # write file
with open("test_agent_serialization.json", "w") as f:
- # write json
+ # write json
f.write(json.dumps(result.model_dump(), indent=4))
# Deserialize the agent