I’m working on a Streamlit application that allows users to upload PDF files for automatic question generation. The main issue I’m facing is that when a user uploads a PDF through Streamlit, it creates an uploaded_file object. However, LangChain’s PDF loader requires a local file path to process the document and break it down into smaller text chunks using their text splitter functionality.
I need to find a solution to either convert this uploaded file object directly into a LangChain document format, or discover an alternative approach that works with the uploaded file object without requiring it to be saved locally first. What would be the best way to handle this conversion process?