/AI-Chatbot

Primary LanguageJavaScriptMIT LicenseMIT

AI Chatbot with FastAPI and AWS Elastic Beanstalk

Table of Contents

Overview

This project aims to build a conversational AI chatbot using FastAPI and deploy it on AWS Elastic Beanstalk. The chatbot leverages OpenAI's GPT-3 for generating responses and uses FAISS for efficient similarity search.

the bot in build using AWS Elastic Beanstalk in here

Features

  • Real-time conversation with the AI chatbot base on GPT-3.5
  • PDF document upload for contextual conversations
  • Chat interface
  • Deployed on AWS Elastic Beanstalk

beanstalk

Prerequisites

  • Python 3.8 or upper
  • FastAPI
  • Uvicorn
  • OpenAI API Key
  • AWS Elastic Beanstalk CLI

Installation

  1. Clone the repository:
git clone https://github.com/ScottLL/AI-Chatbot.git
  1. Navigate to the project directory:
cd AI-Chatbot
  1. Install the required packages:
pip install -r requirements.txt
  1. Create a .env file and add your OpenAI API key:
OPENAI_API_KEY=your_openai_api_key_here

Usage

  1. Run the FastAPI application:
uvicorn app:app --host 0.0.0.0 --port 8000
  1. Open your browser and navigate to http://localhost:8000.

API Endpoints

  • POST /upload/: Upload PDF files for contextual conversations
    • Replace ScottBot.pdf with your own promp file (PDF).
  • POST /ask/: Send a question to the chatbot
    • need to adjust fetch address http://localhost:8000/ask/" in script.js when you deploy the app.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Contact

Scott - scott.lai@duke.edu