Skip to content

cvee112/consolegpt-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ConsoleGPT (Python)

This is one way to implement a ChatGPT-like interface for your shell/console using Python.

How to use

Note: This assumes you already have Python. Check the official Python website if you don't have it.

  1. If you haven't already done so, setup your OpenAI API key (see OpenAI's Quickstart tutorial). Note that you need to be a paying customer to access GPT-4. Install the OpenAI Python library and other dependencies with pip install --upgrade openai requests validators.

  2. Download the script into your preferred location (or clone the repository to your local machine).

  3. Open your terminal and navigate to the script directory or repository (e.g., cd /path/to/script/directory in Linux/macOS).

  4. Input python chatbot.py to run the chatbot. See sample runs here.

This versus other ConsoleGPTs

When I decided on a name, I didn't realize there were other console versions out there named ConsoleGPT (or Console-GPT), but I stuck with the name despite redundancy as it still felt the most fitting.

Some features of this implementation that may or may not be shared by other versions:

  • The interface is on the structured side presentation-wise, mostly because of all the print statements.
  • You can choose between the latest OpenAI models (assuming you have access), give custom instructions, name the chatbot, specify the model temperature (higher = more creative but less coherent), and save/load chat history files with their settings.
  • The Python code reflects recent updates in how OpenAI models should be accessed (e.g., you should now be using chat.completions.create instead of ChatCompletion.create).

Questions or feedback?

Feel free to message me (@cvee) through Discord or email me at [email protected].

License

This work is licensed under the MIT License. See LICENSE for more details.

About

Customizable console version of ChatGPT with Python

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages