fix: patch bug in Anthropic code path (#1395)

This commit is contained in:
Charles Packer
2025-03-25 07:55:59 -07:00
committed by GitHub
parent bd4a23a1f9
commit 1dee1dca22
2 changed files with 4 additions and 2 deletions

View File

@@ -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,

View File

@@ -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