Determines the next node to execute based on current node type and result.
(self, current_node, result)
| 220 | return result, node_exec_time, cb_data |
| 221 | |
| 222 | def _get_next_node(self, current_node, result): |
| 223 | """Determines the next node to execute based on current node type and result.""" |
| 224 | if current_node.node_type == "conditional_node": |
| 225 | node_names = {node.node_name for node in self.nodes} |
| 226 | if result in node_names: |
| 227 | return result |
| 228 | elif result is None: |
| 229 | return None |
| 230 | raise ValueError( |
| 231 | f"Conditional Node returned a node name '{result}' that does not exist in the graph" |
| 232 | ) |
| 233 | |
| 234 | return self.edges.get(current_node.node_name) |
| 235 | |
| 236 | def _execute_standard(self, initial_state: dict) -> Tuple[dict, list]: |
| 237 | """ |