mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 06:15:00 +00:00
better
This commit is contained in:
parent
5b13bbeb12
commit
0368eed9f7
1 changed files with 7 additions and 9 deletions
16
coder.py
16
coder.py
|
@ -183,15 +183,14 @@ class Coder:
|
||||||
prompt = ''
|
prompt = ''
|
||||||
for fname in self.fnames:
|
for fname in self.fnames:
|
||||||
prompt += self.quoted_file(fname)
|
prompt += self.quoted_file(fname)
|
||||||
prompt += '\n\nRemember, NEVER REPLY WITH WHOLE FILES LIKE THIS. ONLY TELL ME CODE CHANGES USING ORIGINAL/UPDATED EDIT COMMANDS!\n'
|
prompt += ''''
|
||||||
|
|
||||||
|
YOU CAN ONLY EDIT THESE FILES.
|
||||||
|
NEVER REPLY WITH WHOLE FILES LIKE THIS!
|
||||||
|
ONLY TELL ME CODE CHANGES USING ORIGINAL/UPDATED EDIT COMMANDS!
|
||||||
|
'''
|
||||||
return prompt
|
return prompt
|
||||||
|
|
||||||
change_notice = '''
|
|
||||||
TAKE NOTE!
|
|
||||||
The contents of the files have been updated!
|
|
||||||
USE THESE FILES NOW.
|
|
||||||
MAKE ANY CHANGES BASED OFF THESE FILES!
|
|
||||||
'''
|
|
||||||
def get_input(self):
|
def get_input(self):
|
||||||
|
|
||||||
print()
|
print()
|
||||||
|
@ -225,7 +224,6 @@ MAKE ANY CHANGES BASED OFF THESE FILES!
|
||||||
files_prefix = 'Here are the files:'
|
files_prefix = 'Here are the files:'
|
||||||
files_prefix += '\n\n'
|
files_prefix += '\n\n'
|
||||||
|
|
||||||
|
|
||||||
messages += [
|
messages += [
|
||||||
dict(role = 'user', content = files_prefix + self.get_files_content()),
|
dict(role = 'user', content = files_prefix + self.get_files_content()),
|
||||||
dict(role = 'assistant', content = "Ok."),
|
dict(role = 'assistant', content = "Ok."),
|
||||||
|
@ -404,7 +402,7 @@ MAKE ANY CHANGES BASED OFF THESE FILES!
|
||||||
|
|
||||||
def do_gpt_powered_replace(self, fname, edit, request):
|
def do_gpt_powered_replace(self, fname, edit, request):
|
||||||
print(f'Asking GPT to apply ambiguous edit to {fname}...')
|
print(f'Asking GPT to apply ambiguous edit to {fname}...')
|
||||||
print(repr(edit))
|
|
||||||
fname = Path(fname)
|
fname = Path(fname)
|
||||||
content = fname.read_text()
|
content = fname.read_text()
|
||||||
prompt = f'''
|
prompt = f'''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue