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]
Rename for clarity arg_type -> config_type
Kilian Lieretdd935cdadcf7
diff --git a/sweagent/run/batch_instances.py b/sweagent/run/batch_instances.pyindex 9c324dc2..50239851 100644--- a/sweagent/run/batch_instances.py+++ b/sweagent/run/batch_instances.py@@ -208,7 +208,6 @@ class InstancesFromHuggingFace(BaseModel, AbstractInstanceSource):deployment: DeploymentConfig = Field(default_factory=lambda: DockerDeploymentConfig(image="python:3.11"),- description="Deployment options.",)"""Deployment configuration. Note that the image_name option is overwritten by the images specified in the task instances."""@@ -237,7 +236,6 @@ class SWEBenchInstances(BaseModel, AbstractInstanceSource):deployment: DeploymentConfig = Field(default_factory=lambda: DockerDeploymentConfig(image="python:3.11"),- description="Deployment options.",)"""Deployment configuration. Note that the image_name option is overwritten by the images specified in the task instances."""diff --git a/sweagent/run/common.py b/sweagent/run/common.pyindex f27c7483..b35e77cd 100644--- a/sweagent/run/common.py+++ b/sweagent/run/common.py@@ -66,19 +66,19 @@ _SETTING_ERROR_HINTS = """# todo: Parameterize type hintsclass BasicCLI:- def __init__(self, arg_type: type[BaseSettings], *, default_settings: bool = True, help_text: str | None = None):+ def __init__(self, config_type: type[BaseSettings], *, default_settings: bool = True, help_text: str | None = None):"""This class implements a basic CLI for SWE-agent. It is based on pydantic-settings, i.e., takesa `BaseSettings` object. In principle you could just initialize these via `pydantic-settings`'s `CliApp.run`,however, we also want to add a `--config` option to load additional config files and some other things.We also try to improve a bit on the pydantic error messages in here.Args:- arg_type: The type of the configuration object to instantiate.+ config_type: The type of the configuration object to instantiate.default_settings: Whether to load the default settings.help_text: If given, this will override the default help text that would usually be shownby argparse."""- self.arg_type = arg_type+ self.arg_type = config_typeself.default_settings = default_settingsself.logger = get_logger("swea-cli", emoji="🔧")self.help_text = help_text