Specifying problems
We currently support the following input types:
- A string of text (
TextProblemStatement
) - A path to a file on the local filesystem (
FileProblemStatement
) - A URL to a GitHub issue (
GithubIssue
) - An empty problem statement (
EmptyProblemStatement
)
With sweagent run
, you can specify the problem statement type with the --problem-statement
flag.
For example:
--problem-statement.text="This is a problem statement"
--problem-statement.type=text
--problem-statement.path=path/to/file.txt
--problem-statement.type=text_file
--problem-statement.url=https://github.com/org/repo/issues/123
--problem-statement.type=github_issue
See below for more details on the configuration options.
All of these classes are defined in sweagent.agent.problem_statement
.
problem_statement_from_simplified_input
problem_statement_from_simplified_input(*, input: str, type: Literal['text', 'text_file', 'github_issue', 'swe_bench_multimodal']) -> ProblemStatementConfig
Get a problem statement from an input
string and a type
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input
|
str
|
Url/path/text |
required |
type
|
Literal['text', 'text_file', 'github_issue', 'swe_bench_multimodal']
|
The type of problem statement |
required |
Source code in sweagent/agent/problem_statement.py
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
|
TextProblemStatement
pydantic-model
Config:
extra
:forbid
Fields:
-
text
(str
) -
extra_fields
(dict[str, Any]
) -
type
(Literal['text']
) -
id
(str
)
text
pydantic-field
text: str
extra_fields
pydantic-field
extra_fields: dict[str, Any]
Any additional data to be added to the instance. This data will be available when formatting prompt templates.
type
pydantic-field
type: Literal['text'] = 'text'
Discriminator for (de)serialization/CLI. Do not change.
id
pydantic-field
id: str = None
get_problem_statement
get_problem_statement() -> str
Source code in sweagent/agent/problem_statement.py
88 89 |
|
get_extra_fields
get_extra_fields() -> dict[str, Any]
Source code in sweagent/agent/problem_statement.py
91 92 |
|
FileProblemStatement
pydantic-model
Config:
extra
:forbid
Fields:
-
path
(Path
) -
extra_fields
(dict[str, Any]
) -
type
(Literal['text_file']
) -
id
(str
)
path
pydantic-field
path: Path
extra_fields
pydantic-field
extra_fields: dict[str, Any]
Any additional data to be added to the instance. This data will be available when formatting prompt templates.
type
pydantic-field
type: Literal['text_file'] = 'text_file'
Discriminator for (de)serialization/CLI. Do not change.
id
pydantic-field
id: str = None
get_problem_statement
get_problem_statement() -> str
Source code in sweagent/agent/problem_statement.py
121 122 |
|
get_extra_fields
get_extra_fields() -> dict[str, Any]
Source code in sweagent/agent/problem_statement.py
124 125 |
|
GithubIssue
pydantic-model
Config:
extra
:forbid
Fields:
-
github_url
(str
) -
extra_fields
(dict[str, Any]
) -
type
(Literal['github']
) -
id
(str
)
github_url
pydantic-field
github_url: str
extra_fields
pydantic-field
extra_fields: dict[str, Any]
Any additional data to be added to the instance. This data will be available when formatting prompt templates.
type
pydantic-field
type: Literal['github'] = 'github'
Discriminator for (de)serialization/CLI. Do not change.
id
pydantic-field
id: str = None
get_problem_statement
get_problem_statement() -> str
Source code in sweagent/agent/problem_statement.py
149 150 151 |
|
get_extra_fields
get_extra_fields() -> dict[str, Any]
Source code in sweagent/agent/problem_statement.py
153 154 |
|
EmptyProblemStatement
pydantic-model
Config:
extra
:forbid
Fields:
id
pydantic-field
id: str
type
pydantic-field
type: Literal['empty'] = 'empty'
Discriminator for (de)serialization/CLI. Do not change.
get_problem_statement
get_problem_statement() -> str
Source code in sweagent/agent/problem_statement.py
64 65 |
|