Skip to content

Commit

Permalink
Emphasize that there must be only one hank in diff format
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroshinishio committed Nov 17, 2024
1 parent 62929bb commit de6f27a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions services/openai/instructions/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
1. For new files
```diff
```diff(unified=0)
--- /dev/null
+++ path/to/new/file
@@ -0,0 +1,3 @@
Expand All @@ -15,28 +15,28 @@
+ added line 3
```
2. For modified files
2-1. For modified files (Replace lines of code)
```diff
```diff(unified=0)
--- path/to/file1
+++ path/to/file1
@@ -5,1 +5,1 @@
- original line 5
+ modified line 5
```
or
2-2. For modified files (Remove lines of code)
```diff
```diff(unified=0)
--- path/to/file2
+++ path/to/file2
@@ -10,1 +10,0 @@
- original line 10
```
or
2-3. For modified files (Add lines of code)
```diff
```diff(unified=0)
--- path/to/file3
+++ path/to/file3
@@ -15,0 +15,1 @@
Expand All @@ -45,7 +45,7 @@
3. For deleted Files
```diff
```diff(unified=0)
--- path/to/delete
+++ /dev/null
```
Expand All @@ -65,6 +65,6 @@
## Other rules about diff format
- NEVER EVER include any comments or explanations.
- NEVER EVER include any context lines. ONLY include the changed lines.
- If you need to change multiple blocks in the same file, call the function multiple times with each block separately for simplicity. For example, if you have three blocks to change in the same file, call the function three times with each block separately.
- NEVER EVER include any context lines around changed lines. ONLY include the changed lines.
- Each function call MUST generate exactly ONE hunk (one @@ header) for ONE change block.
"""

0 comments on commit de6f27a

Please sign in to comment.