Local configuration file
By uploading a local .pr_agent.toml
file to the root of the repo’s main branch, you can edit and customize any configuration parameter. Note that you need to upload .pr_agent.toml
prior to creating a PR, in order for the configuration to take effect.
For example, if you set in .pr_agent.toml
:
[pr_reviewer]
extra_instructions="""\
- instruction a
- instruction b
...
"""
Then you can give a list of extra instructions to the review
tool.
Extra instructions
All Code Review Agent tools have a parameter called extra_instructions
, that enables to add free-text extra instructions. Example usage:
/update_changelog --pr_update_changelog.extra_instructions="Make sure to update also the version ..."
Working with large PRs
TODO
Changing a model
TODO
Patch Extra Lines
By default, around any change in your PR, git patch provides three lines of context above and below the change.
@@ -12,5 +12,5 @@ def func1():
code line that already existed in the file...
code line that already existed in the file...
code line that already existed in the file....
-code line that was removed in the PR
+new code line added in the PR
code line that already existed in the file...
code line that already existed in the file...
code line that already existed in the file...
For the review
, describe
, ask
and add_docs
tools, if the token budget allows, Code Review Agent tries to increase the number of lines of context, via the parameter:
[config]
patch_extra_lines=3
Increasing this number provides more context to the model, but will also increase the token budget. Code Review Agent automatically sets this number to 0, using the original git patch.
Editing the prompts
The prompts for the various Code Review Agent tools are defined in the pr_agent/settings
folder.
In practice, the prompts are loaded and stored as a standard setting object.
Hence, editing them is similar to editing any other configuration value - just place the relevant key in .pr_agent.toml
file, and override the default value.
For example, if you want to edit the prompts of the describe tool, you can add the following to your .pr_agent.toml
file:
[pr_description_prompt]
system="""
...
"""
user="""
...
"""
Note that the new prompt will need to generate an output compatible with the relevant post-process function.