From 06d030637c32f649774173ed0bf2fedcb50d53c5 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Mon, 6 Nov 2023 09:32:46 +0200 Subject: [PATCH 1/5] fix prompt --- pr_agent/settings/pr_description_prompts.toml | 7 ++++--- pr_agent/tools/pr_description.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pr_agent/settings/pr_description_prompts.toml b/pr_agent/settings/pr_description_prompts.toml index 3d9c3f0b..29a6e095 100644 --- a/pr_agent/settings/pr_description_prompts.toml +++ b/pr_agent/settings/pr_description_prompts.toml @@ -1,9 +1,10 @@ [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 the PR content. -- Make sure not to focus the new PR code (the '+' lines). +Your task is to provide full description of the Pull Request (PR) content. +- Make sure to focus the new PR code (the '+' lines). - Notice that the 'Previous title', 'Previous description' and 'Commit messages' sections may be partial, simplistic, non-informative or not up-to-date. Hence, compare them to the PR diff code, and use them only as a reference. -- If needed, each YAML output should be in block scalar format ('|-') +- Emphasize first the most important changes, and then the less important ones. +- If needed, each YAML output should be in block scalar format ('|-') {%- if extra_instructions %} Extra instructions from the user: diff --git a/pr_agent/tools/pr_description.py b/pr_agent/tools/pr_description.py index 4f0081fb..d7967e80 100644 --- a/pr_agent/tools/pr_description.py +++ b/pr_agent/tools/pr_description.py @@ -162,7 +162,7 @@ class PRDescription: def _prepare_data(self): # Load the AI prediction data into a dictionary - self.data = load_yaml(self.prediction.strip()) + self.data = load_yaml(self.prediction.strip('\n').strip('` ')) if get_settings().pr_description.add_original_user_description and self.user_description: self.data["User Description"] = self.user_description From 5d2bdadb4515bbb493f8d82c560133cc3cee79f2 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Mon, 6 Nov 2023 09:33:10 +0200 Subject: [PATCH 2/5] fix prompt --- pr_agent/settings/pr_description_prompts.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pr_agent/settings/pr_description_prompts.toml b/pr_agent/settings/pr_description_prompts.toml index 29a6e095..44a36c65 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 the Pull Request (PR) content. +Your task is to provide full description of a Pull Request (PR) content. - Make sure to focus the new PR code (the '+' lines). - Notice that the 'Previous title', 'Previous description' and 'Commit messages' sections may be partial, simplistic, non-informative or not up-to-date. Hence, compare them to the PR diff code, and use them only as a reference. - Emphasize first the most important changes, and then the less important ones. From 62412f8cd471b5da3e30f5c72397d7a02fd81b99 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Mon, 6 Nov 2023 09:38:39 +0200 Subject: [PATCH 3/5] fix prompt --- pr_agent/settings/pr_description_prompts.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pr_agent/settings/pr_description_prompts.toml b/pr_agent/settings/pr_description_prompts.toml index 44a36c65..36a6f0db 100644 --- a/pr_agent/settings/pr_description_prompts.toml +++ b/pr_agent/settings/pr_description_prompts.toml @@ -1,7 +1,7 @@ [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. -- Make sure to focus the new PR code (the '+' lines). +- Make sure to focus on the new PR code (the '+' lines). - Notice that the 'Previous title', 'Previous description' and 'Commit messages' sections may be partial, simplistic, non-informative or not up-to-date. Hence, compare them to the PR diff code, and use them only as a reference. - Emphasize first the most important changes, and then the less important ones. - If needed, each YAML output should be in block scalar format ('|-') From 7238c81f0ceafab41e7f1293d5d4b25b7433f69f Mon Sep 17 00:00:00 2001 From: mrT23 Date: Mon, 6 Nov 2023 09:41:26 +0200 Subject: [PATCH 4/5] fix prompt --- pr_agent/settings/pr_description_prompts.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pr_agent/settings/pr_description_prompts.toml b/pr_agent/settings/pr_description_prompts.toml index 36a6f0db..6a50efac 100644 --- a/pr_agent/settings/pr_description_prompts.toml +++ b/pr_agent/settings/pr_description_prompts.toml @@ -52,6 +52,7 @@ PR Main Files Walkthrough: changes in file: type: string description: minimal and concise description of the changes in the relevant file +``` Example output: From 6d6d8644176c7b1d31715565432708c7d4326ac9 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Mon, 6 Nov 2023 09:44:59 +0200 Subject: [PATCH 5/5] fix prompt --- pr_agent/tools/pr_description.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pr_agent/tools/pr_description.py b/pr_agent/tools/pr_description.py index d7967e80..4f0081fb 100644 --- a/pr_agent/tools/pr_description.py +++ b/pr_agent/tools/pr_description.py @@ -162,7 +162,7 @@ class PRDescription: def _prepare_data(self): # Load the AI prediction data into a dictionary - self.data = load_yaml(self.prediction.strip('\n').strip('` ')) + self.data = load_yaml(self.prediction.strip()) if get_settings().pr_description.add_original_user_description and self.user_description: self.data["User Description"] = self.user_description