This commit is contained in:
Paul Gauthier 2023-04-09 06:59:24 -07:00
parent 5b13bbeb12
commit 0368eed9f7

View file

@ -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'''