Skip to content

Commit

Permalink
fix: fix the defect where the exported log field is empty
Browse files Browse the repository at this point in the history
--bug=1049645 --user=王孝刚 【应用】应用编排嵌入高级编排应用,导出对话日志文件的优化后问题字段没有值 https://www.tapd.cn/57709429/s/1635887
  • Loading branch information
wxg0103 committed Dec 24, 2024
1 parent 0cd9c8f commit 0372681
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/application/serializers/chat_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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,
Expand Down

0 comments on commit 0372681

Please sign in to comment.