Skip to content

Instantly share code, notes, and snippets.

@juanmirod
Created April 23, 2023 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juanmirod/fce0104af6714c7527fce54639706407 to your computer and use it in GitHub Desktop.
Save juanmirod/fce0104af6714c7527fce54639706407 to your computer and use it in GitHub Desktop.
I ask for the readme of the project to ChatGPT

You: I have a git repo that contains a command line interface with ChatGPT using python, can you write a nice readme for it? You need to add this info: the dependencies are in the requirements.txt file, to install them is recomended to use venv and then pip install -r requirements.txt, the are several personalities or characters samples in the repo, to run them simply run python3 and the name of the file, you need an ENV variable called API_KEY, you have to put your OpenAI apikey there, you can use a .env file for that.

JARVIS:

Sure, here's a sample readme for your git repo:

ChatGPT CLI

This is a command line interface that uses OpenAI's GPT API to simulate chat with various personalities. The interface is written in Python and requires an OpenAI API key to function.

Dependencies

All dependencies are listed in the requirements.txt file. To install dependencies, it's recommended to use a virtual environment such as venv.

pip install -r requirements.txt

Usage

To start the chat, run the following command:

python3 chatgpt.py

The command will prompt you to choose a personality and start the conversation. There are several sample personalities provided in the repo, which can be run simply by specifying the name of the file:

python3 batman.py

Before running the chat, you need to set the API_KEY environment variable to your OpenAI API key. You can either set this variable in your working environment, or use a .env file in the project directory.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the MIT license.

You: can you add instructions on howto use venv? the user can do python3 -m venv local to define a virtual environment and not polute the global environment

JARVIS:

Sure thing! Here's an updated version of the README with instructions on using venv:

ChatGPT CLI

This is a command line interface that uses OpenAI's GPT API to simulate chat with various personalities. The interface is written in Python and requires an OpenAI API key to function.

Dependencies

All dependencies are listed in the requirements.txt file. To install dependencies, it's recommended to use a virtual environment such as venv.

Setting up a Virtual Environment

To create a virtual environment for the project, run the following command:

python3 -m venv local

This will create a virtual environment called local in your project directory.

Next, activate the virtual environment using the command:

source local/bin/activate

This will activate the virtual environment and any packages you install will be installed locally instead of globally.

To install the required dependencies for the project, run:

pip install -r requirements.txt

Using the ChatGPT CLI

To start the chat, run the following command:

python3 chatgpt.py

The command will prompt you to choose a personality and start the conversation. There are several sample personalities provided in the repo, which can be run simply by specifying the name of the file:

python3 batman.py

Before running the chat, you need to set the API_KEY environment variable to your OpenAI API key. You can either set this variable in your working environment, or use a .env file in the project directory.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the MIT license.

You: thats great thanks

JARVIS:

You're welcome! If you have any other questions or need further assistance, feel free to ask.

You: q

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment