diff --git a/apps/application/flow/knowledge_workflow_manage.py b/apps/application/flow/knowledge_workflow_manage.py index bba879aeb..07a184df6 100644 --- a/apps/application/flow/knowledge_workflow_manage.py +++ b/apps/application/flow/knowledge_workflow_manage.py @@ -54,7 +54,23 @@ class KnowledgeWorkflowManage(WorkflowManage): pass self.work_flow_post_handler.handler(self) + @staticmethod + def get_node_details(current_node, node, index): + if current_node == node: + return { + 'name': node.node.properties.get('stepName'), + "index": index, + 'run_time': 0, + 'type': node.type, + 'status': 202, + 'err_message': "" + } + + return node.get_details(index) + def run_chain(self, current_node, node_result_future=None): + QuerySet(KnowledgeAction).filter(id=self.params.get('knowledge_action_id')).update( + details=self.get_runtime_details(lambda node, index: self.get_node_details(current_node, node, index))) if node_result_future is None: node_result_future = self.run_node_future(current_node) try: diff --git a/apps/application/flow/workflow_manage.py b/apps/application/flow/workflow_manage.py index 2bec10326..84f72f18e 100644 --- a/apps/application/flow/workflow_manage.py +++ b/apps/application/flow/workflow_manage.py @@ -544,7 +544,7 @@ class WorkflowManage: return self._has_next_node(self.get_start_node() if self.current_node is None else self.current_node, node_result) - def get_runtime_details(self): + def get_runtime_details(self, get_details=lambda n, index: n.get_details(index)): details_result = {} for index in range(len(self.node_context)): node = self.node_context[index] @@ -553,7 +553,7 @@ class WorkflowManage: if details is not None and self.start_node.runtime_node_id != node.runtime_node_id: details_result[node.runtime_node_id] = details continue - details = node.get_details(index) + details = get_details(node, index) details['node_id'] = node.id details['up_node_id_list'] = node.up_node_id_list details['runtime_node_id'] = node.runtime_node_id diff --git a/ui/src/components/ai-chat/component/knowledge-source-component/ExecutionDetailCard.vue b/ui/src/components/ai-chat/component/knowledge-source-component/ExecutionDetailCard.vue index 2b6e4af57..0f862abad 100644 --- a/ui/src/components/ai-chat/component/knowledge-source-component/ExecutionDetailCard.vue +++ b/ui/src/components/ai-chat/component/knowledge-source-component/ExecutionDetailCard.vue @@ -27,10 +27,15 @@ " >{{ data?.message_tokens + data?.answer_tokens }} tokens - {{ data?.run_time?.toFixed(2) || 0.0 }} s + {{ data?.run_time?.toFixed(2) || 0.0 }} s + + + @@ -896,11 +901,12 @@ :key="groupI" >
- {{ group.label+ ' '+ $t('common.param.inputParam') }} + {{ group.label + ' ' + $t('common.param.inputParam') }}
- {{ `${f.node_name}.${f.field}` }}: {{ f.value }} + {{ `${f.node_name}.${f.field}` }}: + {{ f.value }}