Skip to content

apply_patch

apply_patch

Apply-patch tool — apply unified diff patches to files.

Classes

ApplyPatchTool

ApplyPatchTool(allowed_dirs: Optional[List[str]] = None)

Bases: BaseTool

Apply a unified diff patch to a file.

Source code in src/openjarvis/tools/apply_patch.py
def __init__(self, allowed_dirs: Optional[List[str]] = None) -> None:
    self._allowed_dirs = [
        Path(d).expanduser().resolve() for d in resolve_allowed_dirs(allowed_dirs)
    ]

Functions