docs: add more streaming how-tos (#803)

This commit is contained in:
Vadym Barda
2024-06-25 13:15:53 -04:00
committed by GitHub
parent 09b0af0630
commit 97ccdd92b9
14 changed files with 668 additions and 23 deletions
@@ -29,7 +29,7 @@
"id": "323db423-b644-40bd-9c2d-976a53f602f7",
"metadata": {},
"source": [
"We'll be using a simple ReAct agent for this tutorial. You will also need to set up a project with `agent.py` and `langgraph.json` files. See [quick start](https://langchain-ai.github.io/langgraph/cloud/quick_start/#develop) for setting this up."
"We'll be using a simple ReAct agent for this how-to guide. You will also need to set up a project with `agent.py` and `langgraph.json` files. See [quick start](https://langchain-ai.github.io/langgraph/cloud/quick_start/#develop) for setting this up."
]
},
{
+2 -2
View File
@@ -4,8 +4,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# How to Stream Debug Events\n",
"This notebook covers how to stream debug events from your graph (`stream_mode=\"debug\"`)."
"# How to stream debug events\n",
"This guide covers how to stream debug events from your graph (`stream_mode=\"debug\"`)."
]
},
{
+2 -2
View File
@@ -4,8 +4,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# How to Stream Events\n",
"This notebook covers how to stream events from your graph (`stream_mode=\"events\"`). Depending on the use case and user experience of your LangGraph application, your application may process event types differently."
"# How to stream events\n",
"This guide covers how to stream events from your graph (`stream_mode=\"events\"`). Depending on the use case and user experience of your LangGraph application, your application may process event types differently."
]
},
{
@@ -7,14 +7,14 @@
"source": [
"# How to stream messages from your graph\n",
"\n",
"There are multiple different streaming modes.\n",
"LangGraph Cloud supports multiple streaming modes. The main ones are:\n",
"\n",
"- `values`: This streaming mode streams back values of the graph. This is the **full state of the graph** after each node is called.\n",
"- `updates`: This streaming mode streams back updates to the graph. This is the **update to the state of the graph** after each node is called.\n",
"- `messages`: This streaming mode streams back messages - both complete messages (at the end of a node) as well as **tokens** for any messages generated inside a node. This mode is primarily meant for powering chat applications.\n",
"\n",
"\n",
"This notebook covers `stream_mode=\"messages\"`.\n",
"This guide covers `stream_mode=\"messages\"`.\n",
"\n",
"In order to use this mode, the state of the graph you are interacting with MUST have a messages key that is a list of messages.\n",
"Eg, the state should look something like:\n",
@@ -4,9 +4,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# How to Configure Multiple Streaming Modes at the Same Time\n",
"# How to configure multiple streaming modes at the same time\n",
"\n",
"This notebook covers how to configure multiple streaming modes at the same time."
"This guide covers how to configure multiple streaming modes at the same time."
]
},
{
+4 -4
View File
@@ -5,16 +5,16 @@
"id": "51466c8d-8ce4-4b3d-be4e-18fdbeda5f53",
"metadata": {},
"source": [
"# How to stream updates from your graph\n",
"# How to stream state updates of your graph\n",
"\n",
"There are multiple different streaming modes.\n",
"LangGraph Cloud supports multiple streaming modes. The main ones are:\n",
"\n",
"- `values`: This streaming mode streams back values of the graph. This is the **full state of the graph** after each node is called.\n",
"- `updates`: This streaming mode streams back updates to the graph. This is the **update to the state of the graph** after each node is called.\n",
"- `messages`: This streaming mode streams back messages - both complete messages (at the end of a node) as well as **tokens** for any messages generated inside a node. This mode is primarily meant for powering chat applications.\n",
"\n",
"\n",
"This notebook covers `stream_mode=\"updates\"`."
"This guide covers `stream_mode=\"updates\"`."
]
},
{
@@ -170,7 +170,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
"version": "3.12.3"
}
},
"nbformat": 4,
+4 -4
View File
@@ -5,16 +5,16 @@
"id": "51466c8d-8ce4-4b3d-be4e-18fdbeda5f53",
"metadata": {},
"source": [
"# How to stream values from your graph\n",
"# How to stream full state of your graph\n",
"\n",
"There are multiple different streaming modes.\n",
"LangGraph Cloud supports multiple streaming modes. The main ones are:\n",
"\n",
"- `values`: This streaming mode streams back values of the graph. This is the **full state of the graph** after each node is called.\n",
"- `updates`: This streaming mode streams back updates to the graph. This is the **update to the state of the graph** after each node is called.\n",
"- `messages`: This streaming mode streams back messages - both complete messages (at the end of a node) as well as **tokens** for any messages generated inside a node. This mode is primarily meant for powering chat applications.\n",
"\n",
"\n",
"This notebook covers `stream_mode=\"values\"`."
"This guide covers `stream_mode=\"values\"`."
]
},
{
@@ -204,7 +204,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
"version": "3.12.3"
}
},
"nbformat": 4,