LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Caches
    • Callbacks
    • Documents
    • Document loaders
    • Embeddings
    • Exceptions
    • Language models
    • Serialization
    • Output parsers
    • Prompts
    • Rate limiters
    • Retrievers
    • Runnables
    • Utilities
    • Vector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewCachesCallbacksDocumentsDocument loadersEmbeddingsExceptionsLanguage modelsSerializationOutput parsersPromptsRate limitersRetrieversRunnablesUtilitiesVector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-corecallbacksmanagerCallbackManagerForChainGroup
    Classā—Since v0.1

    CallbackManagerForChainGroup

    Callback manager for the chain group.

    Copy
    CallbackManagerForChainGroup(
      self,
      handlers: list[BaseCallbackHandler],
      inheritable_handlers: list[BaseCallbackHandler] | None = None,
      parent_run_id: UUID | None = None,
      *,
      parent_run_manager: CallbackManagerForChainRun,
      **kwargs: Any = {}
    )

    Bases

    CallbackManager

    Parameters

    NameTypeDescription
    handlers*list[BaseCallbackHandler]

    The list of handlers.

    inheritable_handlerslist[BaseCallbackHandler] | None
    Default:None

    The list of inheritable handlers.

    parent_run_idUUID | None
    Default:None

    The ID of the parent run.

    parent_run_manager*CallbackManagerForChainRun

    The parent run manager.

    **kwargsAny
    Default:{}

    Additional keyword arguments.

    Constructors

    constructor
    __init__
    NameType
    handlerslist[BaseCallbackHandler]
    inheritable_handlerslist[BaseCallbackHandler] | None
    parent_run_idUUID | None
    parent_run_managerCallbackManagerForChainRun

    Attributes

    attribute
    parent_run_manager: parent_run_manager
    attribute
    ended: bool

    Methods

    method
    copy
    method
    merge

    Merge the group callback manager with another callback manager.

    Overwrites the merge method in the base class to ensure that the parent run manager is preserved. Keeps the parent_run_manager from the current object.

    method
    on_chain_end

    Run when traced chain group ends.

    method
    on_chain_error

    Run when chain errors.

    Inherited fromCallbackManager

    Methods

    Mon_llm_start
    —

    Start a trace for a (non-chat model) LLM run.

    Mon_chat_model_start
    —

    Start a trace for a chat model run.

    Mon_chain_start
    —

    Start a trace for a chain run.

    Mon_tool_start
    —

    Start a trace for a tool run.

    Mon_retriever_start
    —

    Run when Retriever starts running.

    Mon_custom_event
    —

    Generate a custom astream event.

    Mconfigure
    —

    Configure the callback manager.

    Inherited fromBaseCallbackManager

    Attributes

    Ahandlers: handlersAinheritable_handlers: inheritable_handlersAparent_run_id: UUID | None
    —

    The ID of the parent run.

    Atags: list[str] | None
    —

    Optional list of tags associated with the retriever.

    Ainheritable_tagsAmetadata: dict[str, Any] | None
    —

    Optional metadata associated with the retriever.

    Ainheritable_metadataAis_async: bool
    —

    Return whether the handler is async.

    Methods

    Madd_handler
    —

    Add a handler to the callback manager.

    Mremove_handler
    —

    Remove a handler from the callback manager.

    Mset_handlers
    —

    Set handlers as the only handlers on the callback manager.

    Mset_handler
    —

    Set handler as the only handler on the callback manager.

    Madd_tags
    —

    Add tags to the callback manager.

    Mremove_tags
    —

    Remove tags from the callback manager.

    Madd_metadata
    —

    Add metadata to the callback manager.

    Mremove_metadata
    —

    Remove metadata from the callback manager.

    Inherited fromCallbackManagerMixin

    Methods

    Mon_llm_start
    —

    Start a trace for a (non-chat model) LLM run.

    Mon_chat_model_start
    —

    Start a trace for a chat model run.

    Mon_retriever_start
    —

    Run when Retriever starts running.

    Mon_chain_start
    —

    Start a trace for a chain run.

    Mon_tool_start
    —

    Start a trace for a tool run.

    View source on GitHub