ChainManagerMixin Class — langchain Architecture
Architecture documentation for the ChainManagerMixin class in base.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD b793455e_fb4f_5778_19b0_9da3f3207dd5["ChainManagerMixin"] aa78d849_32e0_cbe3_8323_1a62fafa0824["base.py"] b793455e_fb4f_5778_19b0_9da3f3207dd5 -->|defined in| aa78d849_32e0_cbe3_8323_1a62fafa0824 490c83e0_eb74_d706_8687_e5f0bcb033ec["on_chain_end()"] b793455e_fb4f_5778_19b0_9da3f3207dd5 -->|method| 490c83e0_eb74_d706_8687_e5f0bcb033ec db91ee21_e503_3b24_b5fe_9b8d7b4d4aba["on_chain_error()"] b793455e_fb4f_5778_19b0_9da3f3207dd5 -->|method| db91ee21_e503_3b24_b5fe_9b8d7b4d4aba 7b289967_2708_52d9_0d55_c0d6d855e5d8["on_agent_action()"] b793455e_fb4f_5778_19b0_9da3f3207dd5 -->|method| 7b289967_2708_52d9_0d55_c0d6d855e5d8 686bb78f_d123_88e6_d224_7f5109b15efd["on_agent_finish()"] b793455e_fb4f_5778_19b0_9da3f3207dd5 -->|method| 686bb78f_d123_88e6_d224_7f5109b15efd
Relationship Graph
Source Code
libs/core/langchain_core/callbacks/base.py lines 128–197
class ChainManagerMixin:
"""Mixin for chain callbacks."""
def on_chain_end(
self,
outputs: dict[str, Any],
*,
run_id: UUID,
parent_run_id: UUID | None = None,
**kwargs: Any,
) -> Any:
"""Run when chain ends running.
Args:
outputs: The outputs of the chain.
run_id: The ID of the current run.
parent_run_id: The ID of the parent run.
**kwargs: Additional keyword arguments.
"""
def on_chain_error(
self,
error: BaseException,
*,
run_id: UUID,
parent_run_id: UUID | None = None,
**kwargs: Any,
) -> Any:
"""Run when chain errors.
Args:
error: The error that occurred.
run_id: The ID of the current run.
parent_run_id: The ID of the parent run.
**kwargs: Additional keyword arguments.
"""
def on_agent_action(
self,
action: AgentAction,
*,
run_id: UUID,
parent_run_id: UUID | None = None,
**kwargs: Any,
) -> Any:
"""Run on agent action.
Args:
action: The agent action.
run_id: The ID of the current run.
parent_run_id: The ID of the parent run.
**kwargs: Additional keyword arguments.
"""
def on_agent_finish(
self,
finish: AgentFinish,
*,
run_id: UUID,
parent_run_id: UUID | None = None,
**kwargs: Any,
) -> Any:
"""Run on the agent end.
Args:
finish: The agent finish.
run_id: The ID of the current run.
parent_run_id: The ID of the parent run.
**kwargs: Additional keyword arguments.
"""
Defined In
Source
Frequently Asked Questions
What is the ChainManagerMixin class?
ChainManagerMixin is a class in the langchain codebase, defined in libs/core/langchain_core/callbacks/base.py.
Where is ChainManagerMixin defined?
ChainManagerMixin is defined in libs/core/langchain_core/callbacks/base.py at line 128.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free