@@ -132,24 +132,21 @@ def execute(self, initial_state: dict) -> Tuple[dict, list]:
132132 cb_total ["successful_requests" ] += cb ["successful_requests" ]
133133 cb_total ["total_cost_USD" ] += cb ["total_cost_USD" ]
134134
135- # Do not execute the graph from this point on if previous node gave a signal
136- if 'skip_branch' in result :
137- print (f"---- Not executing sub-graph since { current_node .node_name } \
138- raised a stop signal ---" )
139- elif current_node in self .edges :
140- current_node_connections = self .edges [current_node ]
141- if current_node .node_type == 'conditional_node' :
135+
136+
137+ current_node_connections = self .edges [current_node ]
138+ if current_node .node_type == 'conditional_node' :
142139 # Assert that there are exactly two out edges from the conditional node
143- if len (current_node_connections ) != 2 :
144- raise ValueError (f"Conditional node should have exactly two out connections { current_node_connections .node_name } " )
145- if result ["next_node" ] == 0 :
146- queue .append (current_node_connections [0 ])
147- else :
148- queue .append (current_node_connections [1 ])
140+ if len (current_node_connections ) != 2 :
141+ raise ValueError (f"Conditional node should have exactly two out connections { current_node_connections .node_name } " )
142+ if result ["next_node" ] == 0 :
143+ queue .append (current_node_connections [0 ])
144+ else :
145+ queue .append (current_node_connections [1 ])
149146 # remove the conditional node result
150147 del result ["next_node" ]
151- else :
152- queue .extend (node for node in current_node_connections )
148+ else :
149+ queue .extend (node for node in current_node_connections )
153150
154151
155152 exec_info .append ({
0 commit comments