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-corecallbacksbaseBaseCallbackManager
    Class●Since v0.1

    BaseCallbackManager

    Base callback manager.

    Copy
    BaseCallbackManager(
      self,
      handlers: list[BaseCallbackHandler],
      inheritable_handlers: list[BaseCallbackHandler] | None = None,
      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
    )

    Bases

    CallbackManagerMixin

    Parameters

    NameTypeDescription
    handlers*list[BaseCallbackHandler]

    The handlers.

    inheritable_handlerslist[BaseCallbackHandler] | None
    Default:None

    The inheritable handlers.

    parent_run_idUUID | None
    Default:None

    The parent run ID.

    tagslist[str] | None
    Default:None

    The tags.

    inheritable_tagslist[str] | None
    Default:None

    The inheritable tags.

    metadatadict[str, Any] | None
    Default:None

    The metadata.

    inheritable_metadatadict[str, Any] | None
    Default:None

    The inheritable metadata.

    Constructors

    constructor
    __init__
    NameType
    handlerslist[BaseCallbackHandler]
    inheritable_handlerslist[BaseCallbackHandler] | None
    parent_run_idUUID | None
    tagslist[str] | None
    inheritable_tagslist[str] | None
    metadatadict[str, Any] | None
    inheritable_metadatadict[str, Any] | None

    Attributes

    attribute
    handlers: list[BaseCallbackHandler]
    attribute
    inheritable_handlers: list[BaseCallbackHandler]
    attribute
    parent_run_id: UUID | None
    attribute
    tags
    attribute
    inheritable_tags
    attribute
    metadata
    attribute
    inheritable_metadata
    attribute
    is_async: bool

    Whether the callback manager is async.

    Methods

    method
    copy

    Return a copy of the callback manager.

    method
    merge

    Merge the callback manager with another callback manager.

    May be overwritten in subclasses.

    Primarily used internally within merge_configs.

    method
    add_handler

    Add a handler to the callback manager.

    method
    remove_handler

    Remove a handler from the callback manager.

    method
    set_handlers

    Set handlers as the only handlers on the callback manager.

    method
    set_handler

    Set handler as the only handler on the callback manager.

    method
    add_tags

    Add tags to the callback manager.

    method
    remove_tags

    Remove tags from the callback manager.

    method
    add_metadata

    Add metadata to the callback manager.

    method
    remove_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