This Chatbot is an AI-powered chatbot that can assist users with various queries. It uses OpenAI's GPT-3.5-turbo model for generating responses and integrates with a web interface built using Flask and a desktop interface using Tkinter.
- Web scraping using Selenium
- Text processing with NLTK
- Embedding creation with OpenAI
- Web interface with Flask
- Desktop interface with Tkinter
- Python 3.10 or higher
- pip (Python package installer)
- Chrome browser (for Selenium)
-
Clone the repository:
git clone https://github.com/yourusername/ricks-chatbot.git cd ricks-chatbot -
Create and activate a virtual environment:
python3 -m venv botenv source botenv/bin/activate # On Windows use `botenv\Scripts\activate`
-
Install required packages:
pip install -r requirements.txt
-
Set up environment variables:
- Create a
.envfile in the root directory and add your OpenAI API key:
OPENAI_API_KEY=your-actual-openai-api-key - Create a
-
Download NLTK data:
python -m nltk.downloader punkt averaged_perceptron_tagger popular averaged_perceptron_tagger_eng
-
Run the bot_web.py script to scrape data and create embeddings:
python bot_web.py
This script will:
-
Start the Flask server:
python app.py
-
Open your browser and navigate to:
http://localhost:2023
- Use the web interface to interact with the chatbot.
-
NLTK Data Not Found:
- Ensure you have downloaded the required NLTK data:
python -m nltk.downloader punkt averaged_perceptron_tagger popular averaged_perceptron_tagger_eng
-
Invalid OpenAI API Key:
- Make sure your
.envfile contains a valid OpenAI API key.
- Make sure your
-
Selenium WebDriver Issues:
- Ensure you have Chrome installed and the correct version of ChromeDriver.