MinDutch03 / file_based_chatbot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gemini File Chatbot

(https://geminip-chatbot.streamlit.app/) Gemini File Chatbot is a Streamlit-based application that allows users to chat with a conversational AI model trained on documents. The chatbot extracts information from uploaded files and answers user questions based on the provided context.

Features

  • PDF, Text, Image Upload: Users can upload multiple files.
  • Text Extraction: Extracts text from uploaded files.
  • Conversational AI: Uses the Gemini conversational AI model to answer user questions.
  • Chat Interface: Provides a chat interface to interact with the chatbot.

Getting Started

If you have docker installed, you can run the application using the following command:

  • Obtain a Google API key and set it in the .env file.

    GOOGLE_API_KEY=your_api_key_here
docker-compose up --build

Your application will be available at http://localhost:8501.

Deploying your application to the cloud

First, build your image, e.g.: docker build -t myapp .. If your cloud uses a different CPU architecture than your development machine (e.g., you are on a Mac M1 and your cloud provider is amd64), you'll want to build the image for that platform, e.g.: docker build --platform=linux/amd64 -t myapp ..

Then, push it to your registry, e.g. docker push myregistry.com/myapp.

Consult Docker's getting started docs for more detail on building and pushing.

References

Local Development

Follow these instructions to set up and run this project on your local machine.

Note: This project requires Python 3.10 or higher.

  1. Clone the Repository:

    git clone https://github.com/MinDutch03/file_based_chatbot.git
  2. Install Dependencies:

    pip install -r requirements.txt
    pip install pytesseract pillow
  3. Set up Tesseract: On Windows:

  4. Set up Google API Key:

    • Obtain a Google API key and set it in the .env file.
    GOOGLE_API_KEY=your_api_key_here
  5. Run the Application:

    streamlit run main.py
  6. Upload Files:

    • Use the sidebar to upload files.
    • Click on "Submit & Process" to extract text and generate embeddings.
  7. Chat Interface:

    • Chat with the AI in the main interface.

Project Structure

  • app.py: Main application script.
  • .env: file which will contain your environment variable.
  • requirements.txt: Python packages required for working of the app.
  • README.md: Project documentation.

Dependencies

  • PyPDF2
  • langchain
  • Streamlit
  • google.generativeai
  • dotenv
  • tesseract

Acknowledgments

About


Languages

Language:Python 80.8%Language:Dockerfile 19.2%