Merge pull request #111 from murtazahr/main

Add support for jupyter notebooks.
This commit is contained in:
Stan Girard 2023-05-21 21:38:45 +02:00 committed by GitHub
commit e35f6063d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -19,6 +19,7 @@ from parsers.txt import process_txt
from parsers.csv import process_csv
from parsers.docx import process_docx
from parsers.pdf import process_pdf
from parsers.notebook import process_ipnyb
from parsers.markdown import process_markdown
from parsers.powerpoint import process_powerpoint
from parsers.html import process_html
@ -91,6 +92,7 @@ file_processors = {
".pptx": process_powerpoint,
".docx": process_docx,
".epub": process_epub,
".ipynb": process_ipnyb,
}
async def filter_file(file: UploadFile, supabase, vector_store, stats_db):

View File

@ -0,0 +1,7 @@
from .common import process_file
from langchain.document_loaders import NotebookLoader
from fastapi import UploadFile
def process_ipnyb(vector_store, file: UploadFile, stats_db):
return process_file(vector_store, file, NotebookLoader, "ipynb", stats_db=stats_db)