MCPcopy
hub / github.com/langchain-ai/langchain / with_config

Method with_config

libs/core/langchain_core/runnables/base.py:1255–1271  ·  view source on GitHub ↗

Bind config to a Runnable, returning a new Runnable.

(
        self,
        config: Optional[RunnableConfig] = None,
        # Sadly Unpack is not well supported by mypy so this will have to be untyped
        **kwargs: Any,
    )

Source from the content-addressed store, hash-verified

1253 return RunnableBinding(bound=self, kwargs=kwargs, config={})
1254
1255 def with_config(
1256 self,
1257 config: Optional[RunnableConfig] = None,
1258 # Sadly Unpack is not well supported by mypy so this will have to be untyped
1259 **kwargs: Any,
1260 ) -> Runnable[Input, Output]:
1261 """
1262 Bind config to a Runnable, returning a new Runnable.
1263 """
1264 return RunnableBinding(
1265 bound=self,
1266 config=cast(
1267 RunnableConfig,
1268 {**(config or {}), **kwargs},
1269 ), # type: ignore[misc]
1270 kwargs={},
1271 )
1272
1273 def with_listeners(
1274 self,

Callers 15

chain.pyFile · 0.45
chain.pyFile · 0.45
chain.pyFile · 0.45
main.pyFile · 0.45
chain.pyFile · 0.45
chain.pyFile · 0.45
chain.pyFile · 0.45
chain.pyFile · 0.45
test_config_passthroughFunction · 0.45

Calls 1

RunnableBindingClass · 0.85