From b2b94424db783397b6788c7fbdf8f04b0d5b7a8e Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Fri, 10 Nov 2023 09:52:38 +0000 Subject: [PATCH] Update return type for Runnable.__or__ (#12880) --- libs/langchain/langchain/schema/runnable/base.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/langchain/langchain/schema/runnable/base.py b/libs/langchain/langchain/schema/runnable/base.py index b99fce2c836f4..39c99d14637d9 100644 --- a/libs/langchain/langchain/schema/runnable/base.py +++ b/libs/langchain/langchain/schema/runnable/base.py @@ -258,7 +258,7 @@ def __or__( Callable[[Iterator[Any]], Iterator[Other]], Mapping[str, Union[Runnable[Any, Other], Callable[[Any], Other], Any]], ], - ) -> Runnable[Input, Other]: + ) -> RunnableSerializable[Input, Other]: """Compose this runnable with another object to create a RunnableSequence.""" return RunnableSequence(first=self, last=coerce_to_runnable(other)) @@ -270,7 +270,7 @@ def __ror__( Callable[[Iterator[Other]], Iterator[Any]], Mapping[str, Union[Runnable[Other, Any], Callable[[Other], Any], Any]], ], - ) -> Runnable[Other, Output]: + ) -> RunnableSerializable[Other, Output]: """Compose this runnable with another object to create a RunnableSequence.""" return RunnableSequence(first=coerce_to_runnable(other), last=self) @@ -1162,7 +1162,7 @@ def __or__( Callable[[Iterator[Any]], Iterator[Other]], Mapping[str, Union[Runnable[Any, Other], Callable[[Any], Other], Any]], ], - ) -> Runnable[Input, Other]: + ) -> RunnableSerializable[Input, Other]: if isinstance(other, RunnableSequence): return RunnableSequence( first=self.first, @@ -1184,7 +1184,7 @@ def __ror__( Callable[[Iterator[Other]], Iterator[Any]], Mapping[str, Union[Runnable[Other, Any], Callable[[Other], Any], Any]], ], - ) -> Runnable[Other, Output]: + ) -> RunnableSerializable[Other, Output]: if isinstance(other, RunnableSequence): return RunnableSequence( first=other.first,