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

    AsyncCallbackManager

    Async callback manager that handles callbacks from LangChain.

    Copy
    AsyncCallbackManager(
      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

    BaseCallbackManager

    Attributes

    attribute
    is_async: bool

    Return whether the handler is async.

    Methods

    method
    on_llm_start

    Run when LLM starts running.

    method
    on_chat_model_start

    Async run when LLM starts running.

    method
    on_chain_start

    Async run when chain starts running.

    method
    on_tool_start

    Run when the tool starts running.

    method
    on_custom_event

    Dispatch an adhoc event to the handlers (async version).

    This event should NOT be used in any internal LangChain code. The event is meant specifically for users of the library to dispatch custom events that are tailored to their application.

    method
    on_retriever_start

    Run when the retriever starts running.

    method
    configure

    Configure the async 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_metadata

    Methods

    Mcopy
    —

    Return a copy of the edge with optional new source and target nodes.

    Mmerge
    —

    Merge the group callback manager with another callback manager.

    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.

    View source on GitHub