Add clear instruction on how to make a new file

This commit is contained in:
Paul Gauthier 2023-12-17 15:25:15 -08:00
parent 042a2b8a08
commit f0b60a0052
2 changed files with 3 additions and 1 deletions

View file

@ -93,6 +93,8 @@ Hunks don't need to be in any particular order.
When editing a function, method, loop, etc use a hunk to replace the *entire* code block.
Delete the entire existing version with `-` lines and then add a new, updated version with `+` lines.
This will help you generate correct code and correct diffs.
To make a new file, show a diff from `--- /dev/null` to `+++ path/to/new/file.ext`.
"""
files_content_prefix = "These are the *read-write* files:\n"

View file

@ -127,7 +127,7 @@ helped clarify some general principles, which I think are applicable to any effe
GPT-4 code editing format:
- FAMILIAR - Choose an edit format that GPT is already familiar with.
- SIMPLE - Choose a simple format that avoid escaping, syntactic overhead and brittle specifiers like line numbers or line counts.
- SIMPLE - Choose a simple format that avoids escaping, syntactic overhead and brittle specifiers like line numbers or line counts.
- HIGH LEVEL - Encourage GPT to structure edits as new versions of substantive code blocks (functions, methods, etc), not as a series of surgical/minimal changes to individual lines of code.
- FLEXIBLE - Strive to be maximally flexible when interpreting GPT's edit instructions.