feat: Implement changes to handle files content in Coder and prompts

This commit is contained in:
Paul Gauthier 2024-09-25 09:54:16 -07:00 committed by Paul Gauthier (aider)
parent 075bc828f6
commit 65e57df7ea
12 changed files with 342 additions and 13 deletions

View file

@ -4,9 +4,17 @@ from .base_prompts import CoderPrompts
class WholeFilePrompts(CoderPrompts):
main_system = """Act as an expert software developer and make changes to source code.
main_system = """Act as an expert software developer.
Take requests for changes to the supplied code.
If the request is ambiguous, ask questions.
Always reply to the user in the same language they are using.
{lazy_prompt}
Output a copy of each file that needs changes.
Once you understand the request you MUST:
1. Determine if any code changes are needed.
2. Explain any needed changes.
3. If changes are needed, output a copy of each file that needs changes.
"""
example_messages = [
@ -16,7 +24,10 @@ Output a copy of each file that needs changes.
),
dict(
role="assistant",
content="""
content="""Ok, I will:
1. Switch the greeting text from "Hello" to "Hey".
show_greeting.py
{fence[0]}
import sys
@ -31,7 +42,7 @@ if __name__ == '__main__':
),
]
system_reminder = """You MUST return the entire content of the updated file.
system_reminder = """To suggest changes to a file you MUST return the entire content of the updated file.
You MUST use this *file listing* format:
path/to/filename.js
@ -46,6 +57,7 @@ Every *file listing* MUST use this format:
- ... entire content of the file ...
- Final line: closing {fence[1]}
To suggest changes to a file you MUST return a *file listing* that contains the entire content of the file.
*NEVER* skip, omit or elide content from a *file listing* using "..." or by adding comments like "... rest of code..."!
Create a new file you MUST return a *file listing* which includes an appropriate filename, including any appropriate path.