diff --git a/pr_agent/settings/pr_custom_labels.toml b/pr_agent/settings/pr_custom_labels.toml index dada1518..01efa5a5 100644 --- a/pr_agent/settings/pr_custom_labels.toml +++ b/pr_agent/settings/pr_custom_labels.toml @@ -1,5 +1,5 @@ [pr_custom_labels_prompt] -system="""You are CodiumAI-PR-Reviewer, a language model designed to review git Pull Requests (PR). +system="""You are CodiumAI-PR-Reviewer, a language model designed to review a git Pull Request (PR). Your task is to provide labels that describe the PR content. {%- if enable_custom_labels %} Thoroughly read the labels name and the provided description, and decide whether the label is relevant to the PR. @@ -46,9 +46,13 @@ Answer should be a valid YAML, and nothing else. """ user="""PR Info: + Previous title: '{{title}}' -Previous description: '{{description}}' -Branch: '{{branch}}' + +Branch: '{{ branch }}' + +Description: '{{ description }}' + {%- if language %} Main PR language: '{{ language }}' diff --git a/pr_agent/settings/pr_description_prompts.toml b/pr_agent/settings/pr_description_prompts.toml index 931f92c3..96062ab2 100644 --- a/pr_agent/settings/pr_description_prompts.toml +++ b/pr_agent/settings/pr_description_prompts.toml @@ -1,6 +1,6 @@ [pr_description_prompt] -system="""You are CodiumAI-PR-Reviewer, a language model designed to review git pull requests. -Your task is to provide full description of a Pull Request (PR) content. +system="""You are CodiumAI-PR-Reviewer, a language model designed to review a git Pull Request (PR). +Your task is to provide full description of a Pr content. - Make sure to focus on the new PR code (the '+' lines). - Keep in mind that the 'Previous title', 'Previous description' and 'Commit messages' sections may be partial, simplistic, non-informative or out of date. Hence, compare them to the PR diff code, and use them only as a reference. - Prioritize the most significant changes first, followed by the minor ones. @@ -71,7 +71,10 @@ user="""PR Info: Previous title: '{{title}}' -Previous description: '{{description}}' +{%- if description %} + +Previous description: '{{ description }}' +{%- endif %} Branch: '{{branch}}' {%- if language %} @@ -91,6 +94,8 @@ The PR Git Diff: ``` {{diff}} ``` + + Note that lines in the diff body are prefixed with a symbol that represents the type of change: '-' for deletions, '+' for additions, and ' ' (a space) for unchanged lines. Response (should be a valid YAML, and nothing else): diff --git a/pr_agent/settings/pr_reviewer_prompts.toml b/pr_agent/settings/pr_reviewer_prompts.toml index cece22f9..e8722080 100644 --- a/pr_agent/settings/pr_reviewer_prompts.toml +++ b/pr_agent/settings/pr_reviewer_prompts.toml @@ -215,6 +215,8 @@ The PR Git Diff: ``` {{diff}} ``` + + Note that lines in the diff body are prefixed with a symbol that represents the type of change: '-' for deletions, '+' for additions. Focus on the '+' lines. Response (should be a valid YAML, and nothing else): diff --git a/pr_agent/tools/pr_generate_labels.py b/pr_agent/tools/pr_generate_labels.py index 45c504b3..6ea322a4 100644 --- a/pr_agent/tools/pr_generate_labels.py +++ b/pr_agent/tools/pr_generate_labels.py @@ -147,6 +147,9 @@ class PRGenerateLabels: user=user_prompt ) + if get_settings().config.verbosity_level >= 2: + get_logger().info(f"\nAI response:\n{response}") + return response def _prepare_data(self):