improved prompting around ctags

This commit is contained in:
Paul Gauthier 2023-05-19 09:54:27 -07:00
parent 680fc45fb3
commit 8f7d7685d6
2 changed files with 9 additions and 12 deletions

View file

@ -185,13 +185,12 @@ class Coder:
files_messages = [
dict(role="user", content=all_content),
dict(role="assistant", content="Ok."),
dict(
role="system",
content=prompts.files_content_suffix + prompts.system_reminder,
),
]
if self.abs_fnames:
files_messages += [
dict(role="system", content=prompts.system_reminder),
]
utils.show_messages(files_messages, "FILES")
return files_messages
def run(self):
@ -269,7 +268,7 @@ class Coder:
messages += self.get_files_messages()
messages += self.cur_messages
# utils.show_messages(messages, "all")
utils.show_messages(messages, "all")
content, interrupted = self.send(messages)
if interrupted:

View file

@ -31,6 +31,8 @@ Once you understand the user's request and can see all the relevant code, your r
"""
system_reminder = '''
Base any edits on the current contents of the files as shown in the user's last message.
You MUST format EVERY code change using an *edit block* like this example:
```python
@ -84,12 +86,8 @@ files_content_prefix = (
)
repo_content_prefix = (
"Here is a map showing all the {other}files and ctags content. You *must* ask with the full"
" path of the file before suggesting edits to these files:\n\n"
)
files_content_suffix = (
"""Base any edits on the current contents of the files as shown in the user's last message."""
"Here is a map showing all the {other}files and selected ctags content. You *must* ask with the"
" full path of the file before suggesting edits to these files:\n\n"
)