mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 20:35:00 +00:00
refac prompt out
This commit is contained in:
parent
9a278bed21
commit
df300e89a2
2 changed files with 19 additions and 14 deletions
16
scripts/history_prompts.py
Normal file
16
scripts/history_prompts.py
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
history_prompt = """
|
||||||
|
Update the history with changes shown in the diffs.
|
||||||
|
Describe actual user-facing changes, not every single commit that was made implementing them.
|
||||||
|
|
||||||
|
Only add new items not already listed.
|
||||||
|
Do NOT edit or update existing history entries.
|
||||||
|
Do NOT add duplicate entries for changes that have existing history entries.
|
||||||
|
|
||||||
|
End each bullet with a period.
|
||||||
|
|
||||||
|
Be sure to attribute changes to the proper .x version.
|
||||||
|
Changes in the .x-dev version should be listed under a "### main branch" heading
|
||||||
|
|
||||||
|
Also, add this as the last bullet under the "### main branch" section:
|
||||||
|
{aider_line}
|
||||||
|
""" # noqa
|
|
@ -5,6 +5,8 @@ import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
|
from history_prompts import history_prompt
|
||||||
|
|
||||||
from aider import __version__
|
from aider import __version__
|
||||||
|
|
||||||
|
|
||||||
|
@ -76,20 +78,7 @@ def main():
|
||||||
aider_line = blame_result.stdout.strip().split("\n")[-1] # Get last line with percentage
|
aider_line = blame_result.stdout.strip().split("\n")[-1] # Get last line with percentage
|
||||||
|
|
||||||
# Construct and run the aider command
|
# Construct and run the aider command
|
||||||
message = f"""
|
message = history_prompt.format(aider_line=aider_line)
|
||||||
Update the history with changes shown in the diffs.
|
|
||||||
Describe actual user-facing changes, not every single commit that was made implementing them.
|
|
||||||
|
|
||||||
Only add new items not already listed.
|
|
||||||
Do NOT edit or update existing history entries.
|
|
||||||
Do NOT add duplicate entries for changes that have existing history entries.
|
|
||||||
|
|
||||||
Be sure to attribute changes to the proper .x version.
|
|
||||||
Changes in the .x-dev version should be listed under a "### main branch" heading
|
|
||||||
|
|
||||||
Also, add this as the last bullet under the "### main branch" section:
|
|
||||||
{aider_line}
|
|
||||||
""" # noqa
|
|
||||||
|
|
||||||
cmd = ["aider", hist_path, "--read", diff_path, "--msg", message, "--no-auto-commit"]
|
cmd = ["aider", hist_path, "--read", diff_path, "--msg", message, "--no-auto-commit"]
|
||||||
subprocess.run(cmd)
|
subprocess.run(cmd)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue