Skip to content

Commit f92906e

Browse files
committed
Update edit format instruction constants to include deleted file handling and revise examples with a greeting module
1 parent 4d5e03a commit f92906e

1 file changed

Lines changed: 31 additions & 18 deletions

File tree

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,39 @@
1-
export const EDIT_FORMAT_INSTRUCTIONS_WHOLE = `Whenever showing a new or updated file, provide brief explanation, then print path in a markdown heading (e.g. ### New file: \`src/counter.py\`, ### Updated file: \`src/counter.py\`), followed by a markdown code block with full contents—as I have a disability which means I can't type and need to be able to just copy and paste. Example:
2-
The count variable has been incremented.
3-
### Updated file: \`src/counter.py\`
1+
export const EDIT_FORMAT_INSTRUCTIONS_WHOLE = `Whenever showing a new or updated file, provide brief explanation, then print path in a markdown heading (e.g. ### New file: \`src/counter.py\`, ### Updated file: \`src/counter.py\`, ### Deleted file: \`src/counter.py\`), followed by a markdown code block with full contents—as I have a disability which means I can't type and need to be able to just copy and paste. Example:
2+
Updated the greeting text.
3+
4+
### Updated file: \`src/hello.py\`
5+
46
\`\`\`python
5-
count = 20
7+
GREETING = "Hello, World!"
8+
9+
def show_greeting():
10+
print(GREETING)
611
\`\`\``
712

8-
export const EDIT_FORMAT_INSTRUCTIONS_TRUNCATED = `Whenever showing a new or updated file, provide brief explanation, then print path in a markdown heading (e.g. ### New file: \`src/counter.py\`, ### Updated file: \`src/counter.py\`), followed by a markdown code block with truncated contents—as a space saving measure unchanged parts should be hidden behind ellipsis comments, e.g. "// ...". Example:
9-
The count variable has been incremented.
10-
### Updated file: \`src/counter.py\`
13+
export const EDIT_FORMAT_INSTRUCTIONS_TRUNCATED = `Whenever showing a new or updated file, provide brief explanation, then print path in a markdown heading (e.g. ### New file: \`src/counter.py\`, ### Updated file: \`src/counter.py\`, ### Deleted file: \`src/counter.py\`), followed by a markdown code block with truncated contents—as a space saving measure unchanged parts should be hidden behind ellipsis comments, e.g. "# ... ". Example:
14+
Updated the greeting text.
15+
16+
### Updated file: \`src/hello.py\`
17+
1118
\`\`\`python
12-
// ...
13-
count = 20
14-
// ...
19+
GREETING = "Hello, World!"
20+
21+
def show_greeting():
22+
# ... the function remains unchanged
1523
\`\`\``
1624

17-
export const EDIT_FORMAT_INSTRUCTIONS_DIFF = `Whenever showing a new, updated, renamed or deleted file, provide brief explanation, then print path in a markdown heading (e.g. ### New file: \`src/counter.py\`, ### Updated file: \`src/counter.py\`), followed by a unified diff within a markdown code block. Example:
18-
The count variable has been incremented.
19-
### Updated file: \`src/counter.py\`
25+
export const EDIT_FORMAT_INSTRUCTIONS_DIFF = `Whenever showing a new, updated, renamed or deleted file, provide brief explanation, then print path in a markdown heading (e.g. ### New file: \`src/counter.py\`, ### Updated file: \`src/counter.py\`, ### Deleted file: \`src/counter.py\`), followed by a unified diff within a markdown code block. Example:
26+
Updated the greeting text.
27+
28+
### Updated file: \`src/hello.py\`
29+
2030
\`\`\`diff
21-
--- a/src/counter.py
22-
+++ b/src/counter.py
23-
@@ -2,1 +2,1 @@
24-
-count = 10
25-
+count = 20
31+
--- a/src/hello.py
32+
+++ b/src/hello.py
33+
@@ -1,4 +1,4 @@
34+
-GREETING = "Hello"
35+
+GREETING = "Hello, World!"
36+
37+
def show_greeting():
38+
print(GREETING)
2639
\`\`\``

0 commit comments

Comments
 (0)