Skip to content

Commit

Permalink
fix: extended the patch tool prompt to not strictly forbid placeholde…
Browse files Browse the repository at this point in the history
…rs, mention scoping strategies and fallback to save
  • Loading branch information
ErikBjare committed Sep 15, 2024
1 parent ef7d9fd commit 7cf2119
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gptme/tools/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""

# TODO: support multiple patches in one codeblock (or make it clear that only one patch per codeblock is supported/applied)

import re
from collections.abc import Generator
from pathlib import Path
Expand All @@ -16,7 +17,10 @@
This can be used to make changes to files, without having to rewrite the whole file.
Only one patch block can be written per codeblock. Extra ORIGINAL/UPDATED blocks will be ignored.
Try to keep the patch as small as possible. Do not use placeholders, as they will make the patch fail.
Try to keep the patch as small as possible. Avoid placeholders, as they may make the patch fail.
To keep the patch small, try to scope the patch to imports/function/class.
If the patch is large, consider using the save tool to rewrite the whole file.
"""

ORIGINAL = "<<<<<<< ORIGINAL\n"
Expand Down

0 comments on commit 7cf2119

Please sign in to comment.