A simple AI Chatbot built in Python that uses the OpenAI API to generate responses to user prompts via a command-line interface.
- OpenAI Integration: Uses the OpenAI API to generate responses.
- CLI Interface: Easily interact with the chatbot using the command line.
- Simple Setup: Minimal dependencies and quick to get started.
- Python 3.7+
- An OpenAI API key
- Clone the repository:
git clone https://github.com/yourusername/AI-Chatbot.git cd AI-Chatbot
Set up a virtual environment (optional but recommended):
bash Copy Edit python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate Install dependencies:
bash Copy Edit pip install -r requirements.txt Set your OpenAI API key as an environment variable:
bash Copy Edit export OPENAI_API_KEY='your_openai_api_key_here' (On Windows, use set instead of export.)
Usage Run the chatbot by executing:
bash Copy Edit python chatbot.py You will be prompted to enter your message. The chatbot will then respond using the OpenAI API.
Contributing Contributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.
License This project is licensed under the MIT License.
yaml Copy Edit
- Enhancements:
- Add a conversational history to maintain context between messages.
- Implement a graphical user interface (GUI) using Tkinter or PyQt.
- Enhance error handling and add logging for better debugging.
This guide should provide you with a solid foundation for your AI Chatbot project. Feel free to extend and customize the chatbot to suit your needs!