mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 10:14:59 +00:00
67 lines
1.8 KiB
Python
67 lines
1.8 KiB
Python
# flake8: noqa: E501
|
|
|
|
from .base_prompts import CoderPrompts
|
|
|
|
|
|
class WholeFilePrompts(CoderPrompts):
|
|
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}
|
|
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 = [
|
|
dict(
|
|
role="user",
|
|
content="Change the greeting to be more casual",
|
|
),
|
|
dict(
|
|
role="assistant",
|
|
content="""Ok, I will:
|
|
|
|
1. Switch the greeting text from "Hello" to "Hey".
|
|
|
|
show_greeting.py
|
|
{fence[0]}
|
|
import sys
|
|
|
|
def greeting(name):
|
|
print(f"Hey {{name}}")
|
|
|
|
if __name__ == '__main__':
|
|
greeting(sys.argv[1])
|
|
{fence[1]}
|
|
""",
|
|
),
|
|
]
|
|
|
|
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
|
|
{fence[0]}
|
|
// entire file content ...
|
|
// ... goes in between
|
|
{fence[1]}
|
|
|
|
Every *file listing* MUST use this format:
|
|
- First line: the filename with any originally provided path
|
|
- Second line: opening {fence[0]}
|
|
- ... 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.
|
|
|
|
{lazy_prompt}
|
|
"""
|
|
|
|
redacted_edit_message = "No changes are needed."
|