mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 00:05:01 +00:00
added extra system prompt
This commit is contained in:
parent
d3640a7d16
commit
99106a1b98
2 changed files with 10 additions and 18 deletions
2
coder.py
2
coder.py
|
@ -110,9 +110,11 @@ class Coder:
|
||||||
dict(role = 'user', content = files_content),
|
dict(role = 'user', content = files_content),
|
||||||
dict(role = 'assistant', content = "Ok."),
|
dict(role = 'assistant', content = "Ok."),
|
||||||
dict(role = 'user', content = inp + prompts.user_suffix),
|
dict(role = 'user', content = inp + prompts.user_suffix),
|
||||||
|
dict(role = 'system', content = 'ONLY RETURN CODE USING THE ORIGINAL/UPDATED FORMAT!'),
|
||||||
]
|
]
|
||||||
|
|
||||||
content = self.send(messages)
|
content = self.send(messages)
|
||||||
|
messages.pop() # system
|
||||||
messages.pop() # user msg
|
messages.pop() # user msg
|
||||||
messages.pop() # assistant Ok.
|
messages.pop() # assistant Ok.
|
||||||
messages.pop() # user files content
|
messages.pop() # user files content
|
||||||
|
|
26
prompts.py
26
prompts.py
|
@ -5,7 +5,12 @@ main_system = '''
|
||||||
I want you to act as an expert software engineer and pair programmer.
|
I want you to act as an expert software engineer and pair programmer.
|
||||||
You are an expert at understanding code and proposing code changes in response to user requests.
|
You are an expert at understanding code and proposing code changes in response to user requests.
|
||||||
|
|
||||||
FOR EACH CHANGE TO THE CODE, DESCRIBE IT USING THIS FORMAT:
|
For each change to the code, describe it using the ORIGINAL/UPDATED format shown in the examples below.
|
||||||
|
This format is a way of specifying a line oriented search and replace.
|
||||||
|
It will find the chunk of lines in the ORIGINAL block and replace them with the chunk of lines in the UPDATED block.
|
||||||
|
The ORIGINAL block must be a chunk of lines which currently exist in the file!
|
||||||
|
|
||||||
|
Here are examples:
|
||||||
|
|
||||||
path/to/filename.ext
|
path/to/filename.ext
|
||||||
<<<<<<< ORIGINAL
|
<<<<<<< ORIGINAL
|
||||||
|
@ -91,28 +96,13 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
files_content_prefix_edited = 'I made your suggested changes, here are the updated files:\n\n'
|
files_content_prefix_edited = 'I made your suggested changes, here are the updated files:\n\n'
|
||||||
|
|
||||||
files_content_prefix_plain = 'Here are the files:\n\n'
|
files_content_prefix_plain = 'Here are the files I need you to edit:\n\n'
|
||||||
|
|
||||||
files_content_suffix = ''
|
files_content_suffix = ''
|
||||||
|
|
||||||
user_suffix = '''
|
user_suffix = '''
|
||||||
|
|
||||||
BASE YOUR EDITS ON THE CURRENT CONTENTS OF THE FILES AS SHOWN IN THIS MESSAGE.
|
BASE ANY EDITS ON THE CURRENT CONTENTS OF THE FILES AS SHOWN IN THIS MESSAGE.
|
||||||
|
|
||||||
NEVER RETURN CODE LIKE THIS:
|
|
||||||
|
|
||||||
```
|
|
||||||
file contents
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
||||||
NEVER RETURN CODE LIKE THIS:
|
|
||||||
|
|
||||||
filename.ext
|
|
||||||
```
|
|
||||||
file contents
|
|
||||||
...
|
|
||||||
```
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
### EDITOR
|
### EDITOR
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue