Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

Use legacy API for claude-2.1

Kilian Lieretf80ff0186d85
diff --git a/sweagent/agent/models.py b/sweagent/agent/models.py
index cc3100ed..8aa66c61 100644
--- a/sweagent/agent/models.py
+++ b/sweagent/agent/models.py
@@ -488,7 +488,7 @@ def anthropic_query(model: Union[AnthropicModel, BedrockModel], history: list[di
Query the Anthropic API with the given `history` and return the response.
"""
# Preserve behavior for older models
- if model.api_model in ["claude-instant", "claude-2.0"] or \
+ if model.api_model in ["claude-instant", "claude-2.0", "claude-2.1"] or \
(isinstance(model, BedrockModel) and model.api_model in ["anthropic.claude-instant-v1", "anthropic.claude-v2"]):
# Perform Anthropic API call
prompt = anthropic_history_to_messages(model, history)