This repository contains sample projects done using OpenAI API.
Before running the code, make sure you have the following:
- OpenAI API key: Sign up on the OpenAI website and obtain an API key.
- Python 3.x: Install Python on your system.
-
Clone the repository:
git clone https://github.com/madawas/openai-experiments.git
-
Install the required packages:
pip install openai python-dotenv termcolor
-
Set up environment variables:
-
Create a
.envfile in the project directory. -
Add the following line to the .env file and replace 'YOUR_API_KEY' with your actual OpenAI API key:
API_KEY=YOUR_API_KEY -
-
Navigate to the
<repository_home>/chatbotdirectory -
Run the code
python chatbot.py- Interact with the chatbot:
- The chatbot will greet you with an introductory message.
- Enter your messages and press Enter to receive responses from the chatbot.
- To exit the chatbot, press Ctrl+C.
This is a basic interactive code reviewer based on command line. This takes a code file as an argument and provides suggestions to improve the code quality and fixes bugs.
-
Navigate to the
<repository_home>/code_reviewerdirectory -
Run the code
python reviewer.py <input_file_path>