Home / Class/ BaseRunManager Class — langchain Architecture

BaseRunManager Class — langchain Architecture

Architecture documentation for the BaseRunManager class in manager.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  3634d69d_8115_bbc7_d255_98aa30244c71["BaseRunManager"]
  ef8e2cdf_ea22_e203_4adb_464bcbd6daca["RunManagerMixin"]
  3634d69d_8115_bbc7_d255_98aa30244c71 -->|extends| ef8e2cdf_ea22_e203_4adb_464bcbd6daca
  35cf5db6_bcb1_b854_6ebb_5e0368e51b58["manager.py"]
  3634d69d_8115_bbc7_d255_98aa30244c71 -->|defined in| 35cf5db6_bcb1_b854_6ebb_5e0368e51b58
  78fae773_d22b_f753_a364_55d8914e23d5["__init__()"]
  3634d69d_8115_bbc7_d255_98aa30244c71 -->|method| 78fae773_d22b_f753_a364_55d8914e23d5
  6dcada3b_9979_0663_e93d_ed9a6809002c["get_noop_manager()"]
  3634d69d_8115_bbc7_d255_98aa30244c71 -->|method| 6dcada3b_9979_0663_e93d_ed9a6809002c

Relationship Graph

Source Code

libs/core/langchain_core/callbacks/manager.py lines 457–510

class BaseRunManager(RunManagerMixin):
    """Base class for run manager (a bound callback manager)."""

    def __init__(
        self,
        *,
        run_id: UUID,
        handlers: list[BaseCallbackHandler],
        inheritable_handlers: list[BaseCallbackHandler],
        parent_run_id: UUID | None = None,
        tags: list[str] | None = None,
        inheritable_tags: list[str] | None = None,
        metadata: dict[str, Any] | None = None,
        inheritable_metadata: dict[str, Any] | None = None,
    ) -> None:
        """Initialize the run manager.

        Args:
            run_id: The ID of the run.
            handlers: The list of handlers.
            inheritable_handlers: The list of inheritable handlers.
            parent_run_id: The ID of the parent run.
            tags: The list of tags.
            inheritable_tags: The list of inheritable tags.
            metadata: The metadata.
            inheritable_metadata: The inheritable metadata.

        """
        self.run_id = run_id
        self.handlers = handlers
        self.inheritable_handlers = inheritable_handlers
        self.parent_run_id = parent_run_id
        self.tags = tags or []
        self.inheritable_tags = inheritable_tags or []
        self.metadata = metadata or {}
        self.inheritable_metadata = inheritable_metadata or {}

    @classmethod
    def get_noop_manager(cls) -> Self:
        """Return a manager that doesn't perform any operations.

        Returns:
            The noop manager.

        """
        return cls(
            run_id=uuid7(),
            handlers=[],
            inheritable_handlers=[],
            tags=[],
            inheritable_tags=[],
            metadata={},
            inheritable_metadata={},
        )

Extends

Frequently Asked Questions

What is the BaseRunManager class?
BaseRunManager is a class in the langchain codebase, defined in libs/core/langchain_core/callbacks/manager.py.
Where is BaseRunManager defined?
BaseRunManager is defined in libs/core/langchain_core/callbacks/manager.py at line 457.
What does BaseRunManager extend?
BaseRunManager extends RunManagerMixin.

Analyze Your Own Codebase

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

Try Supermodel Free