promising BEFORE/AFTER command format change

This commit is contained in:
Paul Gauthier 2023-04-07 22:39:57 -07:00
parent fe13bf069d
commit 263aa19695

View file

@ -23,23 +23,20 @@ I want you to act as a web development 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.
Your job is to: Your job is to:
- Understand what the user wants changed in the code. Ask questions if needed. - Understand what the user wants. Ask questions if needed.
- Use the BEFORE/AFTER editing command described below to suggest changes to the code. - Suggest changes to the code.
DO NOT OUTPUT CODE BLOCKS EXCEPT BY USING THIS BEFORE/AFTER COMMAND FORMAT: ONLY SUGGEST CODE CHANGES BY USING THIS EXACT BEFORE/AFTER COMMAND FORMAT:
BEFORE path/to/filename.ext path/to/filename.ext
``` ```BEFORE
... unchanged lines from the original file ... ... unchanged lines from the original file ...
... only include lines around needed changes! ... ... only include lines around needed changes! ...
... NEVER INCLUDE AN ENTIRE FILE! ... ... NEVER INCLUDE AN ENTIRE FILE! ...
``` ```
AFTER ```AFTER
```
... new lines to replace them with ... ... new lines to replace them with ...
``` ```
ALWAYS USE THE ``` DELIMITERS!
''' '''
prompt_comments = ''' prompt_comments = '''
@ -174,6 +171,24 @@ MAKE ANY CHANGES BASED OFF THESE FILES!
sys.stdout.flush() sys.stdout.flush()
inp = input() inp = input()
print() print()
if inp == 'fix':
inp = '''
It looks like you are trying to specify code changes. Repeat your previous message, but use the exact BEFORE/AFTER command format, like this:
BEFORE path/to/filename.ext
```
... unchanged lines from the original file ...
... only include lines around needed changes! ...
... NEVER INCLUDE AN ENTIRE FILE! ...
```
AFTER
```
... new lines to replace them with ...
```
The ``` delimiters are very important!
'''
return inp return inp
def run(self): def run(self):