edit_file_with_context

Edits a file based on instructions for editing the file and instructions for finding contextual information needed to edit the file.

Arguments

NameTypeDescriptionRequired

path_to_file

string

The path to the file that needs editing, relative to the project root.

find_content_in_file_prompt

prompt

Instructions for finding the desired information in the file.

edit_prompt

prompt

Instructions on how to edit the file.

modify_with_diff

boolean

Whether to edit code with diff or with a full rewrite. Good for additions, less so for deletions or complex refactors.

Returns

TypeDescription

string

The path to the edited file.

Example

- name: edit_file_with_context
  arguments:
    path_to_file: <path-to-file>
    find_content_in_file_prompt: <find-content-in-file-prompt>
    edit_prompt: <edit-prompt>
    modify_with_diff: <true/false>
  returns: <path-to-edited-file>

Last updated