Apply-patch tool — apply unified diff patches to files.
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)
]
|