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,
)
| 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, |