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

    utils

    Utility code for Runnable objects.

    Attributes

    Functions

    Classes

    Type Aliases

    View source on GitHub
    attribute
    Input
    attribute
    Output
    attribute
    Addable
    function
    create_model
    function
    gated_coro
    function
    gather_with_concurrency
    function
    accepts_run_manager
    function
    accepts_config
    function
    accepts_context
    function
    asyncio_accepts_context
    function
    coro_with_context
    function
    get_function_first_arg_dict_keys
    function
    get_lambda_source
    function
    get_function_nonlocals
    function
    indent_lines_after_first
    function
    add
    function
    aadd
    function
    get_unique_config_specs
    function
    is_async_generator
    function
    is_async_callable
    class
    IsLocalDict
    class
    IsFunctionArgDict
    class
    NonLocals
    class
    FunctionNonLocals
    class
    GetLambdaSource
    class
    AddableDict
    class
    SupportsAdd
    class
    ConfigurableField
    class
    ConfigurableFieldSingleOption
    class
    ConfigurableFieldMultiOption
    class
    ConfigurableFieldSpec
    typeAlias
    StreamEvent
    typeAlias
    AnyConfigurableField

    Create a Pydantic model with the given field definitions.

    Please use create_model_v2 instead of this function.

    Run a coroutine with a semaphore.

    Gather coroutines with a limit on the number of concurrent coroutines.

    Check if a callable accepts a run_manager argument.

    Check if a callable accepts a config argument.

    Check if a callable accepts a context argument.

    Check if asyncio.create_task accepts a context arg.

    Await a coroutine with a context.

    Get the keys of the first argument of a function if it is a dict.

    Get the source code of a lambda function.

    Get the nonlocal variables accessed by a function.

    Indent all lines of text after the first line.

    Add a sequence of addable objects together.

    Asynchronously add a sequence of addable objects together.

    Get the unique config specs from a sequence of config specs.

    Check if a function is an async generator.

    Check if a function is async.

    Check if a name is a local dict.

    Check if the first argument of a function is a dict.

    Get nonlocal variables accessed.

    Get the nonlocal variables accessed of a function.

    Get the source code of a lambda function.

    Dictionary that can be added to another dictionary.

    Protocol for objects that support addition.

    Field that can be configured by the user.

    Field that can be configured by the user with a default value.

    Field that can be configured by the user with multiple default values.

    Field that can be configured by the user. It is a specification of a field.