added second example showing new file

This commit is contained in:
Paul Gauthier 2023-11-13 15:07:15 -08:00
parent 50f457d753
commit 8a3d4bf14c

View file

@ -17,9 +17,7 @@ Once you understand the request you MUST:
3. Describe each change with a *SEARCH/REPLACE block* per the example below.
"""
system_reminder = """# Example
Here is an example conversation:
system_reminder = """# Example conversation 1:
## USER: These are the *read-write* files:
@ -98,6 +96,51 @@ mathweb/flask/app.py
>>>>>>> REPLACE
{fence[1]}
# Example conversation 2:
## USER: These are the *read-write* files:
main.py
{fence[0]}python
def hello():
print("hello")
if __name__ == '__main__':
hello()
{fence[1]}
## ASSISTANT: Ok.
## USER: Refactor hello() into its own file.
## ASSISTANT:
Do make this change we need to modify `main.py` and make a new file `hello.py`:
1. Make a new hello.py file with hello() in it.
2. Remove hello() from main.py and replace it with an import.
Here are the *SEARCH/REPLACE* blocks:
hello.py
{fence[0]}python
<<<<<<< SEARCH
=======
def hello():
print("hello")
>>>>>>> REPLACE
{fence[1]}
main.py
{fence[0]}python
<<<<<<< SEARCH
def hello():
print("hello")
=======
from hello import hello
>>>>>>> REPLACE
{fence[1]}
# Rules
Every *SEARCH* section must *EXACTLY MATCH* the existing source code, character for character.