Toggle Menu
Prev Up Next

# `langchain_core.callbacks.base`.ChainManagerMixin

class langchain_core.callbacks.base.ChainManagerMixin

  Mixin for chain callbacks.

  Methods

  `__init__`() |
  `on_agent_action`(action, *, run_id[, ...]) | Run on agent action.
  `on_agent_finish`(finish, *, run_id[, ...]) | Run on agent end.
  `on_chain_end`(outputs, *, run_id[, parent_run_id]) | Run when chain ends running.
  `on_chain_error`(error, *, run_id[, parent_run_id]) | Run when chain errors.

  __init__()
  on_agent_action(action: AgentAction, *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any

    Run on agent action.

    Parameters

      - action (AgentAction) –

      - run_id (UUID) –

      - parent_run_id (Optional[UUID]) –

      - kwargs (Any) –

    Return type

      Any

  on_agent_finish(finish: AgentFinish, *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any

    Run on agent end.

    Parameters

      - finish (AgentFinish) –

      - run_id (UUID) –

      - parent_run_id (Optional[UUID]) –

      - kwargs (Any) –

    Return type

      Any

  on_chain_end(outputs: Dict[str, Any], *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any

    Run when chain ends running.

    Parameters

      - outputs (Dict[str, Any]) –

      - run_id (UUID) –

      - parent_run_id (Optional[UUID]) –

      - kwargs (Any) –

    Return type

      Any

  on_chain_error(error: BaseException, *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any

    Run when chain errors.

    Parameters

      - error (BaseException) –

      - run_id (UUID) –

      - parent_run_id (Optional[UUID]) –

      - kwargs (Any) –

    Return type

      Any