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]
Doc: Improving reference docs
Kilian Lieret3f1266e00245
diff --git a/docs/reference/agent_config.md b/docs/reference/agent_config.mdindex 71902da3..35ac6a35 100644--- a/docs/reference/agent_config.md+++ b/docs/reference/agent_config.md@@ -3,6 +3,16 @@This page documents the configuration objects used to specify the behavior of an agent.To learn about the agent class itself, see the [agent class reference page](agent.md).+It might be easiest to simply look at some of our example configurations in the [config dir](https://github.com/princeton-nlp/SWE-agent/tree/main/config).++<details>+<summary>Example: default config <code>default.yaml</code></summary>++```yaml+--8<-- "config/default_from_url.yaml"+```+</details>+::: sweagent.agent.agents.AgentConfig::: sweagent.agent.agents.TemplateConfig\ No newline at end of filediff --git a/docs/reference/problem_statements.md b/docs/reference/problem_statements.mdindex 6ad90898..8d0a4aed 100644--- a/docs/reference/problem_statements.md+++ b/docs/reference/problem_statements.md@@ -1,11 +1,57 @@# 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:++```bash title="From text"+--problem-statement.text="This is a problem statement"+--problem-statement.type=text+```++```bash title="From a file"+--problem-statement.path=path/to/file.txt+--problem-statement.type=text_file+```++```bash title="From a GitHub issue"+--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.environment.config.problem_statement`.++::: sweagent.environment.config.problem_statement.problem_statement_from_simplified_input+ options:+ show_root_full_path: false+ show_bases: false+::: sweagent.environment.config.problem_statement.TextProblemStatement+ options:+ show_root_full_path: false+ show_bases: false+::: sweagent.environment.config.problem_statement.FileProblemStatement+ options:+ show_root_full_path: false+ show_bases: false::: sweagent.environment.config.problem_statement.GithubIssue+ options:+ show_root_full_path: false+ show_bases: false::: sweagent.environment.config.problem_statement.EmptyProblemStatement--::: sweagent.environment.config.problem_statement.problem_statement_from_simplified_input\ No newline at end of file+ options:+ show_root_full_path: false+ show_bases: falsediff --git a/docs/reference/repo.md b/docs/reference/repo.mdindex 3b3a9efa..a6572088 100644--- a/docs/reference/repo.md+++ b/docs/reference/repo.md@@ -1,9 +1,44 @@# Configuring repositories+We currently support the following repository types:++* A pre-existing repository (`PreExistingRepo`)+* A local repository (`LocalRepoConfig`)+* A GitHub repository (`GithubRepoConfig`)++With `sweagent run`, you can specify the repository type with the `--env.repo` flag.+For example:++```bash title="From a pre-existing repository"+--env.repo.repo_name="testbed" # (1)!+--env.repo.type=preexisting+```++1. Folder name at the root of the deployment++```bash title="From a local repository"+--env.repo.path=/path/to/repo+--env.repo.type=local+```++All of these classes are defined in `sweagent.environment.config.repo`.+::: sweagent.environment.config.repo.PreExistingRepo+ options:+ show_root_full_path: false+ show_bases: false::: sweagent.environment.config.repo.LocalRepoConfig+ options:+ show_root_full_path: false+ show_bases: false::: sweagent.environment.config.repo.GithubRepoConfig+ options:+ show_root_full_path: false+ show_bases: false-::: sweagent.environment.config.repo.repo_from_simplified_input\ No newline at end of file+::: sweagent.environment.config.repo.repo_from_simplified_input+ options:+ show_root_full_path: false+ show_bases: falsediff --git a/sweagent/environment/config/problem_statement.py b/sweagent/environment/config/problem_statement.pyindex 74c0a17c..9c49ff05 100644--- a/sweagent/environment/config/problem_statement.py+++ b/sweagent/environment/config/problem_statement.py@@ -102,7 +102,7 @@ ProblemStatementConfig = TextProblemStatement | GithubIssue | EmptyProblemStatemdef problem_statement_from_simplified_input(*, input: str, type: Literal["text", "text_file", "github_issue"]) -> ProblemStatementConfig:- """Get a problem statement from a simplified input.+ """Get a problem statement from an `input` string and a `type`.Args:input: Url/path/text