From f16f417bd550339b069e354e43a4b4f5d5319cc6 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Mon, 10 Feb 2025 10:22:23 +0800 Subject: [PATCH] fix: The knowledge base table file upload is missing a header (#2185) --- apps/common/handle/impl/csv_split_handle.py | 2 +- apps/common/handle/impl/xls_split_handle.py | 2 +- apps/common/handle/impl/xlsx_split_handle.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/common/handle/impl/csv_split_handle.py b/apps/common/handle/impl/csv_split_handle.py index 6a4849c67..3ea690e0e 100644 --- a/apps/common/handle/impl/csv_split_handle.py +++ b/apps/common/handle/impl/csv_split_handle.py @@ -55,7 +55,7 @@ class CsvSplitHandle(BaseSplitHandle): result_item_content += next_md_content else: paragraphs.append({'content': result_item_content, 'title': ''}) - result_item_content = next_md_content + result_item_content = title_md_content + next_md_content if len(result_item_content) > 0: paragraphs.append({'content': result_item_content, 'title': ''}) return result diff --git a/apps/common/handle/impl/xls_split_handle.py b/apps/common/handle/impl/xls_split_handle.py index 0863bedec..3d8afdf62 100644 --- a/apps/common/handle/impl/xls_split_handle.py +++ b/apps/common/handle/impl/xls_split_handle.py @@ -48,7 +48,7 @@ def handle_sheet(file_name, sheet, limit: int): result_item_content += next_md_content else: paragraphs.append({'content': result_item_content, 'title': ''}) - result_item_content = next_md_content + result_item_content = title_md_content + next_md_content if len(result_item_content) > 0: paragraphs.append({'content': result_item_content, 'title': ''}) return result diff --git a/apps/common/handle/impl/xlsx_split_handle.py b/apps/common/handle/impl/xlsx_split_handle.py index c367a65f6..22ad23146 100644 --- a/apps/common/handle/impl/xlsx_split_handle.py +++ b/apps/common/handle/impl/xlsx_split_handle.py @@ -54,7 +54,7 @@ def handle_sheet(file_name, sheet, image_dict, limit: int): result_item_content += next_md_content else: paragraphs.append({'content': result_item_content, 'title': ''}) - result_item_content = next_md_content + result_item_content = title_md_content + next_md_content if len(result_item_content) > 0: paragraphs.append({'content': result_item_content, 'title': ''}) return result