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

    attribute
    Input
    attribute
    Output
    attribute
    Addable

    Functions

    function
    create_model

    Create a Pydantic model with the given field definitions.

    Please use create_model_v2 instead of this function.

    function
    gated_coro

    Run a coroutine with a semaphore.

    function
    gather_with_concurrency

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

    function
    accepts_run_manager

    Check if a callable accepts a run_manager argument.

    function
    accepts_config

    Check if a callable accepts a config argument.

    function
    accepts_context

    Check if a callable accepts a context argument.

    function
    asyncio_accepts_context

    Check if asyncio.create_task accepts a context arg.

    function
    coro_with_context

    Await a coroutine with a context.

    function
    get_function_first_arg_dict_keys

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

    function
    get_lambda_source

    Get the source code of a lambda function.

    function
    get_function_nonlocals

    Get the nonlocal variables accessed by a function.

    function
    indent_lines_after_first

    Indent all lines of text after the first line.

    function
    add

    Add a sequence of addable objects together.

    function
    aadd

    Asynchronously add a sequence of addable objects together.

    function
    get_unique_config_specs

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

    function
    is_async_generator

    Check if a function is an async generator.

    function
    is_async_callable

    Check if a function is async.

    Classes

    class
    IsLocalDict

    Check if a name is a local dict.

    class
    IsFunctionArgDict

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

    class
    NonLocals

    Get nonlocal variables accessed.

    class
    FunctionNonLocals

    Get the nonlocal variables accessed of a function.

    class
    GetLambdaSource

    Get the source code of a lambda function.

    class
    AddableDict

    Dictionary that can be added to another dictionary.

    class
    SupportsAdd

    Protocol for objects that support addition.

    class
    ConfigurableField

    Field that can be configured by the user.

    class
    ConfigurableFieldSingleOption

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

    class
    ConfigurableFieldMultiOption

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

    class
    ConfigurableFieldSpec

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

    Type Aliases

    typeAlias
    StreamEvent
    typeAlias
    AnyConfigurableField
    View source on GitHub