From f3ad22e64ac0b3c47b9ac9737da0e8c4e3eaf49b Mon Sep 17 00:00:00 2001 From: Harrison Chase Date: Sat, 14 Oct 2023 00:39:23 -0700 Subject: [PATCH] pipe default key (#11788) --- libs/langchain/langchain/schema/runnable/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 )