mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-05 05:10:38 +08:00
Integrate self-reflection feature in PR-Agent, enhancing code suggestions with scoring and sorting, and update documentation accordingly
This commit is contained in:
@ -40,6 +40,15 @@ CodiumAI PR-Agent aims to help efficiently review and handle pull requests, by p
|
|||||||
|
|
||||||
## News and Updates
|
## News and Updates
|
||||||
|
|
||||||
|
### May 12, 2024
|
||||||
|
Inspired by [AlphaCodium](https://github.com/Codium-ai/AlphaCodium) flow engineering scheme, PR-Agent now performs **self-reflection** on the code suggestions it provides,
|
||||||
|
enabling to remove invalid suggestions, and score the valid ones. The suggestions will be presented sorted by their score, enabling to focus on the most important ones first.
|
||||||
|
|
||||||
|
<kbd><img src="https://codium.ai/images/pr_agent/self_reflection1.png" width="512"></kbd>
|
||||||
|
|
||||||
|
<kbd><img src="https://codium.ai/images/pr_agent/self_reflection2.png" width="512"></kbd>
|
||||||
|
|
||||||
|
|
||||||
### May 2, 2024
|
### May 2, 2024
|
||||||
Check out the new [PR-Agent Chrome Extension](https://chromewebstore.google.com/detail/pr-agent-chrome-extension/ephlnjeghhogofkifjloamocljapahnl) 🚀🚀🚀
|
Check out the new [PR-Agent Chrome Extension](https://chromewebstore.google.com/detail/pr-agent-chrome-extension/ephlnjeghhogofkifjloamocljapahnl) 🚀🚀🚀
|
||||||
|
|
||||||
|
@ -86,6 +86,10 @@ Hence, the total number of suggestions is proportional to the number of chunks,
|
|||||||
<td><b>persistent_comment</b></td>
|
<td><b>persistent_comment</b></td>
|
||||||
<td>If set to true, the improve comment will be persistent, meaning that every new improve request will edit the previous one. Default is false.</td>
|
<td>If set to true, the improve comment will be persistent, meaning that every new improve request will edit the previous one. Default is false.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><b>self_reflect_on_suggestions</b></td>
|
||||||
|
<td>If set to true, the improve tool will calculate an importance score for each suggestion [1-10], and sort the suggestion labels group based on this score. Default is true.</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><b>enable_help_text</b></td>
|
<td><b>enable_help_text</b></td>
|
||||||
<td>If set to true, the tool will display a help text in the comment. Default is true.</td>
|
<td>If set to true, the tool will display a help text in the comment. Default is true.</td>
|
||||||
|
@ -351,7 +351,8 @@ class PRCodeSuggestions:
|
|||||||
if score > 0:
|
if score > 0:
|
||||||
data["code_suggestions"].append(prediction)
|
data["code_suggestions"].append(prediction)
|
||||||
else:
|
else:
|
||||||
get_logger().info(f"Skipping suggestions from call {i + 1}, because score is {score}")
|
get_logger().info(f"Removing suggestions {i}, because score is {score}",
|
||||||
|
artifact={"prediction": prediction})
|
||||||
else:
|
else:
|
||||||
get_logger().error(f"Error getting PR diff, no code suggestions found in call {i + 1}")
|
get_logger().error(f"Error getting PR diff, no code suggestions found in call {i + 1}")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Reference in New Issue
Block a user