Transform ChatPDF for Google Gemini Integration#9
Open
mash786 wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request modifies the original PDF Intelligence System to create ChatPDF, a user-friendly Streamlit web application that allows users to upload PDF files and interact with Google Gemini AI. The changes enhance the functionality of the application, enabling users to ask questions about the PDF content and receive AI-generated responses.
Key Changes
PDF File Upload: Added functionality for users to upload a PDF file, with the app extracting the content.
PDF Content Preview: Implemented a feature that displays a preview of the extracted text from the uploaded PDF, showing the first 1500 characters.
Interactive AI Chatbot: Integrated Google Gemini AI to answer user queries related to the extracted PDF content.
Response Generation: The app now leverages the Google Gemini API to generate responses based on user questions.
Features
User-friendly Interface: Streamlit interface for seamless interaction with PDF documents.
Efficient Information Retrieval: Users can easily ask questions about the PDF content, and the app provides accurate responses generated by Google Gemini AI.
How to Use
Navigate to the project directory: Change your terminal to the project folder.
Install required dependencies: Run pip install -r requirements.txt.
Set up Google Gemini API:
Sign up for the Google Gemini API and obtain your API key.
Open the app.py file and replace "YourAPIKEY" with your actual API key.
Run the app: Use the command streamlit run app.py to launch the application.
Open a browser and visit: Navigate to http://localhost:8000 to access the app.
Dependencies
Streamlit: For building the web app interface.
PyMuPDF (fitz): For extracting text from the uploaded PDF.
Google Gemini AI: For generating responses to user queries.
Acknowledgments
Thanks to the original authors for their foundational work on the PDF Intelligence System. The integration of Google Gemini AI enhances the overall capability of the project.