A simple chatbot that uses the OpenAI GPT-4o model to generate responses to user input. I created this project to learn how to use the OpenAI API and experiment with different chatbot configurations.
These instructions will help you set up and run the project on your local machine for development and testing purposes.
- Python 3.x
pip
(Python package installer)
-
Clone the repository:
git clone https://github.com/yourusername/yourproject.git cd yourproject
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Create a
.env
file in the root directory of the project and add your OpenAI API key:echo "OPENAI_API_KEY=your_openai_api_key_here" > .env
- Run the main script:
python src/main.py
The following environment variables are required:
OPENAI_API_KEY
: Your OpenAI API key.
Example .env
file:
OPENAI_API_KEY=your_openai_api_key_here