Skip to content

Commit f12b903

Browse files
committed
update readme
1 parent 3e55151 commit f12b903

File tree

1 file changed

+39
-21
lines changed

1 file changed

+39
-21
lines changed

agent/README.md

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,47 @@
11
# Agent for Commit0
2-
`agent config [OPTIONS] AGENT_NAME`: Setup the config you want agent to run with
3-
`agent run [OPTIONS] BRANCH`: running agent on specific branch
2+
This tool provides a command-line interface for configuring and running AI agents to assist with code development and testing.
43

5-
You can also run the following command to know more information
4+
## Quick Start
5+
Configure an agent:
6+
```bash
7+
agent config [OPTIONS] AGENT_NAME
8+
```
9+
10+
Run an agent on a specific branch:
11+
```bash
12+
agent run [OPTIONS] BRANCH
13+
```
14+
15+
For more detailed information on available commands and options:
616
```bash
717
agent -h
818
agent config -h
919
agent run -h
1020
```
11-
## Configure Agent
12-
Here are all configs you can choose when you run `agent config [OPTIONS] AGENT_NAME`
21+
## Configure an Agent
22+
Use `agent config [OPTIONS] AGENT_NAME` to set up the configuration for an agent.
23+
Available options include:
1324

1425
`--agent_name: str`: Agent to use, we only support [aider](https://aider.chat/) for now. [Default: `aider`]
15-
`--model-name: str`: Model to use, check [here](https://aider.chat/docs/llms.html) for more information. [Default: `claude-3-5-sonnet-20240620`]
16-
`--use-user-prompt: bool`: Use the user prompt instead of the default prompt. [Default: `False`]
17-
`--user-prompt: str`: The prompt sent to agent. [Default: Refer to code.]
18-
`--run-tests: bool`: Run the tests after the agent modified the code to get feedback. [Default `False`]
19-
`--max-iteration: int`: Maximum number of iterations for agent to run. [Default: `3`]
20-
`--use-repo-info: bool`: Use the repository information. [Default: `False`]
26+
`--model-name: str`: LLM model to use, check [here](https://aider.chat/docs/llms.html) for all supported models. [Default: `claude-3-5-sonnet-20240620`]
27+
`--use-user-prompt: bool`: Use a custom prompt instead of the default prompt. [Default: `False`]
28+
`--user-prompt: str`: The prompt sent to agent. [Default: See code for details.]
29+
`--run-tests: bool`: Run tests after code modifications for feedback. You need to set up `docker` or `modal` before running tests, refer to commit0 docs. [Default `False`]
30+
`--max-iteration: int`: Maximum number of agent iterations. [Default: `3`]
31+
`--use-repo-info: bool`: Include the repository information. [Default: `False`]
2132
`--max-repo-info-length: int`: Maximum length of the repository information to use. [Default: `10000`]
22-
`--use-unit-tests-info: bool`: Use the unit tests information. [Default: `False`]
33+
`--use-unit-tests-info: bool`: Include the unit tests information. [Default: `False`]
2334
`--max-unit-tests-info-length: int`: Maximum length of the unit tests information to use. [Default: `10000`]
24-
`--use-spec-info: bool`: Use the spec information. [Default: `False`]
35+
`--use-spec-info: bool`: Include the spec information. [Default: `False`]
2536
`--max-spec-info-length: int`: Maximum length of the spec information to use. [Default: `10000`]
26-
`--use-lint-info: bool`: Use the lint information. [Default: `False`]
37+
`--use-lint-info: bool`: Include the lint information. [Default: `False`]
2738
`--max-lint-info-length: int`: Maximum length of the lint information to use. [Default: `10000`]
28-
`--pre-commit-config-path: str`: Path to the pre-commit config file. [Default: `.pre-commit-config.yaml`]
39+
`--pre-commit-config-path: str`: Path to the pre-commit config file. This is needed for running `lint`. [Default: `.pre-commit-config.yaml`]
2940
`--agent-config-file: str`: Path to write the agent config. [Default: `.agent.yaml`]
3041

3142
## Running Agent
32-
Here are all configs you can choose when you run `agent run [OPTIONS] BRANCH`
43+
Use `agent run [OPTIONS] BRANCH` to execute an agent on a specific branch.
44+
Available options include:
3345

3446
`--branch: str`: Branch to run the agent on, you can specific the name of the branch
3547
`--backend: str`: Test backend to run the agent on, ignore this option if you are not adding `run_tests` option to agent. [Default: `modal`]
@@ -38,18 +50,24 @@ Here are all configs you can choose when you run `agent run [OPTIONS] BRANCH`
3850
`--display-repo-progress-num: int`: Number of repo progress displayed when running. [Default: `5`]
3951

4052

41-
### Agent Example: aider
42-
Step 1: `agent config aider`
43-
Step 2: `agent run aider_branch`
53+
### Example: Running aider
54+
Step 1: Configure aider: `agent config aider`
55+
Step 2: Run aider on a branch: `agent run aider_branch`
4456

4557
### Other Agent:
4658
Refer to `class Agents` in `agent/agents.py`. You can design your own agent by inheriting `Agents` class and implement the `run` method.
4759

4860
## Notes
4961

5062
### Automatically retry
51-
Please refer to [here](https://github.com/paul-gauthier/aider/blob/75e1d519da9b328b0eca8a73ee27278f1289eadb/aider/sendchat.py#L17) for the type fo API error that aider will automatically retry.
63+
Aider automatically retries certain API errors. For details, see [here](https://github.com/paul-gauthier/aider/blob/75e1d519da9b328b0eca8a73ee27278f1289eadb/aider/sendchat.py#L17).
64+
65+
### Parallelize agent running
66+
When increasing --max-parallel-repos, be mindful of aider's [60-second retry timeout](https://github.com/paul-gauthier/aider/blob/75e1d519da9b328b0eca8a73ee27278f1289eadb/aider/sendchat.py#L39). Set this value according to your API tier to avoid RateLimitErrors stopping processes.
5267

5368
### Large files in repo
54-
Currently, agent will skip file with more than 1500 lines.(check `agent/agent_utils.py#L199`)
69+
Currently, agent will skip file with more than 1500 lines. See `agent/agent_utils.py#L199` for details.
70+
71+
### Cost
72+
Running a full `all` commit0 split costs approximately $100.
5573

0 commit comments

Comments
 (0)