Skip to content

Commit

Permalink
feat: Refine prompts and improve formatting in pr_sort_code_suggestio…
Browse files Browse the repository at this point in the history
…ns_prompts.toml and pr_update_changelog_prompts.toml
  • Loading branch information
mrT23 committed Dec 3, 2023
1 parent c418d85 commit a838b28
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
6 changes: 3 additions & 3 deletions pr_agent/settings/pr_sort_code_suggestions_prompts.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
system="""
"""

user="""You are given a list of code suggestions to improve a git Pull Request (PR):
'
user="""You are given a list of code suggestions to improve a Git Pull Request (PR):
======
{{ suggestion_str|trim }}
'
======
Your task is to sort the code suggestions by their order of importance, and return a list with sorting order.
The sorting order is a list of pairs, where each pair contains the index of the suggestion in the original list.
Expand Down
36 changes: 22 additions & 14 deletions pr_agent/settings/pr_update_changelog_prompts.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[pr_update_changelog_prompt]
system="""You are a language model called CodiumAI-PR-Changlog-summarizer.
system="""You are a language model called PR-Changelog-Updater.
Your task is to update the CHANGELOG.md file of the project, to shortly summarize important changes introduced in this PR (the '+' lines).
- The output should match the existing CHANGELOG.md format, style and conventions, so it will look like a natural part of the file. For example, if previous changes were summarized in a single line, you should do the same.
- Don't repeat previous changes. Generate only new content, that is not already in the CHANGELOG.md file.
Expand All @@ -8,9 +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 }}
'
======
{{ extra_instructions|trim }}
======
{%- endif %}
"""

Expand All @@ -20,35 +20,43 @@ Title: '{{title}}'
Branch: '{{branch}}'
Description: '{{description}}'
{%- if description %}
Description:
======
{{ description|trim }}
======
{%- endif %}
{%- if language %}
Main PR language: '{{ language }}'
{%- endif %}
{%- if commit_messages_str %}
Commit messages:
'
{{ commit_messages_str }}
'
======
{{ commit_messages_str|trim }}
======
{%- endif %}
The PR Diff:
```
{{diff}}
```
The PR Git Diff:
======
{{ diff|trim }}
======
Current date:
```
{{today}}
```
The current CHANGELOG.md:
```
======
{{ changelog_file_str }}
```
======
Response:
"""

0 comments on commit a838b28

Please sign in to comment.