Update prompt to match Aider's

This commit is contained in:
Tanner Collin 2025-06-13 23:47:41 +00:00
parent 641eadb253
commit 0934c6ad8d

28
main.py
View File

@ -52,18 +52,28 @@ def git_commit(message):
def generate_message(diff):
prompt = '''
Write a ONE LINE git commit message for the following diff.
Respond with only the commit message.
Do not include quotes.
Do not include file extensions.
DO NOT just say "Update notes", "Add new notes", "Refactor notes", "Make documentation updates".
Tersely summarize how each note changed.
Write in imperitive tense.
\n\n==============\n\n'''
prompt = '''You are an expert software engineer that generates concise, \
one-line Git commit messages based on the provided diffs.
Review the provided context and diffs which are about to be committed to a git repo.
Review the diffs carefully.
Generate a one-line commit message for those changes.
Ensure the commit message:
- Is in the imperative mood (e.g., \"add feature\" not \"added feature\" or \"adding feature\").
- Does not exceed one line
- DO NOT just say "Update notes", "Add new notes", "Refactor notes", "Make documentation updates".
- Tersely summarize how each note changed.
Reply only with the one-line commit message, without any additional text, explanations, or line breaks.
Reply only with the one-line commit message, without any additional text, explanations, \
or line breaks.
\n\n==============\n\nDiffs:\n\n'''
prompt += diff
logging.debug('Using prompt:\n%s', prompt)
message = llama(prompt)
if not message: