PDF.Assistant.mp4
Note: This project is currently in beta. Future versions will include more features and improvements. STAY TUNED!
📖 PDF Assistant is a project designed to enhance learners' productivity and efficiency. It allows users to upload a PDF document and generate questions based on its content. Users can then interact with the system to get accurate answers to these questions, aiding in better comprehension and retention.
- ✨PDF Upload: Upload PDF documents for processing
- ✨Question Submission: Type questions based on the uploaded PDF.
- ✨Answer Retrieval: Provide accurate answers to typed questions.
- ✨User Interaction: Easy-to-use interface for interacting with generated questions and answers.
By leveraging PDF Assistant, users can streamline their learning process by focusing on key concepts and testing their understanding directly from PDF materials.
- LangChain: Used for language processing and AI/ML tasks by handling the user and pdf interactions.
- FastAPI: Backend framework for building APIs. Used for making the routes of uploading and asking questions
- React Vite: Frontend framework for building user interfaces.
- Postman: For testing the API built with FastAPI. This is optional but it is recommended for proper testing.
- Node.js and npm
- Python and pip
- FastAPI
- Vite
-
Clone the repository:
git clone https://github.com/Minty-cyber/PDF-Assistant.git cd Backend
-
Install the python dependencies:
pip install -r requirements.txt
-
Run the FastAPI server:
uvicorn main:app --reload
-
Access the API documentation: Once the server is running, you can access the API documentation at:
http://localhost:8000/docs
To use the PDF Assistant effectively, you will need to configure the Gemini API Key for accessing Google Generative AI services. Follow these steps to set it up:
-
Obtain API Key:
- Visit the Google Cloud Console.
- Create a new project or select an existing project.
- Navigate to the "APIs & Services" section.
- Enable the "Google Generative AI" API.
- Generate a new API key and note it down.
-
Set Environment Variable:
- Create a
.env
file in the root directory of your project. - Add your API key to the
.env
file as follows:GOOGLE_API_KEY=your_api_key_here
- Make sure to replace
your_api_key_here
with the actual API key you obtained from Google Cloud Console.
- Create a
-
Load Environment Variables:
- Ensure your FastAPI application is configured to load the environment variables from the
.env
file. This is typically done using thedotenv
package in Python:from dotenv import load_dotenv import os load_dotenv() genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
- Ensure your FastAPI application is configured to load the environment variables from the
-
Security Considerations:
- Never hard-code your API keys directly in your source code.
- Avoid sharing your API keys in public repositories.
- Rotate your API keys regularly and manage their permissions carefully.
By following these steps, you can securely configure and use the Gemini API key with the PDF Assistant to leverage the powerful language processing capabilities of Google Generative AI.
-
Navigate to the frontend directory:
cd Frontend/visuals
-
Install Node.js dependencies:
npm install npm install axios npm install vite
-
Start the development server: This command will start the React Vite development server.
npm run dev
-
Access the application: Open your browser and go to:
http://localhost:3000
Contributions are welcome! Please follow the contribution guidelines to get started.