Console for ChatGPT
If you are using Dox, simply:
- Clone the repo
- Place the key inside ./key directory
- dox build && dox run
Otherwise, you may pass OPENAI_API_KEY or OPENAI_API_KEY_PATH to docker run
e.g. docker run -e OPENAI_API_KEY=s-267e2...287 IMAGE_NAME
- Install python requirements (and obviousely python3!)
$ pip install -r requirements.txt
- Install
rlwrap
(used to enable navigation in prompt history)
$ sudo apt-get install rlwrap # Debian, Ubuntu
# sudo dnf install rlwrap # CentOS, Fedora
$ sudo pacman -S rlwrap # Arch Linux
$ brew install rlwrap # macOS
> choco install rlwrap # Windows
- Rename your API key to
openai.api_key
and place it underkey
directory:
$ cat ./key/openai.api_key
sk-I0j2C2Co...SjCz45
- Make sure
console
is executable.
$ chmod +x ./console
$ cd /path/to/chipline
$ ./console
>
Now you can prompt via the console.
$ python chipline_openai.py [module] [prompt]
Available modules:
- chat
- grammar
Example:
$ python chipline_openai.py chat What is the oldest Empire?