Skip to content

rahul240699/Generative-AI-multi-PDF-Chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi-PDF Chat Application

A Streamlit-based application that allows users to chat with multiple PDF documents using LangChain and OpenAI.

Features

  • Upload multiple PDF documents
  • Extract text from PDFs
  • Process and chunk the text
  • Create vector embeddings
  • Chat with the documents using OpenAI's GPT model
  • Maintain conversation history

Prerequisites

  • Python 3.8 or higher
  • OpenAI API key

Setup

  1. Clone the repository:
git clone <repository-url>
cd LLM-Multi-PDF-Chat
  1. Create and activate a virtual environment:
python3 -m venv venv
source venv/bin/activate  # On Windows, use: venv\Scripts\activate
  1. Install required packages:
pip install streamlit python-dotenv pypdf2 langchain openai faiss-cpu huggingface_hub
  1. Create a .env file in the project root and add your OpenAI API key:
OPENAI_API_KEY=your_api_key_here

Running the Application

  1. Make sure your virtual environment is activated
  2. Run the Streamlit app:
streamlit run app.py
  1. Open your web browser and navigate to the URL shown in the terminal (typically http://localhost:8501)

Usage

  1. Upload one or more PDF documents using the file uploader in the sidebar
  2. Click the "Process" button to process the documents
  3. Enter your questions in the text input field
  4. View the conversation history with the AI assistant

Project Structure

  • app.py: Main application file containing the Streamlit interface and processing logic
  • htmlTemplates.py: Contains HTML templates for chat messages
  • .env: Environment variables file (create this yourself)
  • venv/: Virtual environment directory (created during setup)

Note

Make sure you have sufficient credits in your OpenAI account as this application uses the OpenAI API for generating responses.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages