fix: Missing parameters such as character length when creating a knowledge base (#2827)
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
Typos Check / Spell Check with Typos (push) Waiting to run

This commit is contained in:
shaohuzhang1 2025-04-08 17:24:33 +08:00 committed by GitHub
parent 43702e42b8
commit 3557ea50fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -455,11 +455,13 @@ class DataSetSerializers(serializers.ModelSerializer):
# 批量插入关联问题
QuerySet(ProblemParagraphMapping).bulk_create(problem_paragraph_mapping_list) if len(
problem_paragraph_mapping_list) > 0 else None
# 响应数据
return {**DataSetSerializers(dataset).data,
'document_list': DocumentSerializers.Query(data={'dataset_id': dataset_id}).list(
with_valid=True)}, dataset_id
'user_id': user_id,
'document_list': document_model_list,
"document_count": len(document_model_list),
"char_length": reduce(lambda x, y: x + y, [d.char_length for d in document_model_list],
0)}, dataset_id
@staticmethod
def get_last_url_path(url):