mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
chore: add allow_download flag to document metadata
This commit is contained in:
parent
796001a4ae
commit
f9f96fd2cd
|
|
@ -866,7 +866,7 @@ class DocumentSerializers(serializers.Serializer):
|
|||
def get_document_paragraph_model(knowledge_id, instance: Dict):
|
||||
source_meta = {'source_file_id': instance.get('source_file_id')} if instance.get('source_file_id') else {}
|
||||
meta = {**instance.get('meta'), **source_meta} if instance.get('meta') is not None else source_meta
|
||||
meta = convert_uuid_to_str(meta)
|
||||
meta = {**convert_uuid_to_str(meta), 'allow_download': True}
|
||||
|
||||
document_model = Document(
|
||||
**{
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ def get_sync_web_document_handler(knowledge_id):
|
|||
else:
|
||||
Document(name=source_url[0:128],
|
||||
knowledge_id=knowledge_id,
|
||||
meta={'source_url': source_url, 'selector': selector},
|
||||
meta={'source_url': source_url, 'selector': selector, 'allow_download': True},
|
||||
type=KnowledgeType.WEB,
|
||||
char_length=0,
|
||||
status=State.FAILURE).save()
|
||||
|
|
|
|||
Loading…
Reference in New Issue