mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
docs: clarify streaming with RunnableLambda (#23228)
This commit is contained in:
parent
bf7763d9b0
commit
abb3066150
@ -300,7 +300,11 @@
|
|||||||
"id": "922b48bd",
|
"id": "922b48bd",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"# Streaming\n",
|
"## Streaming\n",
|
||||||
|
"\n",
|
||||||
|
":::{.callout-note}\n",
|
||||||
|
"[RunnableLambda](https://api.python.langchain.com/en/latest/runnables/langchain_core.runnables.base.RunnableLambda.html) 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](https://api.python.langchain.com/en/latest/runnables/langchain_core.runnables.base.RunnableGenerator.html) instead as in the example below.\n",
|
||||||
|
":::\n",
|
||||||
"\n",
|
"\n",
|
||||||
"You can use generator functions (ie. functions that use the `yield` keyword, and behave like iterators) in a chain.\n",
|
"You can use generator functions (ie. functions that use the `yield` keyword, and behave like iterators) in a chain.\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user