From 037268179db8df912eaa0306e34bfcddd4748503 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 24 Dec 2024 11:42:35 +0800 Subject: [PATCH] fix: fix the defect where the exported log field is empty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1049645 --user=王孝刚 【应用】应用编排嵌入高级编排应用,导出对话日志文件的优化后问题字段没有值 https://www.tapd.cn/57709429/s/1635887 --- apps/application/serializers/chat_serializers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/application/serializers/chat_serializers.py b/apps/application/serializers/chat_serializers.py index d07b5676e57..f8c9467f36f 100644 --- a/apps/application/serializers/chat_serializers.py +++ b/apps/application/serializers/chat_serializers.py @@ -176,9 +176,8 @@ def paragraph_list_to_string(paragraph_list): @staticmethod def to_row(row: Dict): details = row.get('details') - padding_problem_text = details.get('problem_padding').get( - 'padding_problem_text') if 'problem_padding' in details and 'padding_problem_text' in details.get( - 'problem_padding') else "" + padding_problem_text = ' '.join(node.get("answer", "") for key, node in details.items() if + node.get("type") == 'question-node') search_dataset_node_list = [(key, node) for key, node in details.items() if node.get("type") == 'search-dataset-node' or node.get( "step_type") == 'search_step'] @@ -194,6 +193,7 @@ def to_row(row: Dict): [])) for key, node in search_dataset_node_list]) improve_paragraph_list = row.get('improve_paragraph_list') + vote_status_map = {'-1': '未投票', '0': '赞同', '1': '反对'} return [str(row.get('chat_id')), row.get('abstract'), row.get('problem_text'), padding_problem_text, row.get('answer_text'), vote_status_map.get(row.get('vote_status')), reference_paragraph_len,