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-corerunnablesconfig
    Module●Since v0.1

    config

    Configuration utilities for Runnable objects.

    Attributes

    Functions

    Classes

    Type Aliases

    View source on GitHub
    attribute
    Input
    attribute
    Output
    attribute
    CONFIG_KEYS: list
    attribute
    COPIABLE_KEYS: list
    attribute
    CONFIGURABLE_TO_TRACING_METADATA_EXCLUDED_KEYS
    attribute
    DEFAULT_RECURSION_LIMIT: int
    attribute
    var_child_runnable_config: ContextVar[RunnableConfig | None]
    attribute
    P
    attribute
    T
    function
    accepts_config
    function
    accepts_run_manager
    function
    set_config_context
    function
    ensure_config
    function
    get_config_list
    function
    patch_config
    function
    merge_configs
    function
    call_func_with_variable_args
    function
    acall_func_with_variable_args
    function
    get_callback_manager_for_config
    function
    get_async_callback_manager_for_config
    function
    get_executor_for_config
    function
    run_in_executor
    class
    AsyncCallbackManager
    class
    CallbackManager
    class
    BaseCallbackManager
    class
    AsyncCallbackManagerForChainRun
    class
    CallbackManagerForChainRun
    class
    EmptyDict
    class
    RunnableConfig
    class
    ContextThreadPoolExecutor
    typeAlias
    Callbacks: list[BaseCallbackHandler] | BaseCallbackManager | None

    Check if a callable accepts a config argument.

    Check if a callable accepts a run_manager argument.

    Set the child Runnable config + tracing context.

    Ensure that a config is a dict with all keys present.

    Get a list of configs from a single config or a list of configs.

    It is useful for subclasses overriding batch() or abatch().

    Patch a config with new values.

    Merge multiple configs into one.

    Call function that may optionally accept a run_manager and/or config.

    Async call function that may optionally accept a run_manager and/or config.

    Get a callback manager for a config.

    Get an async callback manager for a config.

    Get an executor for a config.

    Run a function in an executor.

    Async callback manager that handles callbacks from LangChain.

    Callback manager for LangChain.

    Base callback manager.

    Async callback manager for chain run.

    Callback manager for chain run.

    Empty dict type.

    ThreadPoolExecutor that copies the context to the child thread.

    Configuration for a Runnable.

    Note

    Custom values

    The TypedDict has total=False set intentionally to:

    • Allow partial configs to be created and merged together via merge_configs
    • Support config propagation from parent to child runnables via var_child_runnable_config (a ContextVar that automatically passes config down the call stack without explicit parameter passing), where configs are merged rather than replaced
    Example
    # Parent sets tags
    chain.invoke(input, config={"tags": ["parent"]})
    # Child automatically inherits and can add:
    # ensure_config({"tags": ["child"]}) -> {"tags": ["parent", "child"]}