mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +00:00
more prompt engineering nonsense
This commit is contained in:
parent
1313a3f36b
commit
8fa8f6560d
2 changed files with 17 additions and 12 deletions
9
coder.py
9
coder.py
|
@ -117,7 +117,10 @@ class Coder:
|
||||||
files_messages = [
|
files_messages = [
|
||||||
dict(role="user", content=files_content),
|
dict(role="user", content=files_content),
|
||||||
dict(role="assistant", content="Ok."),
|
dict(role="assistant", content="Ok."),
|
||||||
dict(role="system", content=prompts.files_content_suffix),
|
dict(
|
||||||
|
role="system",
|
||||||
|
content=prompts.files_content_suffix + prompts.system_reminder,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
return files_messages
|
return files_messages
|
||||||
|
@ -149,7 +152,9 @@ class Coder:
|
||||||
# self.show_messages(self.cur_messages, "cur")
|
# self.show_messages(self.cur_messages, "cur")
|
||||||
|
|
||||||
messages = [
|
messages = [
|
||||||
dict(role="system", content=prompts.main_system),
|
dict(
|
||||||
|
role="system", content=prompts.main_system + prompts.system_reminder
|
||||||
|
),
|
||||||
]
|
]
|
||||||
messages += self.done_messages
|
messages += self.done_messages
|
||||||
messages += self.get_files_messages()
|
messages += self.get_files_messages()
|
||||||
|
|
20
prompts.py
20
prompts.py
|
@ -40,6 +40,15 @@ some/dir/example.py
|
||||||
>>>>>>> UPDATED
|
>>>>>>> UPDATED
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
system_reminder = """
|
||||||
|
NEVER REPLY WITH AN ENTIRE FILE IN THE TRIPLE-QUOTED FORMAT LIKE THE USER MESSAGES!
|
||||||
|
ANY CODE YOU INCLUDE IN A REPLY *MUST* BE IN THE ORIGINAL/UPDATED FORMAT!
|
||||||
|
EVERY ORIGINAL/UPDATED BLOCK MUST START WITH THE FILENAME!
|
||||||
|
THE ORIGINAL BLOCK MUST BE THE *EXACT* LINES FROM THE FILE!
|
||||||
|
THE ORIGINAL BLOCK MUST INCLUDE ALL THE ORIGINAL LEADING SPACES AND INDENTATION!
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
returned_code = """
|
returned_code = """
|
||||||
It looks like you tried to return a code block. Don't do that!
|
It looks like you tried to return a code block. Don't do that!
|
||||||
|
|
||||||
|
@ -48,8 +57,6 @@ Be selective!
|
||||||
Only return the parts of the code which need changes!
|
Only return the parts of the code which need changes!
|
||||||
"""
|
"""
|
||||||
|
|
||||||
system_reminder = "REMEMBER, ONLY RETURN CODE USING THE ORIGINAL/UPDATED FORMAT!"
|
|
||||||
|
|
||||||
### FILES
|
### FILES
|
||||||
|
|
||||||
files_content_gpt_edits = "I made your suggested changes to the files."
|
files_content_gpt_edits = "I made your suggested changes to the files."
|
||||||
|
@ -58,14 +65,7 @@ files_content_local_edits = "I made some changes to the files myself."
|
||||||
|
|
||||||
files_content_prefix = "Here is the current content of the files:\n\n"
|
files_content_prefix = "Here is the current content of the files:\n\n"
|
||||||
|
|
||||||
files_content_suffix = """BASE ANY EDITS ON THE CURRENT CONTENTS OF THE FILES AS SHOWN IN THE USER'S LAST MESSAGE.
|
files_content_suffix = """Base any edits on the current contents of the files as shown in the user's last message."""
|
||||||
NEVER REPLY WITH AN ENTIRE FILE IN THE TRIPLE-QUOTED FORMAT LIKE THAT!
|
|
||||||
ANY CODE YOU INCLUDE IN A REPLY MUST BE IN THE ORIGINAL/UPDATED FORMAT!
|
|
||||||
THE ORIGINAL BLOCK MUST BE THE *EXACT* LINES FROM THE FILE!
|
|
||||||
INCLUDE ALL THE LEADING SPACES!!
|
|
||||||
Be sure to include the correct path and filename for each edit, exactly as specified by the user.
|
|
||||||
DO NOT REPLY WITH diff OUTPUT!
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
### EDITOR
|
### EDITOR
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue