Skip to content

Commit

Permalink
Update suggest_edits prompt to clarify usage of <old_text> when
Browse files Browse the repository at this point in the history
using update/create operations.

- Add a mention that `old_text` is required for all but create/delete
- Change definition of `create` operation to also mean overwrite, as
  some models heavily prefer rewrites.
  • Loading branch information
mattprodani committed Dec 21, 2024
1 parent dbb7610 commit ab90797
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions assets/prompts/suggest_edits.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ You must describe the change using the following XML structure:
of this edit.
- <old_text> (optional) - An excerpt from the file's current contents that uniquely
identifies a range within the file where the edit should occur. If this tag is not
specified, then the entire file will be used as the range.
specified, then the entire file will be used as the range. Required for all operations
except `create` and `delete`.
- <new_text> (required) - The new text to insert into the file.
- <operation> (required) - The type of change that should occur at the given range
of the file. Must be one of the following values:
- `update`: Replaces the entire range with the new text.
- `insert_before`: Inserts the new text before the range.
- `insert_after`: Inserts new text after the range.
- `create`: Creates a new file with the given path and the new text.
- `create`: Creates or overwrites a file with the given path and the new text.
- `delete`: Deletes the specified range from the file.

<guidelines>
Expand Down

0 comments on commit ab90797

Please sign in to comment.