fix: Knowledge base export error (#2076)

This commit is contained in:
shaohuzhang1 2025-01-22 18:27:58 +08:00 committed by GitHub
parent 5772b02280
commit bb77448231
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 41 additions and 14 deletions

View File

@ -63,7 +63,7 @@ from embedding.task.embedding import embedding_by_document, delete_embedding_by_
delete_embedding_by_document, update_embedding_dataset_id, delete_embedding_by_paragraph_ids, \ delete_embedding_by_document, update_embedding_dataset_id, delete_embedding_by_paragraph_ids, \
embedding_by_document_list embedding_by_document_list
from smartdoc.conf import PROJECT_DIR from smartdoc.conf import PROJECT_DIR
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _, gettext
parse_qa_handle_list = [XlsParseQAHandle(), CsvParseQAHandle(), XlsxParseQAHandle(), ZipParseQAHandle()] parse_qa_handle_list = [XlsParseQAHandle(), CsvParseQAHandle(), XlsxParseQAHandle(), ZipParseQAHandle()]
parse_table_handle_list = [CsvSplitTableHandle(), XlsSplitTableHandle(), XlsxSplitTableHandle()] parse_table_handle_list = [CsvSplitTableHandle(), XlsSplitTableHandle(), XlsxSplitTableHandle()]
@ -631,9 +631,9 @@ class DocumentSerializers(ApiMixin, serializers.Serializer):
# 添加工作表 # 添加工作表
worksheet = workbook.create_sheet(document_dict.get(sheet_id)) worksheet = workbook.create_sheet(document_dict.get(sheet_id))
data = [ data = [
[_('Section title (optional)', [gettext('Section title (optional)'),
'Section content (required, question answer, no more than 4096 characters)', gettext('Section content (required, question answer, no more than 4096 characters)'),
'Question (optional, one per line in the cell)')], gettext('Question (optional, one per line in the cell)')],
*data_dict.get(sheet_id, []) *data_dict.get(sheet_id, [])
] ]
# 写入数据到工作表 # 写入数据到工作表

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-01-22 15:58+0800\n" "POT-Creation-Date: 2025-01-22 18:19+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -144,7 +144,7 @@ msgid "message type error"
msgstr "" msgstr ""
#: .\apps\application\chat_pipeline\step\chat_step\impl\base_chat_step.py:177 #: .\apps\application\chat_pipeline\step\chat_step\impl\base_chat_step.py:177
#: .\apps\application\chat_pipeline\step\chat_step\impl\base_chat_step.py:222 #: .\apps\application\chat_pipeline\step\chat_step\impl\base_chat_step.py:221
msgid "" msgid ""
"Sorry, the AI model is not configured. Please go to the application to set " "Sorry, the AI model is not configured. Please go to the application to set "
"up the AI model first." "up the AI model first."
@ -2811,6 +2811,15 @@ msgstr ""
msgid "Section title (optional)" msgid "Section title (optional)"
msgstr "" msgstr ""
#: .\apps\dataset\serializers\document_serializers.py:635
msgid ""
"Section content (required, question answer, no more than 4096 characters)"
msgstr ""
#: .\apps\dataset\serializers\document_serializers.py:636
msgid "Question (optional, one per line in the cell)"
msgstr ""
#: .\apps\dataset\serializers\document_serializers.py:735 #: .\apps\dataset\serializers\document_serializers.py:735
msgid "The task is being executed, please do not send it repeatedly." msgid "The task is being executed, please do not send it repeatedly."
msgstr "" msgstr ""
@ -3647,7 +3656,7 @@ msgid ""
"sketch, flat illustration, two-dimensional, and 3D. Cartoon." "sketch, flat illustration, two-dimensional, and 3D. Cartoon."
msgstr "" msgstr ""
#: .\apps\setting\models_provider\impl\aliyun_bai_lian_model_provider\aliyun_bai_lian_model_provider.py:94 #: .\apps\setting\models_provider\impl\aliyun_bai_lian_model_provider\aliyun_bai_lian_model_provider.py:95
msgid "Alibaba Cloud Bailian" msgid "Alibaba Cloud Bailian"
msgstr "" msgstr ""

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-01-22 15:44+0800\n" "POT-Creation-Date: 2025-01-22 18:18+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -144,7 +144,7 @@ msgid "message type error"
msgstr "消息类型错误" msgstr "消息类型错误"
#: .\apps\application\chat_pipeline\step\chat_step\impl\base_chat_step.py:177 #: .\apps\application\chat_pipeline\step\chat_step\impl\base_chat_step.py:177
#: .\apps\application\chat_pipeline\step\chat_step\impl\base_chat_step.py:222 #: .\apps\application\chat_pipeline\step\chat_step\impl\base_chat_step.py:221
msgid "" msgid ""
"Sorry, the AI model is not configured. Please go to the application to set " "Sorry, the AI model is not configured. Please go to the application to set "
"up the AI model first." "up the AI model first."
@ -2817,6 +2817,15 @@ msgstr "文档 id 不存在"
msgid "Section title (optional)" msgid "Section title (optional)"
msgstr "分段标题(选填)" msgstr "分段标题(选填)"
#: .\apps\dataset\serializers\document_serializers.py:635
msgid ""
"Section content (required, question answer, no more than 4096 characters)"
msgstr "分段内容必填问题答案最长不超过4096个字符"
#: .\apps\dataset\serializers\document_serializers.py:636
msgid "Question (optional, one per line in the cell)"
msgstr "问题(选填,单元格内一行一个)"
#: .\apps\dataset\serializers\document_serializers.py:735 #: .\apps\dataset\serializers\document_serializers.py:735
msgid "The task is being executed, please do not send it repeatedly." msgid "The task is being executed, please do not send it repeatedly."
msgstr "任务正在执行中,请勿重复发送" msgstr "任务正在执行中,请勿重复发送"
@ -3663,7 +3672,7 @@ msgstr ""
"或者参考风格迁移,重点风格包括但不限于水彩、油画、中国画、素描、扁平插画、二" "或者参考风格迁移,重点风格包括但不限于水彩、油画、中国画、素描、扁平插画、二"
"次元、3D卡通。" "次元、3D卡通。"
#: .\apps\setting\models_provider\impl\aliyun_bai_lian_model_provider\aliyun_bai_lian_model_provider.py:94 #: .\apps\setting\models_provider\impl\aliyun_bai_lian_model_provider\aliyun_bai_lian_model_provider.py:95
msgid "Alibaba Cloud Bailian" msgid "Alibaba Cloud Bailian"
msgstr "阿里云百炼" msgstr "阿里云百炼"
@ -6753,4 +6762,4 @@ msgstr "删除个人系统 API_KEY"
#: .\apps\xpack\views\system_api_key_views.py:57 #: .\apps\xpack\views\system_api_key_views.py:57
#: .\apps\xpack\views\system_api_key_views.py:58 #: .\apps\xpack\views\system_api_key_views.py:58
msgid "Add personal system API_KEY" msgid "Add personal system API_KEY"
msgstr "添加个人系统 API_KEY" msgstr "添加个人系统 API_KEY"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-01-22 15:57+0800\n" "POT-Creation-Date: 2025-01-22 18:20+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -145,7 +145,7 @@ msgid "message type error"
msgstr "消息類型錯誤" msgstr "消息類型錯誤"
#: .\apps\application\chat_pipeline\step\chat_step\impl\base_chat_step.py:177 #: .\apps\application\chat_pipeline\step\chat_step\impl\base_chat_step.py:177
#: .\apps\application\chat_pipeline\step\chat_step\impl\base_chat_step.py:222 #: .\apps\application\chat_pipeline\step\chat_step\impl\base_chat_step.py:221
msgid "" msgid ""
"Sorry, the AI model is not configured. Please go to the application to set " "Sorry, the AI model is not configured. Please go to the application to set "
"up the AI model first." "up the AI model first."
@ -2818,6 +2818,15 @@ msgstr "文檔 id 不存在"
msgid "Section title (optional)" msgid "Section title (optional)"
msgstr "分段標題(選填)" msgstr "分段標題(選填)"
#: .\apps\dataset\serializers\document_serializers.py:635
msgid ""
"Section content (required, question answer, no more than 4096 characters)"
msgstr "分段內容必填問題答案最長不超過4096個字元"
#: .\apps\dataset\serializers\document_serializers.py:636
msgid "Question (optional, one per line in the cell)"
msgstr "問題(選填,儲存格內一行一個)"
#: .\apps\dataset\serializers\document_serializers.py:735 #: .\apps\dataset\serializers\document_serializers.py:735
msgid "The task is being executed, please do not send it repeatedly." msgid "The task is being executed, please do not send it repeatedly."
msgstr "任務正在執行中,請勿重複發送" msgstr "任務正在執行中,請勿重複發送"
@ -3664,7 +3673,7 @@ msgstr ""
"或者參考風格遷移,重點風格包括但不限於水彩、油畫、中國畫、素描、扁平插畫、二" "或者參考風格遷移,重點風格包括但不限於水彩、油畫、中國畫、素描、扁平插畫、二"
"次元、3D卡通。" "次元、3D卡通。"
#: .\apps\setting\models_provider\impl\aliyun_bai_lian_model_provider\aliyun_bai_lian_model_provider.py:94 #: .\apps\setting\models_provider\impl\aliyun_bai_lian_model_provider\aliyun_bai_lian_model_provider.py:95
msgid "Alibaba Cloud Bailian" msgid "Alibaba Cloud Bailian"
msgstr "阿里雲百鍊" msgstr "阿里雲百鍊"