Sfoglia il codice sorgente

Support for code files parse (#789)

### What problem does this PR solve?

_Briefly describe what this PR aims to solve. Include background context
that will help reviewers understand the purpose of the PR._

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
tags/v0.6.0
dashi6174 1 anno fa
parent
commit
6ff63ee2ba
Nessun account collegato all'indirizzo email del committer
2 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 1
    1
      api/utils/file_utils.py
  2. 1
    1
      rag/app/naive.py

+ 1
- 1
api/utils/file_utils.py Vedi File

return FileType.PDF.value return FileType.PDF.value
if re.match( if re.match(
r".*\.(doc|docx|ppt|pptx|yml|xml|htm|json|csv|txt|ini|xls|xlsx|wps|rtf|hlp|pages|numbers|key|md)$", filename):
r".*\.(doc|docx|ppt|pptx|yml|xml|htm|json|csv|txt|ini|xls|xlsx|wps|rtf|hlp|pages|numbers|key|md|py|js|java|c|cpp|h|php|go|ts|sh|cs|kt)$", filename):
return FileType.DOC.value return FileType.DOC.value
if re.match( if re.match(

+ 1
- 1
rag/app/naive.py Vedi File

excel_parser = ExcelParser() excel_parser = ExcelParser()
sections = [(excel_parser.html(binary), "")] sections = [(excel_parser.html(binary), "")]
elif re.search(r"\.(txt|md)$", filename, re.IGNORECASE):
elif re.search(r"\.(txt|md|py|js|java|c|cpp|h|php|go|ts|sh|cs|kt)$", filename, re.IGNORECASE):
callback(0.1, "Start to parse.") callback(0.1, "Start to parse.")
txt = "" txt = ""
if binary: if binary:

Loading…
Annulla
Salva