diff --git a/libs/core/langchain_core/runnables/base.py b/libs/core/langchain_core/runnables/base.py index 16e3581b707..c05aef70f99 100644 --- a/libs/core/langchain_core/runnables/base.py +++ b/libs/core/langchain_core/runnables/base.py @@ -3999,11 +3999,14 @@ 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 + ``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` + on chunks of inputs and yield chunks of outputs), use ``RunnableGenerator`` instead. + Note that if a ``RunnableLambda`` returns an instance of ``Runnable``, that + instance is invoked (or streamed) during execution. + Examples: .. code-block:: python