Merge pull request #1089 from mihaic/patch-1

Fix StateGraph.add_edge end_key check
This commit is contained in:
Nuno Campos
2024-07-23 13:52:33 -07:00
committed by GitHub
+2 -2
View File
@@ -358,8 +358,8 @@ class StateGraph(Graph):
raise ValueError("END cannot be a start node")
if start not in self.nodes:
raise ValueError(f"Need to add_node `{start}` first")
if end_key == END:
raise ValueError("END cannot be an end node")
if end_key == START:
raise ValueError("START cannot be an end node")
if end_key not in self.nodes:
raise ValueError(f"Need to add_node `{end_key}` first")