diff --git a/pr_agent/servers/help.py b/pr_agent/servers/help.py index d1ece194..60ba285b 100644 --- a/pr_agent/servers/help.py +++ b/pr_agent/servers/help.py @@ -156,6 +156,7 @@ Note that when markers are enabled, if the original PR description does not cont """ output += "\n\n\n\n" + # custom labels output += "
Custom labels
\n\n" output += """\ The default labels of the `describe` tool are quite generic: [`Bug fix`, `Tests`, `Enhancement`, `Documentation`, `Other`]. @@ -174,6 +175,25 @@ Make sure to provide proper title, and a detailed and well-phrased description f """ output += "\n\n
\n\n" + # extra instructions + output += "
Utilizing extra instructions
\n\n" + output += '''\ + The `describe` tool can be configured with extra instructions, which can be used to guide the model to a produce a description with the relevant content or style. + + Be specific, clear, and concise in the instructions. With extra instructions, you are the prompter. Notice that the general structure of the description is already defined by the tool, and cannot be changed. + What you can change is the content content or style of each sub-section of the description. + + Examples for extra instructions: + ``` + [pr_description] + extra_instructions=""" + - the title section should be in the following format: : + - ... + """ + ``` + Use triple quotes to write multi-line instructions. Use bullet points to make the instructions more readable. + ''' + # general output += "\n\n
More PR-Agent commands
\n\n" output += HelpMessage.get_general_bot_help_text() diff --git a/pr_agent/settings/pr_code_suggestions_prompts.toml b/pr_agent/settings/pr_code_suggestions_prompts.toml index 418212b3..c1847931 100644 --- a/pr_agent/settings/pr_code_suggestions_prompts.toml +++ b/pr_agent/settings/pr_code_suggestions_prompts.toml @@ -39,6 +39,9 @@ Specific instructions: - Provide the exact line numbers range (inclusive) for each suggestion. - Assume there is additional relevant code, that is not included in the diff. - When quoting variables or names from the code, use backticks (`) instead of single quote ('). +{%- if summarize_mode %} +- If needed, use abbreviations for the 'existing code' and 'improved code' snippets, to keep the output short. +{%- endif %} {%- if extra_instructions %} diff --git a/pr_agent/tools/pr_code_suggestions.py b/pr_agent/tools/pr_code_suggestions.py index 776b660f..b4f7a973 100644 --- a/pr_agent/tools/pr_code_suggestions.py +++ b/pr_agent/tools/pr_code_suggestions.py @@ -45,6 +45,7 @@ class PRCodeSuggestions: "language": self.main_language, "diff": "", # empty diff for initial calculation "num_code_suggestions": num_code_suggestions, + "summarize_mode": get_settings().pr_code_suggestions.summarize, "extra_instructions": get_settings().pr_code_suggestions.extra_instructions, "commit_messages_str": self.git_provider.get_commit_messages(), }