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]
Enh: Support sonnet 4 (#1150)
Kilian Lieret522b6a5b0f36
diff --git a/sweagent/agent/models.py b/sweagent/agent/models.pyindex bb6e6720..4e799d81 100644--- a/sweagent/agent/models.py+++ b/sweagent/agent/models.py@@ -582,7 +582,7 @@ class LiteLLMModel(AbstractModel):self.model_max_output_tokens = litellm.model_cost.get(self.config.name, {}).get("max_output_tokens")# Special handling for Claude 3.7 models to set 64k context by default when beta header not present# See https://github.com/SWE-agent/SWE-agent/pull/1016- is_claude_3_7 = "claude-3-7-sonnet" in self.config.name+ is_claude_3_7 = "claude-3-7-sonnet" in self.config.name or "claude-sonnet-4" in self.config.namehas_128k_beta_header = (self.config.completion_kwargs.get("extra_headers", {}).get("anthropic-beta") == "output-128k-2025-02-19")