🚀 Introducing ChatGPT Mini: A sleek command line interface for ChatGPT!
🤑 Save money with a cost-effective alternative to ChatGPT Plus!
🔒 Enjoy complete privacy for your conversations!
To run this code, you will need to have the following libraries installed:
- openai
- rich
You will also need to have an OpenAI API key. You can sign up for an API key here.
- Clone the repository to your local machine:
git clone https://github.com/<username>/chatgpt-mini.git
- Install the required libraries:
pip install -r requirements.txt
- Set your OpenAI API key as an environment variable:
export OPENAI_API_KEY=<your-api-key>
Alternatively, you can set your API key directly in the code by replacing the value of the API_KEY
constant.
- Run the code:
python chatgpt_mini.py
When you run the code, you will be prompted to select a GPT model and provide a context for the chatbot. Once you have provided this information, the chatbot will initialize and provide an initial message.
To interact with the chatbot, simply type a message and press Enter. The chatbot will generate a response based on the input and provide it in the console. You can continue to converse with the chatbot by entering additional messages.
To exit the chat, type exit
and press Enter. To clear the chat history and start a new conversation, type clear
and
press Enter.
At the end of the chat, the total cost of the conversation will be displayed in a table.
© 2023 by Adhish Thite. All rights reserved.
Made with ❤️ in भारत 🇮🇳