You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Validate the graph structure for common issues.
680
+
681
+
This function raises an error if any of the following criteria are not met:
682
+
1. There are edges from the start node
683
+
2. There are edges to the end node
684
+
3. No non-End node is a dead end (no outgoing edges)
685
+
4. The end node is reachable from the start node
686
+
5. All nodes are reachable from the start node
687
+
688
+
Note 1: Under some circumstances it may be reasonable to build a graph that violates one or more of
689
+
the above conditions. We may eventually add support for more granular control over validation,
690
+
but today, if you want to build a graph that violates any of these assumptions you need to pass
691
+
`validate_graph_structure=False` to the call to `GraphBuilder.build`.
692
+
693
+
Note 2: Some of the earlier items in the above list are redundant with the later items.
694
+
I've included the earlier items in the list as a reminder to ourselves if/when we add more granular validation
695
+
because you might want to check the earlier items but not the later items, as described in Note 1.
696
+
697
+
Args:
698
+
nodes: The nodes in the graph
699
+
edges_by_source: The edges by source node
700
+
701
+
Raises:
702
+
GraphBuildingError: If any of the aforementioned structural issues are found.
703
+
"""
704
+
how_to_suppress=' If this is intentional, you can suppress this error by passing `validate_graph_structure=False` to the call to `GraphBuilder.build`.'
705
+
706
+
# Extract all destination IDs from edges and decision branches
0 commit comments