Skip to content

Commit

Permalink
docs: clarify streaming with RunnableLambda (#23228)
Browse files Browse the repository at this point in the history
  • Loading branch information
ccurme authored and hinthornw committed Jun 20, 2024
1 parent 2cf9210 commit 412cd3f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/docs/how_to/functions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,11 @@
"id": "922b48bd",
"metadata": {},
"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",
"You can use generator functions (ie. functions that use the `yield` keyword, and behave like iterators) in a chain.\n",
"\n",
Expand Down

0 comments on commit 412cd3f

Please sign in to comment.