diff --git a/libs/langchain/langchain/schema/runnable/base.py b/libs/langchain/langchain/schema/runnable/base.py index afce1201e184c..51365bd0e1f82 100644 --- a/libs/langchain/langchain/schema/runnable/base.py +++ b/libs/langchain/langchain/schema/runnable/base.py @@ -992,6 +992,7 @@ def configurable_fields( def configurable_alternatives( self, which: ConfigurableField, + default_key: str = "default", **kwargs: Runnable[Input, Output], ) -> RunnableSerializable[Input, Output]: from langchain.schema.runnable.configurable import ( @@ -999,7 +1000,7 @@ def configurable_alternatives( ) return RunnableConfigurableAlternatives( - which=which, default=self, alternatives=kwargs + which=which, default=self, alternatives=kwargs, default_key=default_key )