Skip to content

Latest commit

Β 

History

History
99 lines (71 loc) Β· 2.14 KB

File metadata and controls

99 lines (71 loc) Β· 2.14 KB

πŸ“Œ AI Web Chatbot with Flask & OpenAI

A Flask-based AI chatbot that provides interactive learning support using OpenAI's GPT models.
The chatbot runs entirely in a web browser and can be easily deployed.


πŸš€ Features

πŸ‘‰ Interactive AI Chatbot – Powered by OpenAI's API
πŸ‘‰ Fully Web-Based – No need for a terminal interface
πŸ‘‰ Uses LangChain for Enhanced AI Responses
πŸ‘‰ Bootstrap & jQuery UI – Responsive and mobile-friendly
πŸ‘‰ Flask Backend – Handles AI requests efficiently
πŸ‘‰ Easy Deployment – Run locally or deploy to the cloud


πŸ“Œ Project File Structure

πŸ“‚ **YourRepoName/**  
β”œβ”€β”€ πŸ“ **templates/**  # HTML templates for the chatbot UI  
β”‚   β”œβ”€β”€ πŸ“„ **index.html**  # Main chat interface  
β”œβ”€β”€ πŸ“ **static/**  # Static files (CSS, JS)  
β”‚   β”œβ”€β”€ 🎨 **style.css**  # Custom chatbot styles  
β”œβ”€β”€ πŸ“ **chatbot.py**  # AI processing logic  
β”œβ”€β”€ πŸ–₯ **app.py**  # Flask web server  
β”œβ”€β”€ πŸ“„ **requirements.txt**  # List of dependencies  
β”œβ”€β”€ πŸ”‘ **.env**  # OpenAI API key (not shared in GitHub)  
└── πŸ“– **README.md**  # Project documentation  

πŸ“Œ Installation & Setup

πŸ‘‰ 1️⃣ Create a Virtual Environment

To isolate dependencies, create a virtual environment:

python -m venv .venv

Activate it:

  • Windows:
    .venv\Scripts\activate
  • macOS/Linux:
    source .venv/bin/activate

πŸ‘‰ 2️⃣ Install Dependencies

Install all required dependencies using:

pip install -r requirements.txt

πŸ“Œ Setting Up OpenAI API Key

πŸ”§ 1️⃣ Create a .env file in the root of your project:

touch .env

πŸ” 2️⃣ Add your OpenAI API key to .env:

OPENAI_API_KEY=your-openai-api-key-here

🎯 Running the Chatbot Locally

πŸ’» 1️⃣ Start the Flask Web Server:

python app.py

🌍 2️⃣ Open in Your Browser:

http://127.0.0.1:5000/auth

πŸ’¬ 3️⃣ Start Chatting!

Simply enter your message and get real-time responses.


worWebChatBot-2