Skip to content

Commit 6310dc6

Browse files
committed
docs(notebook): update subgraph notebooks
- Clear all outputs for clean execution on subgraph-persistence.ipynb - Clear all outputs for clean execution on subgraphs-manage-state.ipynb - Ready for end-to-end execution with Redis checkpoint
1 parent e872a04 commit 6310dc6

File tree

2 files changed

+70
-454
lines changed

2 files changed

+70
-454
lines changed

examples/subgraph-persistence.ipynb

Lines changed: 15 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
},
4848
{
4949
"cell_type": "code",
50-
"execution_count": 1,
50+
"execution_count": null,
5151
"id": "77d1eafa-3252-45f6-9af0-d94e1f9c5c9e",
5252
"metadata": {},
5353
"outputs": [],
@@ -105,21 +105,10 @@
105105
},
106106
{
107107
"cell_type": "code",
108-
"execution_count": 2,
108+
"execution_count": null,
109109
"id": "0d76f0c0-bd77-4eca-9527-27bcdf85dd42",
110110
"metadata": {},
111-
"outputs": [
112-
{
113-
"data": {
114-
"text/plain": [
115-
"<langgraph.graph.state.StateGraph at 0xffff91ca9490>"
116-
]
117-
},
118-
"execution_count": 2,
119-
"metadata": {},
120-
"output_type": "execute_result"
121-
}
122-
],
111+
"outputs": [],
123112
"source": [
124113
"from typing import TypedDict\n",
125114
"\n",
@@ -179,18 +168,10 @@
179168
},
180169
{
181170
"cell_type": "code",
182-
"execution_count": 3,
171+
"execution_count": null,
183172
"id": "7657d285-c896-40c9-a569-b4a3b9c230c7",
184173
"metadata": {},
185-
"outputs": [
186-
{
187-
"name": "stdout",
188-
"output_type": "stream",
189-
"text": [
190-
"19:48:39 langgraph.checkpoint.redis INFO Redis client is a standalone client\n"
191-
]
192-
}
193-
],
174+
"outputs": [],
194175
"source": [
195176
"from langgraph.checkpoint.redis import RedisSaver\n",
196177
"\n",
@@ -224,7 +205,7 @@
224205
},
225206
{
226207
"cell_type": "code",
227-
"execution_count": 4,
208+
"execution_count": null,
228209
"id": "13da686e-6ed6-4b83-93e8-1631fcc8c2a9",
229210
"metadata": {},
230211
"outputs": [],
@@ -234,21 +215,10 @@
234215
},
235216
{
236217
"cell_type": "code",
237-
"execution_count": 5,
218+
"execution_count": null,
238219
"id": "8721f045-2e82-4bf0-9d85-5ba6ecf899d6",
239220
"metadata": {},
240-
"outputs": [
241-
{
242-
"name": "stdout",
243-
"output_type": "stream",
244-
"text": [
245-
"{'node_1': {'foo': 'hi! foo'}}\n",
246-
"{'subgraph_node_1': {'bar': 'bar'}}\n",
247-
"{'subgraph_node_2': {'foo': 'hi! foobar'}}\n",
248-
"{'node_2': {'foo': 'hi! foobar'}}\n"
249-
]
250-
}
251-
],
221+
"outputs": [],
252222
"source": [
253223
"for _, chunk in graph.stream({\"foo\": \"foo\"}, config, subgraphs=True):\n",
254224
" print(chunk)"
@@ -264,21 +234,10 @@
264234
},
265235
{
266236
"cell_type": "code",
267-
"execution_count": 6,
237+
"execution_count": null,
268238
"id": "3e817283-142d-4fda-8cb1-8de34717f833",
269239
"metadata": {},
270-
"outputs": [
271-
{
272-
"data": {
273-
"text/plain": [
274-
"{'foo': 'hi! foobar'}"
275-
]
276-
},
277-
"execution_count": 6,
278-
"metadata": {},
279-
"output_type": "execute_result"
280-
}
281-
],
240+
"outputs": [],
282241
"source": [
283242
"graph.get_state(config).values"
284243
]
@@ -298,7 +257,7 @@
298257
},
299258
{
300259
"cell_type": "code",
301-
"execution_count": 7,
260+
"execution_count": null,
302261
"id": "e896628f-36b2-45eb-b7c5-c64c1098f328",
303262
"metadata": {},
304263
"outputs": [],
@@ -318,44 +277,21 @@
318277
},
319278
{
320279
"cell_type": "code",
321-
"execution_count": 8,
280+
"execution_count": null,
322281
"id": "21e96df3-946d-40f8-8d6d-055ae4177452",
323282
"metadata": {},
324-
"outputs": [
325-
{
326-
"data": {
327-
"text/plain": [
328-
"{'configurable': {'thread_id': '1',\n",
329-
" 'checkpoint_ns': 'node_2:a17a6508-101f-059f-10ae-100a6b79cc4c'}}"
330-
]
331-
},
332-
"execution_count": 8,
333-
"metadata": {},
334-
"output_type": "execute_result"
335-
}
336-
],
283+
"outputs": [],
337284
"source": [
338285
"subgraph_config = state_with_subgraph.tasks[0].state\n",
339286
"subgraph_config"
340287
]
341288
},
342289
{
343290
"cell_type": "code",
344-
"execution_count": 9,
291+
"execution_count": null,
345292
"id": "1d2401b3-d52b-4895-a5d1-dccf015ba216",
346293
"metadata": {},
347-
"outputs": [
348-
{
349-
"data": {
350-
"text/plain": [
351-
"{'foo': 'hi! foobar', 'bar': 'bar'}"
352-
]
353-
},
354-
"execution_count": 9,
355-
"metadata": {},
356-
"output_type": "execute_result"
357-
}
358-
],
294+
"outputs": [],
359295
"source": [
360296
"graph.get_state(subgraph_config).values"
361297
]

0 commit comments

Comments
 (0)