PDF-to-GPT is a FastAPI application that leverages OpenAI's GPT model to generate summaries and answer questions based on uploaded PDF documents. This application also generates PowerPoint Presentation for the PDF you uploaded. This is the Backend part of the application.
- Upload a PDF document and get a summary generated by ChatGPT.
- Ask questions about the uploaded PDF and get answers generated by GPT-3.
- Get a PowerPoint Presentation for the PDF you uploaded in seconds.
-
Clone the repository:
git clone https://github.com/umairhaider/pdftogpt.git
-
Install the dependencies
pip install -r requirements.txt
-
Rename .env-temp to .env and put your OpenAI API keys and other relevant environment variables. These are only used for development environment. The actual Production CI secrets and variables are stored in Github Actions.
-
Start the FastAPI server:
uvicorn main:app --reload
-
Open your browser and navigate to http://localhost:8000/docs to access the application.
-
Running the tests:
pytest -m order
- POST api/v1/signin/: Get JWT tokens to access the other endpoints.
- POST api/v1/upload_pdf/: Upload a PDF file to generate a summary.
- POST api/v1/ask_question/: Ask a question about the uploaded PDF and get an answer.
- POST api/v1/get_presentation/: Generates PowerPoint Presention for the PDF you uploaded.
- FastAPI: A modern, fast (high-performance), web framework for building APIs with Python 3.7+.
- PDFPlumber: A library for extracting text from PDF files.
- OpenAI: GPT language model for generating text.
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.
Git commit message should follow the following rules:
Add the following approved tags while pushing the commits:
feat – a new feature is introduced with the changes fix – a bug fix has occurred chore – changes that do not relate to a fix or feature and don't modify src or test files (for example updating dependencies) refactor – refactored code that neither fixes a bug nor adds a feature docs – updates to documentation such as a the README or other markdown files style – changes that do not affect the meaning of the code, likely related to code formatting such as white-space, missing semi-colons, and so on. test – including new or correcting previous tests perf – performance improvements ci – continuous integration related build – changes that affect the build system or external dependencies revert – reverts a previous commit example: feat: add JWT headers to login API fix: bug preventing Firefox users to login
Merge and PR: Before creating a PR squash all the commits into one.
This project is licensed under the MIT License.