Home / Function/ __init__() — langchain Function Reference

__init__() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  72aa37bf_debc_f0ac_636f_355496d18a60["__init__()"]
  08b4a765_d2b7_01b0_5aaf_9f2eb31eb98f["StateClaudeTextEditorMiddleware"]
  72aa37bf_debc_f0ac_636f_355496d18a60 -->|defined in| 08b4a765_d2b7_01b0_5aaf_9f2eb31eb98f
  style 72aa37bf_debc_f0ac_636f_355496d18a60 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/anthropic/langchain_anthropic/middleware/anthropic_tools.py lines 591–608

    def __init__(
        self,
        *,
        allowed_path_prefixes: Sequence[str] | None = None,
    ) -> None:
        """Initialize the text editor middleware.

        Args:
            allowed_path_prefixes: Optional list of allowed path prefixes.

                If specified, only paths starting with these prefixes are allowed.
        """
        super().__init__(
            tool_type=TEXT_EDITOR_TOOL_TYPE,
            tool_name=TEXT_EDITOR_TOOL_NAME,
            state_key="text_editor_files",
            allowed_path_prefixes=allowed_path_prefixes,
        )

Domain

Subdomains

Frequently Asked Questions

What does __init__() do?
__init__() is a function in the langchain codebase, defined in libs/partners/anthropic/langchain_anthropic/middleware/anthropic_tools.py.
Where is __init__() defined?
__init__() is defined in libs/partners/anthropic/langchain_anthropic/middleware/anthropic_tools.py at line 591.

Analyze Your Own Codebase

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

Try Supermodel Free