fix: Multiple Paths Between IF/ELSE Branches Invalidate Conditions (#11544)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
This commit is contained in:
yihong 2024-12-23 15:09:02 +08:00 committed by GitHub
parent 453f324f54
commit 70dd69d533
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -147,6 +147,8 @@ class AnswerStreamGeneratorRouter:
reverse_edges = reverse_edge_mapping.get(current_node_id, []) reverse_edges = reverse_edge_mapping.get(current_node_id, [])
for edge in reverse_edges: for edge in reverse_edges:
source_node_id = edge.source_node_id source_node_id = edge.source_node_id
if source_node_id not in node_id_config_mapping:
continue
source_node_type = node_id_config_mapping[source_node_id].get("data", {}).get("type") source_node_type = node_id_config_mapping[source_node_id].get("data", {}).get("type")
source_node_data = node_id_config_mapping[source_node_id].get("data", {}) source_node_data = node_id_config_mapping[source_node_id].get("data", {})
if ( if (

View File

@ -135,6 +135,8 @@ class EndStreamGeneratorRouter:
reverse_edges = reverse_edge_mapping.get(current_node_id, []) reverse_edges = reverse_edge_mapping.get(current_node_id, [])
for edge in reverse_edges: for edge in reverse_edges:
source_node_id = edge.source_node_id source_node_id = edge.source_node_id
if source_node_id not in node_id_config_mapping:
continue
source_node_type = node_id_config_mapping[source_node_id].get("data", {}).get("type") source_node_type = node_id_config_mapping[source_node_id].get("data", {}).get("type")
if source_node_type in { if source_node_type in {
NodeType.IF_ELSE.value, NodeType.IF_ELSE.value,