forked from qodo-ai/pr-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit '8d075b76ae081d0d38813f789478e4fa0f404cd8' into hl/add_docs
# Conflicts: # README.md
- Loading branch information
Showing
31 changed files
with
244 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# ASK Tool | ||
|
||
The `ask` tool answers questions about the PR, based on the PR code changes. | ||
It can be invoked manually by commenting on any PR: | ||
``` | ||
/ask "..." | ||
``` | ||
For example: | ||
|
||
<kbd><img src=./../pics/ask_comment.png width="768"></kbd> | ||
<kbd><img src=./../pics/ask.png width="768"></kbd> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Describe Tool | ||
|
||
The `describe` tool scans the PR code changes, and automatically generates PR description - title, type, summary, code walkthrough and labels. | ||
It can be invoked manually by commenting on any PR: | ||
``` | ||
/describe | ||
``` | ||
For example: | ||
|
||
<kbd><img src=./../pics/describe_comment.png width="768"></kbd> | ||
|
||
<kbd><img src=./../pics/describe.png width="768"></kbd> | ||
|
||
The `describe` tool can also be triggered automatically every time a new PR is opened. See examples for automatic triggers for [GitHub App](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#github-app-automatic-tools) and [GitHub Action](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#working-with-github-action) | ||
|
||
### Configuration options | ||
|
||
Under the section 'pr_description', the [configuration file](./../pr_agent/settings/configuration.toml#L28) contains options to customize the 'describe' tool: | ||
|
||
- `publish_labels`: if set to true, the tool will publish the labels to the PR. Default is true. | ||
|
||
- `publish_description_as_comment`: if set to true, the tool will publish the description as a comment to the PR. If false, it will overwrite the origianl description. Default is false. | ||
|
||
- `add_original_user_description`: if set to true, the tool will add the original user description to the generated description. Default is false. | ||
|
||
- `add_original_user_title`: if set to true, the tool will keep the original PR title, and won't change it. Default is false. | ||
|
||
- `extra_instructions`: Optional extra instructions to the tool. For example: "focus on the changes in the file X. Ignore change in ...". | ||
|
||
#### Markers template | ||
|
||
markers enable to easily integrate user's content and auto-generated content, with a template-like mechanism. | ||
|
||
- `use_description_markers`: if set to true, the tool will use markers template. It replaces every marker of the form `pr_agent:marker_name` with the relevant content. Default is false. | ||
|
||
For example, if the PR original description was: | ||
``` | ||
User content... | ||
## PR Type: | ||
pr_agent:pr_type | ||
## PR Description: | ||
pr_agent:summary | ||
## PR Walkthrough: | ||
pr_agent:walkthrough | ||
``` | ||
The marker `pr_agent:pr_type` will be replaced with the PR type, `pr_agent:summary` will be replaced with the PR summary, and `pr_agent:walkthrough` will be replaced with the PR walkthrough. | ||
|
||
- `include_generated_by_header`: if set to true, the tool will add a dedicated header: 'Generated by PR Agent at ...' to any automatic content. Default is true. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Improve Tool | ||
|
||
The `improve` tool scans the PR code changes, and automatically generate committable suggestions for improving the PR code. | ||
It can be invoked manually by commenting on any PR: | ||
``` | ||
/improve | ||
``` | ||
For example: | ||
|
||
<kbd><img src=./../pics/improve_comment.png width="768"></kbd> | ||
<kbd><img src=./../pics/improve.png width="768"></kbd> | ||
|
||
The `improve` tool can also be triggered automatically every time a new PR is opened. See examples for automatic triggers for [GitHub App](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#github-app-automatic-tools) and [GitHub Action](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#working-with-github-action) | ||
|
||
An extended mode, which does not involve PR Compression and provides more comprehensive suggestions, can be invoked by commenting on any PR: | ||
``` | ||
/improve --extended | ||
``` | ||
Note that the extended mode divides the PR code changes into chunks, up to the token limits, where each chunk is handled separately (multiple calls to GPT-4). | ||
Hence, the total number of suggestions is proportional to the number of chunks, i.e. the size of the PR. | ||
|
||
### Configuration options | ||
|
||
Under the section 'pr_code_suggestions', the [configuration file](./../pr_agent/settings/configuration.toml#L40) contains options to customize the 'improve' tool: | ||
|
||
- `num_code_suggestions`: number of code suggestions provided by the 'improve' tool. Default is 4. | ||
- `extra_instructions`: Optional extra instructions to the tool. For example: "focus on the changes in the file X. Ignore change in ...". | ||
- `rank_suggestions`: if set to true, the tool will rank the suggestions, based on importance. Default is false. | ||
|
||
#### params for '/improve --extended' mode | ||
- `num_code_suggestions_per_chunk`: number of code suggestions provided by the 'improve' tool, per chunk. Default is 8. | ||
- `rank_extended_suggestions`: if set to true, the tool will rank the suggestions, based on importance. Default is true. | ||
- `max_number_of_calls`: maximum number of chunks. Default is 5. | ||
- `final_clip_factor`: factor to remove suggestions with low confidence. Default is 0.9. |
Oops, something went wrong.