mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-25 17:22:55 +00:00
(cherry picked from commit 3249811428)
This commit is contained in:
parent
56a7b7b524
commit
499fc90f2f
|
|
@ -656,13 +656,13 @@ class DocumentSerializers(ApiMixin, serializers.Serializer):
|
|||
paragraphs = get_split_model('web.md').parse(response.content)
|
||||
# 插入
|
||||
DocumentSerializers.Create(data={'dataset_id': dataset_id}).save(
|
||||
{'name': source_url, 'paragraphs': paragraphs,
|
||||
{'name': source_url[0:128], 'paragraphs': paragraphs,
|
||||
'meta': {'source_url': source_url, 'selector': selector},
|
||||
'type': Type.web}, with_valid=True)
|
||||
except Exception as e:
|
||||
logging.getLogger("max_kb_error").error(f'{str(e)}:{traceback.format_exc()}')
|
||||
else:
|
||||
Document(name=source_url,
|
||||
Document(name=source_url[0:128],
|
||||
meta={'source_url': source_url, 'selector': selector},
|
||||
type=Type.web,
|
||||
char_length=0,
|
||||
|
|
|
|||
Loading…
Reference in New Issue