Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions 13-LangChain-Expression-Language/09-Generator.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
"\n",
"## Overview\n",
"\n",
"This tutorial demonstrates how to use a **user-defined generator** (or async generator) in a LangChain pipeline to process text outputs in a streaming fashion. Specifically, we’ll show how to parse a comma-separated string output into a Python list, all while maintaining the benefits of streaming from a Language Model.\n",
"This tutorial demonstrates how to use a **user-defined generator** (or async generator) in a `LangChain` pipeline to process text outputs in a streaming fashion. Specifically, we’ll show how to parse a comma-separated string output into a Python list, all while maintaining the benefits of streaming from a Language Model.\n",
"\n",
"We will also cover asynchronous usage, showing how to adopt the same approach with async generators. By the end of this tutorial, you’ll be able to:\n",
"\n",
"Implement a custom generator function that can handle streaming outputs\n",
"Parse comma-separated text chunks into a list in real time\n",
"Use both synchronous and asynchronous approaches for streaming\n",
"Integrate these parsers in a LangChain chain\n",
"Integrate these parsers in a `LangChain` chain\n",
"Optionally, explore how `RunnableGenerator` can help implement custom generator transformations in a streaming context\n",
"\n",
"### Table of Contents\n",
Expand Down Expand Up @@ -392,8 +392,8 @@
"\n",
"### Why Use `RunnableGenerator`?\n",
"- Modularity: Easily encapsulate your parsing logic as a “runnable” component.\n",
"- Consistency: The `RunnableGenerator` interface (`invoke`, `stream`, `ainvoke`, `astream`) is consistent with other LangChain runnables.\n",
"- Extendability: Combine multiple runnables (e.g., `RunnableLambda`, `RunnableGenerator`) in sequence for more complex transformations. "
"- Consistency: The `RunnableGenerator` interface ( `invoke` , `stream` , `ainvoke` , `astream` ) is consistent with other LangChain runnables.\n",
"- Extendability: Combine multiple runnables (e.g., `RunnableLambda` , `RunnableGenerator` ) in sequence for more complex transformations. "
]
},
{
Expand Down
Loading