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]
Fix GenericAPIModelConfig.id's property to avoid casting errors on valid None types (#1199)
carlos3f8944e7dc72
diff --git a/sweagent/agent/models.py b/sweagent/agent/models.pyindex b8cb07c4..598e6b86 100644--- a/sweagent/agent/models.py+++ b/sweagent/agent/models.py@@ -185,7 +185,14 @@ class GenericAPIModelConfig(PydanticBaseModel):@propertydef id(self) -> str:- return f"{self.name}__t-{self.temperature:.2f}__p-{self.top_p:.2f}__c-{self.per_instance_cost_limit:.2f}"+ name = self.name.replace("/", "--")+ if self.top_p is not None:+ top_p = f"{self.top_p:.2f}"+ else:+ top_p = "None"+ temperature = f"{self.temperature:.2f}"+ per_instance_cost_limit = f"{self.per_instance_cost_limit:.2f}"+ return f"{name}__t-{temperature}__p-{top_p}__c-{per_instance_cost_limit}"class ReplayModelConfig(GenericAPIModelConfig):