Skip to content

file_write

file_write

File write tool — write content to files with path validation.

Classes

FileWriteTool

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

Bases: BaseTool

Write content to files with optional directory restrictions.

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