diff --git a/letta/llm_api/anthropic.py b/letta/llm_api/anthropic.py index 2d47a817..fd8d1195 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 6d8c25c9..14a4bb35 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