Skip to content

Commit e35deea

Browse files
committed
fix: The AI dialogue node in the workflow has an abnormal branch. After successfully writing to the knowledge base through the abnormal branch, the execution record status is' failed '
1 parent 897f0de commit e35deea

File tree

35 files changed

+60
-26
lines changed

35 files changed

+60
-26
lines changed

apps/application/flow/i_step_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def get_workflow_state(workflow):
129129
details = workflow.get_runtime_details()
130130
node_list = details.values()
131131
all_node = [*node_list, *get_loop_workflow_node(node_list)]
132-
err = any([True for value in all_node if value.get('status') == 500])
132+
err = any([True for value in all_node if value.get('status') == 500 and not value.get('enableException')])
133133
if err:
134134
return State.FAILURE
135135
write_is_exist = any([True for value in all_node if value.get('type') == 'knowledge-write-node'])

apps/application/flow/step_node/ai_chat_step_node/impl/base_chat_node.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ def get_details(self, index: int, **kwargs):
332332
'question': self.context.get('question'),
333333
'answer': self.context.get('answer'),
334334
'reasoning_content': self.context.get('reasoning_content'),
335+
'enableException': self.node.properties.get('enableException'),
335336
'type': self.node.type,
336337
'message_tokens': self.context.get('message_tokens'),
337338
'answer_tokens': self.context.get('answer_tokens'),

apps/application/flow/step_node/application_node/impl/base_application_node.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,5 +287,6 @@ def get_details(self, index: int, **kwargs):
287287
'image_list': self.workflow_manage.image_list,
288288
'audio_list': self.workflow_manage.audio_list,
289289
'video_list': self.workflow_manage.video_list,
290-
'application_node_dict': self.context.get('application_node_dict')
290+
'application_node_dict': self.context.get('application_node_dict'),
291+
'enableException': self.node.properties.get('enableException'),
291292
}

apps/application/flow/step_node/condition_node/impl/base_condition_node.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,6 @@ def get_details(self, index: int, **kwargs):
5959
'branch_name': self.context.get('branch_name'),
6060
'type': self.node.type,
6161
'status': self.status,
62-
'err_message': self.err_message
62+
'err_message': self.err_message,
63+
'enableException': self.node.properties.get('enableException'),
6364
}

apps/application/flow/step_node/data_source_local_node/impl/base_data_source_local_node.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,6 @@ def get_details(self, index: int, **kwargs):
4747
'file_list': self.context.get('file_list'),
4848
'knowledge_base': self.workflow_params.get('knowledge_base'),
4949
'status': self.status,
50-
'err_message': self.err_message
50+
'err_message': self.err_message,
51+
'enableException': self.node.properties.get('enableException'),
5152
}

apps/application/flow/step_node/data_source_web_node/impl/base_data_source_web_node.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,6 @@ def get_details(self, index: int, **kwargs):
9393
'output_params': self.context.get('document_list'),
9494
'knowledge_base': self.workflow_params.get('knowledge_base'),
9595
'status': self.status,
96-
'err_message': self.err_message
96+
'err_message': self.err_message,
97+
'enableException': self.node.properties.get('enableException'),
9798
}

apps/application/flow/step_node/direct_reply_node/impl/base_reply_node.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,6 @@ def get_details(self, index: int, **kwargs):
4242
'type': self.node.type,
4343
'answer': self.context.get('answer'),
4444
'status': self.status,
45-
'err_message': self.err_message
45+
'err_message': self.err_message,
46+
'enableException': self.node.properties.get('enableException'),
4647
}

apps/application/flow/step_node/document_extract_node/impl/base_document_extract_node.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,6 @@ def get_details(self, index: int, **kwargs):
8585
'content': [file_content[:500] for file_content in content],
8686
'status': self.status,
8787
'err_message': self.err_message,
88-
'document_list': self.context.get('document_list')
88+
'document_list': self.context.get('document_list'),
89+
'enableException': self.node.properties.get('enableException'),
8990
}

apps/application/flow/step_node/document_split_node/impl/base_document_split_node.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,5 +187,6 @@ def get_details(self, index: int, **kwargs):
187187
'with_filter': self.context.get('with_filter'),
188188
'patterns': self.context.get('patterns'),
189189
'split_strategy': self.context.get('split_strategy'),
190+
'enableException': self.node.properties.get('enableException'),
190191
# 'document_list': self.context.get('document_list', []),
191192
}

apps/application/flow/step_node/form_node/impl/base_form_node.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,5 +173,6 @@ def get_details(self, index: int, **kwargs):
173173
'run_time': self.context.get('run_time'),
174174
'type': self.node.type,
175175
'status': self.status,
176-
'err_message': self.err_message
176+
'err_message': self.err_message,
177+
'enableException': self.node.properties.get('enableException'),
177178
}

0 commit comments

Comments
 (0)