From 59d7adff8f9e15dd58a66df7dd8ff9d15b4546c0 Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Thu, 20 Jun 2024 12:47:16 -0400 Subject: [PATCH] core[patch]: Add clarification about streaming to RunnableLambda (#23227) Add streaming clarification to runnable lambda docstring. --- libs/core/langchain_core/runnables/base.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/core/langchain_core/runnables/base.py b/libs/core/langchain_core/runnables/base.py index 8c36967b6e..3a231fdee4 100644 --- a/libs/core/langchain_core/runnables/base.py +++ b/libs/core/langchain_core/runnables/base.py @@ -3576,6 +3576,11 @@ class RunnableLambda(Runnable[Input, Output]): RunnableLambda can be composed as any other Runnable and provides seamless integration with LangChain tracing. + `RunnableLambda` is best suited for code that does not need to support + streaming. If you need to support streaming (i.e., be able to operate + on chunks of inputs and yield chunks of outputs), use `RunnableGenerator` + instead. + Examples: .. code-block:: python