A tiny GPT CLI tool. You can chat with the GPT model developped by OpenAI and save the conversation as json.
![](https://private-user-images.githubusercontent.com/24406372/238320066-91969861-9f29-4c81-9505-620ef5567a5b.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkxODkxOTIsIm5iZiI6MTcxOTE4ODg5MiwicGF0aCI6Ii8yNDQwNjM3Mi8yMzgzMjAwNjYtOTE5Njk4NjEtOWYyOS00YzgxLTk1MDUtNjIwZWY1NTY3YTViLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI0VDAwMjgxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ1NDUyMWRhYWM0ZmM2M2E3ZjA2ZmNkNGQxOTZmNDNjMzgxYTNkOTlmODAzNGYyNjRjZjRmMDU3OTlhNDcxZTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.aLtdmiT54dZ05EidJumhv2oKwS_u_17iD5OR2DeXgAQ)
Assuming you have an environment variable with key named OPENAI_API_KEY
.
If you don't have a OpenAI API key visit here, generate one and add it as an environment variable
export OPENAI_API_KEY=<YOUR-OPENAI-API-KEY>
You can install the package using pip:
$ pip install oregpt
Once you have installed oregpt, you can run it by typing:
$ oregpt
There are a few options:
$ oregpt --help
Usage: oregpt [OPTIONS]
Options:
-V, -v, --version Show the version and exit.
-m, --model_name TEXT Model name in OpenAI (e.g, gpt-3.5-turbo, gpt-4)
-a, --assistant_role TEXT Role setting for Assistant (AI)
--help Show this message and exit.
Commands such as saving and loading conversations are available as the following:
Command | Description |
---|---|
/exit |
Exit from this chat tool |
/quit |
Exit from this chat tool |
/q |
Exit from this chat tool |
/clear |
Clear chat history all |
/history |
Show chat history in json format |
/save |
Save chat history in json format |
/load |
Load chat history from a json file |
/help |
Show all commands which you can use in this chat tool |
You can specify the place of conversation log
,
style (color etc)
and
the model supported in /v1/chat/completions endpoint provided by OpenAI
in ~/.config/oregpt/config.yml
❯ cat ~/.config/oregpt/config.yml
log: /tmp/oregpt/
openai:
model: gpt-3.5-turbo
# You can also specify OpenAI's API key here
# api_key: <your-api-key>
character:
user:
name: Me
style: "#00BEFE"
assistant:
name: AI
style: "#87CEEB"
role: "You are a chat bot"
system:
name: System
style: "#cc0000"