瀏覽代碼

force eml file to be parsed by EMAIL (#2615)

### What problem does this PR solve?
#2613
### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.12.0
Kevin Hu 1 年之前
父節點
當前提交
297b2d0ac9
沒有連結到貢獻者的電子郵件帳戶。
共有 2 個檔案被更改,包括 4 行新增0 行删除
  1. 2
    0
      api/apps/dataset_api.py
  2. 2
    0
      api/apps/document_app.py

+ 2
- 0
api/apps/dataset_api.py 查看文件

@@ -381,6 +381,8 @@ def upload_documents(dataset_id):
doc["parser_id"] = ParserType.AUDIO.value
if re.search(r"\.(ppt|pptx|pages)$", filename):
doc["parser_id"] = ParserType.PRESENTATION.value
if re.search(r"\.(eml)$", filename):
doc["parser_id"] = ParserType.EMAIL.value
DocumentService.insert(doc)

FileService.add_file_from_kb(doc, kb_folder["id"], dataset.tenant_id)

+ 2
- 0
api/apps/document_app.py 查看文件

@@ -139,6 +139,8 @@ def web_crawl():
doc["parser_id"] = ParserType.AUDIO.value
if re.search(r"\.(ppt|pptx|pages)$", filename):
doc["parser_id"] = ParserType.PRESENTATION.value
if re.search(r"\.(eml)$", filename):
doc["parser_id"] = ParserType.EMAIL.value
DocumentService.insert(doc)
FileService.add_file_from_kb(doc, kb_folder["id"], kb.tenant_id)
except Exception as e:

Loading…
取消
儲存