ソースを参照

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 ファイルの表示

doc["parser_id"] = ParserType.AUDIO.value doc["parser_id"] = ParserType.AUDIO.value
if re.search(r"\.(ppt|pptx|pages)$", filename): if re.search(r"\.(ppt|pptx|pages)$", filename):
doc["parser_id"] = ParserType.PRESENTATION.value doc["parser_id"] = ParserType.PRESENTATION.value
if re.search(r"\.(eml)$", filename):
doc["parser_id"] = ParserType.EMAIL.value
DocumentService.insert(doc) DocumentService.insert(doc)


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

+ 2
- 0
api/apps/document_app.py ファイルの表示

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

読み込み中…
キャンセル
保存