mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 18:25:00 +00:00
improved prompting around ctags
This commit is contained in:
parent
680fc45fb3
commit
8f7d7685d6
2 changed files with 9 additions and 12 deletions
|
@ -185,13 +185,12 @@ class Coder:
|
||||||
files_messages = [
|
files_messages = [
|
||||||
dict(role="user", content=all_content),
|
dict(role="user", content=all_content),
|
||||||
dict(role="assistant", content="Ok."),
|
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
|
return files_messages
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
@ -269,7 +268,7 @@ class Coder:
|
||||||
messages += self.get_files_messages()
|
messages += self.get_files_messages()
|
||||||
messages += self.cur_messages
|
messages += self.cur_messages
|
||||||
|
|
||||||
# utils.show_messages(messages, "all")
|
utils.show_messages(messages, "all")
|
||||||
|
|
||||||
content, interrupted = self.send(messages)
|
content, interrupted = self.send(messages)
|
||||||
if interrupted:
|
if interrupted:
|
||||||
|
|
|
@ -31,6 +31,8 @@ Once you understand the user's request and can see all the relevant code, your r
|
||||||
"""
|
"""
|
||||||
|
|
||||||
system_reminder = '''
|
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:
|
You MUST format EVERY code change using an *edit block* like this example:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
@ -84,12 +86,8 @@ files_content_prefix = (
|
||||||
)
|
)
|
||||||
|
|
||||||
repo_content_prefix = (
|
repo_content_prefix = (
|
||||||
"Here is a map showing all the {other}files and ctags content. You *must* ask with the full"
|
"Here is a map showing all the {other}files and selected ctags content. You *must* ask with the"
|
||||||
" path of the file before suggesting edits to these files:\n\n"
|
" 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."""
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue