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

    RunnableBindingBase

    Copy
    RunnableBindingBase(
      self,
      *,
      bound: Runnable[Input, Output],
      kwargs: Mapping

    Bases

    RunnableSerializable[Input, Output]

    Constructors

    Attributes

    Methods

    Inherited fromRunnableSerializable

    Attributes

    Aname: str | None
    —

    The name of the Runnable.

    Methods

    Mto_json
    —

    Serialize the Runnable to JSON.

    Mconfigurable_fields
    —

    Configure particular Runnable fields at runtime.

    View source on GitHub
    [
    str
    ,
    Any
    ]
    |
    None
    =
    None
    ,
    config
    :
    RunnableConfig
    |
    None
    =
    None
    ,
    config_factories
    :
    list
    [
    Callable
    [
    [
    RunnableConfig
    ]
    ,
    RunnableConfig
    ]
    ]
    |
    None
    =
    None
    ,
    custom_input_type
    :
    type
    [
    Input
    ]
    |
    BaseModel
    |
    None
    =
    None
    ,
    custom_output_type
    :
    type
    [
    Output
    ]
    |
    BaseModel
    |
    None
    =
    None
    ,
    **
    other_kwargs
    :
    Any
    =
    {
    }
    )
    M
    configurable_alternatives
    —

    Configure alternatives for Runnable objects that can be set at runtime.

    Inherited fromSerializable

    Attributes

    Alc_secrets: dict[str, str]
    —

    A map of constructor argument names to secret ids.

    Alc_attributes: dict
    —

    List of attribute names that should be included in the serialized kwargs.

    Methods

    Mlc_id
    —

    Return a unique identifier for this class for serialization purposes.

    Mto_json
    —

    Serialize the object to JSON.

    Mto_json_not_implemented
    —

    Serialize a "not implemented" object.

    Inherited fromRunnable

    Attributes

    Aname: str | None
    —

    The name of the Runnable. Used for debugging and tracing.

    Ainput_schema: type[BaseModel]
    —

    The type of input this Runnable accepts specified as a Pydantic model.

    Aoutput_schema: type[BaseModel]
    —

    Output schema.

    Methods

    Mget_input_jsonschema
    —

    Get a JSON schema that represents the input to the Runnable.

    Mget_output_jsonschema
    —

    Get a JSON schema that represents the output of the Runnable.

    Mconfig_schema
    —

    The type of config this Runnable accepts specified as a Pydantic model.

    Mget_config_jsonschema
    —

    Get a JSON schema that represents the config of the Runnable.

    Mget_prompts
    —

    Return a list of prompts used by this Runnable.

    Mpipe
    —

    Pipe Runnable objects.

    Mpick
    —

    Pick keys from the output dict of this Runnable.

    Massign
    —

    Assigns new fields to the dict output of this Runnable.

    Mastream_log
    —

    Stream all output from a Runnable, as reported to the callback system.

    Mbind
    —

    Bind arguments to a Runnable, returning a new Runnable.

    Mwith_config
    —

    Bind config to a Runnable, returning a new Runnable.

    Mwith_listeners
    —

    Bind lifecycle listeners to a Runnable, returning a new Runnable.

    Mwith_alisteners
    —

    Bind async lifecycle listeners to a Runnable.

    Mwith_types
    —

    Bind input and output types to a Runnable, returning a new Runnable.

    Mwith_retry
    —

    Create a new Runnable that retries the original Runnable on exceptions.

    Mmap
    —

    Return a new Runnable that maps a list of inputs to a list of outputs.

    Mwith_fallbacks
    —

    Add fallbacks to a Runnable, returning a new Runnable.

    Mas_tool
    —

    Create a BaseTool from a Runnable.

    Parameters

    NameTypeDescription
    bound*Runnable[Input, Output]

    The underlying Runnable that this Runnable delegates calls to.

    kwargsMapping[str, Any] | None
    Default:None
    configRunnableConfig | None
    Default:None
    config_factorieslist[Callable[[RunnableConfig], RunnableConfig]] | None
    Default:None
    custom_input_typetype[Input] | BaseModel | None
    Default:None
    custom_output_typetype[Output] | BaseModel | None
    Default:None
    **other_kwargsAny
    Default:{}
    constructor
    __init__
    NameType
    boundRunnable[Input, Output]
    kwargsMapping[str, Any] | None
    configRunnableConfig | None
    config_factorieslist[Callable[[RunnableConfig], RunnableConfig]] | None
    custom_input_typetype[Input] | BaseModel | None
    custom_output_typetype[Output] | BaseModel | None
    attribute
    bound: Runnable[Input, Output]

    The underlying Runnable that this Runnable delegates to.

    attribute
    kwargs: Mapping[str, Any]

    kwargs to pass to the underlying Runnable when running.

    For example, when the Runnable binding is invoked the underlying Runnable will be invoked with the same input but with these additional kwargs.

    attribute
    config: RunnableConfig

    The config to bind to the underlying Runnable.

    attribute
    config_factories: list[Callable[[RunnableConfig], RunnableConfig]]

    The config factories to bind to the underlying Runnable.

    attribute
    custom_input_type: Any | None

    Override the input type of the underlying Runnable with a custom type.

    The type can be a Pydantic model, or a type annotation (e.g., list[str]).

    attribute
    custom_output_type: Any | None

    Override the output type of the underlying Runnable with a custom type.

    The type can be a Pydantic model, or a type annotation (e.g., list[str]).

    attribute
    model_config
    attribute
    InputType: type[Input]
    attribute
    OutputType: type[Output]
    attribute
    config_specs: list[ConfigurableFieldSpec]
    method
    get_name
    method
    get_input_schema
    method
    get_output_schema
    method
    get_graph
    method
    is_lc_serializable

    Return True as this class is serializable.

    method
    get_lc_namespace

    Get the namespace of the LangChain object.

    method
    invoke
    method
    ainvoke
    method
    batch
    method
    abatch
    method
    batch_as_completed
    method
    abatch_as_completed
    method
    stream
    method
    astream
    method
    stream_events

    Forward stream_events to the bound runnable with bound kwargs merged.

    For version="v3", the bound runnable's typed stream object (e.g. ChatModelStream) is returned. For version="v1" / "v2", dispatches to the base Runnable.stream_events.

    Without this override, __getattr__ would drop self.kwargs — losing tools bound via bind_tools, stop sequences, etc.

    method
    astream_events

    Forward astream_events to the bound runnable with bound kwargs merged.

    For version="v3", returns an awaitable that resolves to the bound runnable's typed stream object (e.g. AsyncChatModelStream). For version="v1" / "v2", returns an async iterator over StreamEvent items.

    Without this override, __getattr__ would drop self.kwargs — losing tools bound via bind_tools, stop sequences, etc.

    method
    transform
    method
    atransform

    Runnable that delegates calls to another Runnable with a set of **kwargs.

    Use only if creating a new RunnableBinding subclass with different __init__ args.

    See documentation for RunnableBinding for more details.

    optional kwargs to pass to the underlying Runnable, when running the underlying Runnable (e.g., via invoke, batch, transform, or stream or async variants)

    optional config to bind to the underlying Runnable.

    optional list of config factories to apply to the config before binding to the underlying Runnable.

    Specify to override the input type of the underlying Runnable with a custom type.

    Specify to override the output type of the underlying Runnable with a custom type.

    Unpacked into the base class.