From e420a01e0d9335187fb330544eb8f0a6d9275204 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Tue, 4 Mar 2025 19:31:49 +0800 Subject: [PATCH] fix: Enterprise WeChat docking sub application cannot output thinking process (#2489) --- .../step_node/application_node/impl/base_application_node.py | 4 ++++ apps/common/handle/impl/response/openai_to_response.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/application/flow/step_node/application_node/impl/base_application_node.py b/apps/application/flow/step_node/application_node/impl/base_application_node.py index 77dc3f6c..d962f716 100644 --- a/apps/application/flow/step_node/application_node/impl/base_application_node.py +++ b/apps/application/flow/step_node/application_node/impl/base_application_node.py @@ -115,6 +115,10 @@ def write_context(node_variable: Dict, workflow_variable: Dict, node: INode, wor 'prompt_tokens': response.get('prompt_tokens')}} answer = response.get('content', '') or "抱歉,没有查找到相关内容,请重新描述您的问题或提供更多信息。" reasoning_content = response.get('reasoning_content', '') + answer_list = response.get('answer_list', []) + node_variable['application_node_dict'] = {answer.get('real_node_id'): {**answer, 'index': index} for answer, index + in + zip(answer_list, range(len(answer_list)))} _write_context(node_variable, workflow_variable, node, workflow, answer, reasoning_content) diff --git a/apps/common/handle/impl/response/openai_to_response.py b/apps/common/handle/impl/response/openai_to_response.py index bc4a8f90..f2b69384 100644 --- a/apps/common/handle/impl/response/openai_to_response.py +++ b/apps/common/handle/impl/response/openai_to_response.py @@ -26,7 +26,7 @@ class OpenaiToResponse(BaseToResponse): other_params = {} data = ChatCompletion(id=chat_record_id, choices=[ BlockChoice(finish_reason='stop', index=0, chat_id=chat_id, - reasoning_content=other_params.get('reasoning_content', ""), + answer_list=other_params.get('answer_list', ""), message=ChatCompletionMessage(role='assistant', content=content))], created=datetime.datetime.now().second, model='', object='chat.completion', usage=CompletionUsage(completion_tokens=completion_tokens,