quivr/backend/core/parsers/pdf.py

15 lines
414 B
Python
Raw Normal View History

from langchain.document_loaders import PyMuPDFLoader
2023-06-28 20:39:27 +03:00
from models.files import File
from .common import process_file
2023-05-13 01:25:12 +03:00
def process_pdf(file: File, enable_summarization, brain_id, user_openai_api_key):
return process_file(
file=file,
loader_class=PyMuPDFLoader,
enable_summarization=enable_summarization,
brain_id=brain_id,
user_openai_api_key=user_openai_api_key,
)