Skip to content

Run single

sweagent.run.run_single.RunSingleConfig

Bases: BaseSettings

actions class-attribute instance-attribute

actions: RunSingleActionConfig = Field(default_factory=RunSingleActionConfig)

agent class-attribute instance-attribute

agent: AgentConfig = Field(description='Agent options.')

env class-attribute instance-attribute

env: EnvironmentConfig = Field(default_factory=EnvironmentConfig, description='Environment options.')

env_var_path class-attribute instance-attribute

env_var_path: Path | None = None

Path to a .env file to load environment variables from.

output_dir class-attribute instance-attribute

output_dir: Path = Field(default=Path('DEFAULT'), description='Output directory.')

problem_statement class-attribute instance-attribute

problem_statement: ProblemStatementConfig = Field(default_factory=EmptyProblemStatement, description='Problem statement options.')

set_default_output_dir

set_default_output_dir() -> None
Source code in sweagent/run/run_single.py
81
82
83
84
85
86
87
88
89
90
91
def set_default_output_dir(self) -> None:
    # Needs to be called explicitly, because self._config_files will be setup
    # post-init.
    if self.output_dir == Path("DEFAULT"):
        user_id = getpass.getuser()
        problem_id = self.problem_statement.id
        model_id = self.agent.model.id
        config_file = getattr(self, "_config_files", ["no_config"])[0]
        if isinstance(config_file, Path):
            config_file = config_file.stem
        self.output_dir = Path.cwd() / "trajectories" / user_id / f"{config_file}__{model_id}___{problem_id}"

sweagent.run.run_single.RunSingleActionConfig pydantic-model

Bases: BaseModel

Run real-life actions (opening PRs, etc.) if we can solve the issue.

Fields:

apply_patch_locally pydantic-field

apply_patch_locally: bool = False

open_pr pydantic-field

open_pr: bool = False

pr_config pydantic-field

pr_config: OpenPRConfig