BaseFileToolMixin#

class langchain_community.tools.file_management.utils.BaseFileToolMixin[source]#

Bases: BaseModel

Mixin for file system tools.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

param root_dir: str | None = None#

The final path will be chosen relative to root_dir if specified.

get_relative_path(file_path: str) Path[source]#

Get the relative path, returning an error if unsupported.

Parameters:

file_path (str)

Return type:

Path