mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-25 17:12:26 +02:00
lint
This commit is contained in:
@@ -103,8 +103,10 @@
|
||||
"class State(TypedDict):\n",
|
||||
" foo: str\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"# Define the nodes\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"def node_a(state: State) -> GraphCommand[Literal[\"node_b\", \"node_c\"]]:\n",
|
||||
" print(\"Called A\")\n",
|
||||
" value = random.choice([\"a\", \"b\"])\n",
|
||||
@@ -119,16 +121,19 @@
|
||||
" # this is the state update\n",
|
||||
" update={\"foo\": value},\n",
|
||||
" # this is a replacement for an edge\n",
|
||||
" goto=goto\n",
|
||||
" goto=goto,\n",
|
||||
" )\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"# Nodes B and C are unchanged\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"def node_b(state: State):\n",
|
||||
" print(\"Called B\")\n",
|
||||
" # graph command can also be used \n",
|
||||
" # graph command can also be used\n",
|
||||
" return {\"foo\": state[\"foo\"] + \"b\"}\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"def node_c(state: State):\n",
|
||||
" print(\"Called C\")\n",
|
||||
" return {\"foo\": state[\"foo\"] + \"c\"}"
|
||||
@@ -188,6 +193,7 @@
|
||||
],
|
||||
"source": [
|
||||
"from IPython.display import display, Image\n",
|
||||
"\n",
|
||||
"display(Image(graph.get_graph().draw_mermaid_png()))"
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user