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']) -> 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']
|
The type of problem statement |
required |
Source code in sweagent/agent/problem_statement.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
|
TextProblemStatement
pydantic-model
Config:
extra
:'forbid'
Fields:
-
text
(str
) -
extra_fields
(dict[str, Any]
) -
type
(Literal['text']
) -
id
(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.
id
pydantic-field
id: str = None
text
pydantic-field
text: str
type
pydantic-field
type: Literal['text'] = 'text'
Discriminator for (de)serialization/CLI. Do not change.
get_extra_fields
get_extra_fields() -> dict[str, Any]
Source code in sweagent/agent/problem_statement.py
62 63 |
|
get_problem_statement
get_problem_statement() -> str
Source code in sweagent/agent/problem_statement.py
59 60 |
|
FileProblemStatement
pydantic-model
Config:
extra
:'forbid'
Fields:
-
path
(Path
) -
extra_fields
(dict[str, Any]
) -
type
(Literal['text_file']
) -
id
(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.
id
pydantic-field
id: str = None
path
pydantic-field
path: Path
type
pydantic-field
type: Literal['text_file'] = 'text_file'
Discriminator for (de)serialization/CLI. Do not change.
get_extra_fields
get_extra_fields() -> dict[str, Any]
Source code in sweagent/agent/problem_statement.py
95 96 |
|
get_problem_statement
get_problem_statement() -> str
Source code in sweagent/agent/problem_statement.py
92 93 |
|
GithubIssue
pydantic-model
Config:
extra
:'forbid'
Fields:
-
github_url
(str
) -
extra_fields
(dict[str, Any]
) -
type
(Literal['github']
) -
id
(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.
github_url
pydantic-field
github_url: str
id
pydantic-field
id: str = None
type
pydantic-field
type: Literal['github'] = 'github'
Discriminator for (de)serialization/CLI. Do not change.
get_extra_fields
get_extra_fields() -> dict[str, Any]
Source code in sweagent/agent/problem_statement.py
124 125 |
|
get_problem_statement
get_problem_statement() -> str
Source code in sweagent/agent/problem_statement.py
120 121 122 |
|
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_extra_fields
get_extra_fields() -> dict[str, Any]
Source code in sweagent/agent/problem_statement.py
35 36 |
|
get_problem_statement
get_problem_statement() -> str
Source code in sweagent/agent/problem_statement.py
32 33 |
|