Home / Function/ __init__() — langchain Function Reference

__init__() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  2ed41984_febf_cafa_0c33_3fbd9df6f45a["__init__()"]
  89d8d69c_785e_e71a_498a_04879f19121c["RootListenersTracer"]
  2ed41984_febf_cafa_0c33_3fbd9df6f45a -->|defined in| 89d8d69c_785e_e71a_498a_04879f19121c
  style 2ed41984_febf_cafa_0c33_3fbd9df6f45a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/tracers/root_listeners.py lines 29–51

    def __init__(
        self,
        *,
        config: RunnableConfig,
        on_start: Listener | None,
        on_end: Listener | None,
        on_error: Listener | None,
    ) -> None:
        """Initialize the tracer.

        Args:
            config: The runnable config.
            on_start: The listener to call on run start.
            on_end: The listener to call on run end.
            on_error: The listener to call on run error
        """
        super().__init__(_schema_format="original+chat")

        self.config = config
        self._arg_on_start = on_start
        self._arg_on_end = on_end
        self._arg_on_error = on_error
        self.root_id: UUID | None = None

Domain

Subdomains

Frequently Asked Questions

What does __init__() do?
__init__() is a function in the langchain codebase, defined in libs/core/langchain_core/tracers/root_listeners.py.
Where is __init__() defined?
__init__() is defined in libs/core/langchain_core/tracers/root_listeners.py at line 29.

Analyze Your Own Codebase

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

Try Supermodel Free