reverted prompt closer to e9da401, added helpful assistant replies to repo and files messages

This commit is contained in:
Paul Gauthier 2024-05-09 11:27:13 -07:00
parent b58df9c16b
commit 444d17de93
3 changed files with 12 additions and 8 deletions

View file

@ -423,7 +423,10 @@ class Coder:
if repo_content:
files_messages += [
dict(role="user", content=repo_content),
dict(role="assistant", content="Ok."),
dict(
role="assistant",
content="Ok, I won't try and edit those files without asking first.",
),
]
if self.abs_fnames:
@ -434,7 +437,10 @@ class Coder:
files_messages += [
dict(role="user", content=files_content),
dict(role="assistant", content="Ok."),
dict(
role="assistant",
content="Ok, I will propose edits to those files to complete your request.",
),
]
images_message = self.get_images_message()

View file

@ -20,9 +20,7 @@ You always COMPLETELY IMPLEMENT the needed code!
files_no_full_files = "I am not sharing any files that you can edit yet."
repo_content_prefix = """I'm discussing files that are part of a git repository.
Here are summaries of some files present in my git repo.
repo_content_prefix = """Here are summaries of some files present in my git repository.
Do not propose changes to these files, treat them as *read-only*.
If you need to edit any of these files, ask me to *add them to the chat* first,
so I can show you their full content.
If you need to edit any of these files, ask me to *add them to the chat* first.
"""

View file

@ -12,7 +12,7 @@ Take requests for changes to the supplied code.
If the request is ambiguous, ask questions.
Once you understand the request you MUST:
1. List the files you need to modify. Only suggest changes to files that the user has given you permission to edit.
1. List the files you need to modify. Only suggest changes to files that the users says you can edit. Before changing other files, you *MUST* tell the user their full path names and ask them to *add the files to the chat*. End your reply and wait for their approval.
2. Think step-by-step and explain the needed changes with a numbered list of short sentences.
3. Describe each change with a *SEARCH/REPLACE block* per the examples below. All changes to files must use this *SEARCH/REPLACE block* format. ONLY EVER RETURN CODE IN A *SEARCH/REPLACE BLOCK*!
@ -124,7 +124,7 @@ Every *SEARCH* section must *EXACTLY MATCH* the existing source code, character
Include *ALL* the code being searched and replaced!
Only *SEARCH/REPLACE* files that the user has given you permission to edit.
Only *SEARCH/REPLACE* files that the user says you can edit.
To move code within a file, use 2 *SEARCH/REPLACE* blocks: 1 to delete it from its current location, 1 to insert it in the new location.