mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-10 05:20:39 +00:00
pipe default key (#11788)
This commit is contained in:
parent
6e78dacd78
commit
f3ad22e64a
@ -992,6 +992,7 @@ class RunnableSerializable(Serializable, Runnable[Input, Output]):
|
|||||||
def configurable_alternatives(
|
def configurable_alternatives(
|
||||||
self,
|
self,
|
||||||
which: ConfigurableField,
|
which: ConfigurableField,
|
||||||
|
default_key: str = "default",
|
||||||
**kwargs: Runnable[Input, Output],
|
**kwargs: Runnable[Input, Output],
|
||||||
) -> RunnableSerializable[Input, Output]:
|
) -> RunnableSerializable[Input, Output]:
|
||||||
from langchain.schema.runnable.configurable import (
|
from langchain.schema.runnable.configurable import (
|
||||||
@ -999,7 +1000,7 @@ class RunnableSerializable(Serializable, Runnable[Input, Output]):
|
|||||||
)
|
)
|
||||||
|
|
||||||
return RunnableConfigurableAlternatives(
|
return RunnableConfigurableAlternatives(
|
||||||
which=which, default=self, alternatives=kwargs
|
which=which, default=self, alternatives=kwargs, default_key=default_key
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user