A simple Python chatbot that uses OpenAI's API to interact with GPT models
- Python 3.12 or newer
- OpenAI API key
- Clone the repository:
git clone https://github.com/PatrykIA/OpenAI_GPT4_Python
cd REPO_NAME
- Install required dependencies:
pip install -r requirements.txt
- Configure environment variables:
- Copy
.env.example
to.env
- Open
.env
file and enter your OpenAI API key
- Copy
Create a `.env` file in the root directory with the following variable:
OPENAI_API_KEY=your_api_key_here
Run the application using:
python main.py
The chatbot will:
- Start a conversation
- Accept user input
- Generate responses using GPT-4
- Continue until you type 'quit', 'exit', or 'bye'
├── main.py # Main application file
├── .env # Environment variables (not tracked in git)
├── .env.example # Example environment variables
├── .gitignore # Git ignore file
├── README.md # This file
└── requirements.txt # Project dependencies
Feel free to submit issues and enhancement requests.
Patryk Rogowski / PatrykIA
- OpenAI for providing the GPT API