Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 24 additions & 17 deletions apps/application/flow/workflow_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ def hand_event_node_result(self, current_node, node_result_future):
child_node = {}
view_type = current_node.view_type
try:
self.send_progress(current_node)
current_result = node_result_future.result()
result = current_result.write_context(current_node, self)
if result is not None:
Expand Down Expand Up @@ -477,23 +478,6 @@ def hand_event_node_result(self, current_node, node_result_future):
current_node.node_chunk.add_chunk(chunk)
else:
list(result)
if 'form-node' != current_node.type:
chunk = self.base_to_response.to_stream_chunk_response(self.params.get('chat_id'),
self.params.get('chat_record_id'),
current_node.id,
current_node.up_node_id_list,
'', False, 0, 0,
{'node_type': current_node.type,
'runtime_node_id': runtime_node_id,
'node_name': current_node.node.properties.get(
'stepName'),
'view_type': view_type,
'child_node': child_node,
'node_is_end': True,
'real_node_id': real_node_id,
'reasoning_content': '',
'node_status': "SUCCESS"})
current_node.node_chunk.add_chunk(chunk)
if current_node.status == 500:
enableException = current_node.node.properties.get('enableException')
if not enableException:
Expand Down Expand Up @@ -542,6 +526,29 @@ def hand_event_node_result(self, current_node, node_result_future):
# 归还链接到连接池
connection.close()

def send_progress(self, current_node):
runtime_node_id = current_node.runtime_node_id
real_node_id = current_node.runtime_node_id
child_node = {}
view_type = current_node.view_type
if 'form-node' != current_node.type:
chunk = self.base_to_response.to_stream_chunk_response(self.params.get('chat_id'),
self.params.get('chat_record_id'),
current_node.id,
current_node.up_node_id_list,
'', False, 0, 0,
{'node_type': current_node.type,
'runtime_node_id': runtime_node_id,
'node_name': current_node.node.properties.get(
'stepName'),
'view_type': view_type,
'child_node': child_node,
'node_is_end': True,
'real_node_id': real_node_id,
'reasoning_content': '',
'node_status': "SUCCESS"})
current_node.node_chunk.add_chunk(chunk)

def run_node_async(self, node):
future = executor.submit(self.run_node, node)
return future
Expand Down
Loading