Files
docker-agent-sandbox/docker_agent_sandbox/tools/file_ops.py
Matte23 80c2f9b159 feat: Initial library extraction from PIN LLM benchmark
DockerSandbox + LangChain file/shell tools extracted into a standalone package.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 11:47:44 +02:00

44 lines
1.7 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""file_ops.py assembles all file-operation tools into a single list."""
from __future__ import annotations
from typing import TYPE_CHECKING
from langchain_core.tools import BaseTool
from docker_agent_sandbox.tools.copy_file import make_copy_file_tool
from docker_agent_sandbox.tools.delete_file import make_delete_file_tool
from docker_agent_sandbox.tools.edit_file import make_edit_file_tool
from docker_agent_sandbox.tools.grep import make_grep_tool
from docker_agent_sandbox.tools.list_dir import make_list_dir_tool
from docker_agent_sandbox.tools.make_dir import make_make_dir_tool
from docker_agent_sandbox.tools.move_file import make_move_file_tool
from docker_agent_sandbox.tools.read_file import make_read_file_tool
from docker_agent_sandbox.tools.search_files import make_search_files_tool
from docker_agent_sandbox.tools.write_file import make_write_file_tool
if TYPE_CHECKING:
from docker_agent_sandbox.sandbox import DockerSandbox
def make_file_ops_tools(sandbox: "DockerSandbox") -> list[BaseTool]:
"""
Return file-operation tools bound to *sandbox*.
All paths are interpreted by the filesystem the model is working in — it
can use any absolute path (e.g. ``/tmp/re-agent/output.csv``) or a relative
one (resolved against the working directory).
"""
return [
make_read_file_tool(sandbox),
make_write_file_tool(sandbox),
make_edit_file_tool(sandbox),
make_list_dir_tool(sandbox),
make_delete_file_tool(sandbox),
make_move_file_tool(sandbox),
make_copy_file_tool(sandbox),
make_make_dir_tool(sandbox),
make_search_files_tool(sandbox),
make_grep_tool(sandbox),
]