From 428e6382bd8ab88d0766e5a28cbee0b56052f1a9 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Thu, 5 Oct 2023 08:17:37 +0300 Subject: [PATCH] prompts minor update --- pr_agent/settings/pr_add_docs.toml | 2 ++ pr_agent/settings/pr_code_suggestions_prompts.toml | 13 +++++++------ pr_agent/settings/pr_description_prompts.toml | 2 ++ pr_agent/settings/pr_reviewer_prompts.toml | 7 +++++-- pr_agent/settings/pr_update_changelog_prompts.toml | 2 ++ 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/pr_agent/settings/pr_add_docs.toml b/pr_agent/settings/pr_add_docs.toml index b552ec86..31b7195c 100644 --- a/pr_agent/settings/pr_add_docs.toml +++ b/pr_agent/settings/pr_add_docs.toml @@ -42,7 +42,9 @@ Specific instructions: {%- if extra_instructions %} Extra instructions from the user: +' {{ extra_instructions }} +' {%- endif %} You must use the following YAML schema to format your answer: diff --git a/pr_agent/settings/pr_code_suggestions_prompts.toml b/pr_agent/settings/pr_code_suggestions_prompts.toml index 68083945..a3eb93a1 100644 --- a/pr_agent/settings/pr_code_suggestions_prompts.toml +++ b/pr_agent/settings/pr_code_suggestions_prompts.toml @@ -1,6 +1,6 @@ [pr_code_suggestions_prompt] system="""You are a language model called PR-Code-Reviewer, that specializes in suggesting code improvements for Pull Request (PR). -Your task is to provide meaningful and actionable code suggestions, to improve the new code presented in a PR. +Your task is to provide meaningful and actionable code suggestions, to improve the new code presented in a PR (the '+' lines in the diff). Example for a PR Diff input: ' @@ -31,14 +31,13 @@ __old hunk__ ' Specific instructions: -- Provide up to {{ num_code_suggestions }} code suggestions. +- Provide up to {{ num_code_suggestions }} code suggestions. Try to provide diverse and insightful suggestions. - Prioritize suggestions that address major problems, issues and bugs in the code. As a second priority, suggestions should focus on best practices, code readability, maintainability, enhancments, performance, and other aspects. - Don't suggest to add docstring, type hints, or comments. - Try to provide diverse and insightful suggestions. +- Don't suggest to add docstring, type hints, or comments. - Suggestions should refer only to code from the '__new hunk__' sections, and focus on new lines of code (lines starting with '+'). - Avoid making suggestions that have already been implemented in the PR code. For example, if you want to add logs, or change a variable to const, or anything else, make sure it isn't already in the '__new hunk__' code. - For each suggestion, make sure to take into consideration also the context, meaning the lines before and after the relevant code. +- Avoid making suggestions that have already been implemented in the PR code. For example, if you want to add logs, or change a variable to const, or anything else, make sure it isn't already in the '__new hunk__' code. +- For each suggestion, make sure to take into consideration also the context, meaning the lines before and after the relevant code. - Provide the exact line numbers range (inclusive) for each issue. - Assume there is additional relevant code, that is not included in the diff. @@ -46,7 +45,9 @@ Specific instructions: {%- if extra_instructions %} Extra instructions from the user: +' {{ extra_instructions }} +' {%- endif %} You must use the following YAML schema to format your answer: diff --git a/pr_agent/settings/pr_description_prompts.toml b/pr_agent/settings/pr_description_prompts.toml index 43dd8e3b..c2c8e654 100644 --- a/pr_agent/settings/pr_description_prompts.toml +++ b/pr_agent/settings/pr_description_prompts.toml @@ -7,7 +7,9 @@ Your task is to provide full description of the PR content. {%- if extra_instructions %} Extra instructions from the user: +' {{ extra_instructions }} +' {% endif %} You must use the following YAML schema to format your answer: diff --git a/pr_agent/settings/pr_reviewer_prompts.toml b/pr_agent/settings/pr_reviewer_prompts.toml index c0599e50..657027af 100644 --- a/pr_agent/settings/pr_reviewer_prompts.toml +++ b/pr_agent/settings/pr_reviewer_prompts.toml @@ -35,7 +35,9 @@ The review should focus on new code added in the PR (lines starting with '+'), a {%- if extra_instructions %} Extra instructions from the user: +' {{ extra_instructions }} +' {% endif %} You must use the following YAML schema to format your answer: @@ -129,8 +131,7 @@ PR Feedback: Security concerns: type: string description: >- - yes\\no question: does this PR code introduce possible security concerns or - issues, like SQL injection, XSS, CSRF, and others ? If answered 'yes',explain your answer shortly + yes\\no question: does this PR code introduce possible vulnerabilities such as exposure of sensitive information (e.g., API keys, secrets, passwords), or security concerns like SQL injection, XSS, CSRF, and others ? If answered 'yes', explain your answer briefly. {%- endif %} ``` @@ -196,7 +197,9 @@ Here are questions to better understand the PR. Use the answers to provide bette {{question_str|trim}} User answers: +' {{answer_str|trim}} +' ###### {%- endif %} diff --git a/pr_agent/settings/pr_update_changelog_prompts.toml b/pr_agent/settings/pr_update_changelog_prompts.toml index 78b6a0b5..e9133e34 100644 --- a/pr_agent/settings/pr_update_changelog_prompts.toml +++ b/pr_agent/settings/pr_update_changelog_prompts.toml @@ -8,7 +8,9 @@ Your task is to update the CHANGELOG.md file of the project, to shortly summariz {%- if extra_instructions %} Extra instructions from the user: +' {{ extra_instructions }} +' {%- endif %} """