mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-26 08:33:49 +00:00
core[patch]: add to RunnableLambda docstring (#24575)
Explain behavior when function returns a runnable.
This commit is contained in:
parent
ee3955c68c
commit
2d6b0bf3e3
@ -3999,11 +3999,14 @@ class RunnableLambda(Runnable[Input, Output]):
|
|||||||
RunnableLambda can be composed as any other Runnable and provides
|
RunnableLambda can be composed as any other Runnable and provides
|
||||||
seamless integration with LangChain tracing.
|
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
|
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.
|
instead.
|
||||||
|
|
||||||
|
Note that if a ``RunnableLambda`` returns an instance of ``Runnable``, that
|
||||||
|
instance is invoked (or streamed) during execution.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
Loading…
Reference in New Issue
Block a user