Skip to content

Commit a3dd488

Browse files
committed
feat: Non streaming response answers_list
1 parent 7eff1c9 commit a3dd488

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apps/application/flow/workflow_manage.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,13 +337,15 @@ def run_block(self, language='zh'):
337337
answer_text = '\n\n'.join(
338338
'\n\n'.join([a.get('content') for a in answer]) for answer in
339339
answer_text_list)
340+
answer_list = reduce(lambda pre, _n: [*pre, *_n], answer_text_list, [])
340341
self.work_flow_post_handler.handler(self.params['chat_id'], self.params['chat_record_id'],
341342
answer_text,
342343
self)
343344
return self.base_to_response.to_block_response(self.params['chat_id'],
344345
self.params['chat_record_id'], answer_text, True
345346
, message_tokens, answer_tokens,
346-
_status=status.HTTP_200_OK if self.status == 200 else status.HTTP_500_INTERNAL_SERVER_ERROR)
347+
_status=status.HTTP_200_OK if self.status == 200 else status.HTTP_500_INTERNAL_SERVER_ERROR,
348+
other_params={'answer_list': answer_list})
347349

348350
def run_stream(self, current_node, node_result_future, language='zh'):
349351
"""

0 commit comments

Comments
 (0)