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

    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.

    Copy
    RunnableBindingBase(
      self,
      *,
      bound: Runnable[Input, Output],
      kwargs: Mapping[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 = {}
    )

    Bases

    RunnableSerializable[Input, Output]

    Parameters

    NameTypeDescription
    bound*Runnable[Input, Output]

    The underlying Runnable that this Runnable delegates calls to.

    kwargsMapping[str, Any] | None
    Default:None

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

    configRunnableConfig | None
    Default:None

    optional config to bind to the underlying Runnable.

    config_factorieslist[Callable[[RunnableConfig], RunnableConfig]] | None
    Default:None

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

    custom_input_typetype[Input] | BaseModel | None
    Default:None

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

    custom_output_typetype[Output] | BaseModel | None
    Default:None

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

    **other_kwargsAny
    Default:{}

    Unpacked into the base class.

    Constructors

    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

    Attributes

    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]

    Methods

    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
    astream_events
    method
    transform
    method
    atransform

    Inherited fromRunnableSerializable

    Attributes

    Aname: str
    —

    The name of the function.

    Methods

    Mto_json
    —

    Convert the graph to a JSON-serializable format.

    Mconfigurable_fieldsMconfigurable_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
    —

    Convert the graph to a JSON-serializable format.

    Mto_json_not_implemented
    —

    Serialize a "not implemented" object.

    Inherited fromRunnable

    Attributes

    Aname: str
    —

    The name of the function.

    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
    —

    Merge the Dict input with the output produced by the mapping argument.

    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_configMwith_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
    —

    Map a function to multiple iterables.

    Mwith_fallbacks
    —

    Add fallbacks to a Runnable, returning a new Runnable.

    Mas_tool
    —

    Create a BaseTool from a Runnable.

    View source on GitHub