mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-22 15:42:25 +02:00
Merge pull request #163 from langchain-ai/nc/29feb/draw-cond-edge-end
Draw end edge for cond edge without mapping
This commit is contained in:
@@ -257,7 +257,10 @@ class CompiledGraph(Pregel):
|
||||
name,
|
||||
)
|
||||
graph.add_edge(graph.nodes[start], graph.nodes[name])
|
||||
ends = branch.ends or {k: k for k in self.graph.nodes}
|
||||
ends = branch.ends or {
|
||||
**{k: k for k in self.graph.nodes},
|
||||
END: END,
|
||||
}
|
||||
for label, end in ends.items():
|
||||
graph.add_edge(graph.nodes[name], graph.nodes[end], label)
|
||||
if self.graph.entry_point_branch:
|
||||
|
||||
@@ -95,6 +95,11 @@
|
||||
"target": "right",
|
||||
"data": "right"
|
||||
},
|
||||
{
|
||||
"source": "left_<lambda>",
|
||||
"target": "__end__",
|
||||
"data": "__end__"
|
||||
},
|
||||
{
|
||||
"source": "__start__",
|
||||
"target": "__start___condition"
|
||||
@@ -115,39 +120,39 @@
|
||||
# ---
|
||||
# name: test_conditional_entrypoint_graph.3
|
||||
'''
|
||||
+-----------+
|
||||
| __start__ |
|
||||
+-----------+
|
||||
*
|
||||
*
|
||||
*
|
||||
+---------------------+
|
||||
| __start___condition |
|
||||
+---------------------+
|
||||
*** ***
|
||||
* *
|
||||
** ***
|
||||
+------+ *
|
||||
| left | *
|
||||
+------+ *
|
||||
* *
|
||||
* *
|
||||
* *
|
||||
+---------------+ *
|
||||
| left_<lambda> | ***
|
||||
+---------------+ *
|
||||
*** ***
|
||||
* *
|
||||
** **
|
||||
+-------+
|
||||
| right |
|
||||
+-------+
|
||||
*
|
||||
*
|
||||
*
|
||||
+---------+
|
||||
| __end__ |
|
||||
+---------+
|
||||
+-----------+
|
||||
| __start__ |
|
||||
+-----------+
|
||||
*
|
||||
*
|
||||
*
|
||||
+---------------------+
|
||||
| __start___condition |
|
||||
+---------------------+
|
||||
*** ***
|
||||
* *
|
||||
** ***
|
||||
+------+ *
|
||||
| left | *
|
||||
+------+ *
|
||||
* *
|
||||
* *
|
||||
* *
|
||||
+---------------+ *
|
||||
| left_<lambda> | *
|
||||
+---------------+* *
|
||||
* ***** *
|
||||
* *** *
|
||||
* *** *
|
||||
** +-------+
|
||||
* | right |
|
||||
*** +-------+
|
||||
* ***
|
||||
*** *
|
||||
* **
|
||||
+---------+
|
||||
| __end__ |
|
||||
+---------+
|
||||
'''
|
||||
# ---
|
||||
# name: test_conditional_entrypoint_graph_state
|
||||
@@ -280,6 +285,11 @@
|
||||
"target": "right",
|
||||
"data": "right"
|
||||
},
|
||||
{
|
||||
"source": "left_<lambda>",
|
||||
"target": "__end__",
|
||||
"data": "__end__"
|
||||
},
|
||||
{
|
||||
"source": "__start__",
|
||||
"target": "__start___condition"
|
||||
@@ -300,39 +310,39 @@
|
||||
# ---
|
||||
# name: test_conditional_entrypoint_graph_state.3
|
||||
'''
|
||||
+-----------+
|
||||
| __start__ |
|
||||
+-----------+
|
||||
*
|
||||
*
|
||||
*
|
||||
+---------------------+
|
||||
| __start___condition |
|
||||
+---------------------+
|
||||
*** ***
|
||||
* *
|
||||
** ***
|
||||
+------+ *
|
||||
| left | *
|
||||
+------+ *
|
||||
* *
|
||||
* *
|
||||
* *
|
||||
+---------------+ *
|
||||
| left_<lambda> | ***
|
||||
+---------------+ *
|
||||
*** ***
|
||||
* *
|
||||
** **
|
||||
+-------+
|
||||
| right |
|
||||
+-------+
|
||||
*
|
||||
*
|
||||
*
|
||||
+---------+
|
||||
| __end__ |
|
||||
+---------+
|
||||
+-----------+
|
||||
| __start__ |
|
||||
+-----------+
|
||||
*
|
||||
*
|
||||
*
|
||||
+---------------------+
|
||||
| __start___condition |
|
||||
+---------------------+
|
||||
*** ***
|
||||
* *
|
||||
** ***
|
||||
+------+ *
|
||||
| left | *
|
||||
+------+ *
|
||||
* *
|
||||
* *
|
||||
* *
|
||||
+---------------+ *
|
||||
| left_<lambda> | *
|
||||
+---------------+* *
|
||||
* ***** *
|
||||
* *** *
|
||||
* *** *
|
||||
** +-------+
|
||||
* | right |
|
||||
*** +-------+
|
||||
* ***
|
||||
*** *
|
||||
* **
|
||||
+---------+
|
||||
| __end__ |
|
||||
+---------+
|
||||
'''
|
||||
# ---
|
||||
# name: test_conditional_graph
|
||||
|
||||
Reference in New Issue
Block a user