Home / Function/ __init__() — langchain Function Reference

__init__() — langchain Function Reference

Architecture documentation for the __init__() function in shell_tool.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  322a954d_5e2a_3444_fecf_23cbb2e463c9["__init__()"]
  cf4eeaa4_4bcc_69d9_a0f3_664b1eecb4e8["ShellSession"]
  322a954d_5e2a_3444_fecf_23cbb2e463c9 -->|defined in| cf4eeaa4_4bcc_69d9_a0f3_664b1eecb4e8
  style 322a954d_5e2a_3444_fecf_23cbb2e463c9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/langchain/agents/middleware/shell_tool.py lines 128–145

    def __init__(
        self,
        workspace: Path,
        policy: BaseExecutionPolicy,
        command: tuple[str, ...],
        environment: Mapping[str, str],
    ) -> None:
        self._workspace = workspace
        self._policy = policy
        self._command = command
        self._environment = dict(environment)
        self._process: subprocess.Popen[str] | None = None
        self._stdin: Any = None
        self._queue: queue.Queue[tuple[str, str | None]] = queue.Queue()
        self._lock = threading.Lock()
        self._stdout_thread: threading.Thread | None = None
        self._stderr_thread: threading.Thread | None = None
        self._terminated = False

Domain

Subdomains

Frequently Asked Questions

What does __init__() do?
__init__() is a function in the langchain codebase, defined in libs/langchain_v1/langchain/agents/middleware/shell_tool.py.
Where is __init__() defined?
__init__() is defined in libs/langchain_v1/langchain/agents/middleware/shell_tool.py at line 128.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free