README.md in gpt-cli-0.1.2 vs README.md in gpt-cli-0.1.3
- old
+ new
@@ -1,9 +1,9 @@
# GPTCLI
This library provides a UNIX-ey interface to OpenAI.
-It is a fork of [openai_pipe](https://github.com/Aesthetikx/openai_pipe), created by [Aesthetikx](https://github.com/Aesthetikx/openai_pipe), kudos to him for his awesome work!
+It is a fork of [openai_pipe](https://github.com/Aesthetikx/openai_pipe), created by [Aesthetikx](https://github.com/Aesthetikx/), kudos to him for his awesome work!
The goal of this fork was to add the ability to choose which OpenAI model to use, as well as adding context prompts support. Thanks to these new features, you can have your own highly specialized GPT4 personal assistant, directly in your terminal! Productivity stonks 📈📈📈
See [Installation](#installation) and [Setup](#setup) below, but first, some examples.
## Examples
@@ -183,12 +183,16 @@
```
Set the model you want to use in ENV:
```bash
export OPENAI_MODEL="gpt-3.5-turbo"
```
-(Optional) set the default context prompt you want to use (for now, there's only 3 basic prompts available `python`, `fullstack` and `blockchain` in `lib/contexts.rb`):
+Copy `gpt_contexts.sample.json` somewhere, for example `~/Documents/gpt_contexts.json`, then put the file path in ENV:
```bash
+export OPENAI_CONTEXTS_PATH="path to gpt_contexts.json"
+```
+(Optional) set the default context prompt you want to use (for now, there's only 3 basic prompts available `python`, `fullstack` and `blockchain` in `gpt_contexts.sample.json`):
+```bash
export OPENAI_DEFAULT_CONTEXT="python"
```
By default the executable is called `gpt-cli`. It is reccommended to alias this command to something shorter in .bashrc or equivalent, e.g.
```bash
alias gpt="gpt-cli"
@@ -196,19 +200,28 @@
## Usage
There's two optional parameters you can set when running `gpt`:
`gpt -c <custom_context_prompt> -p <your prompt>`
-`--context -c`: this will be the context prompt, see basic contexts in `lib/contexts.rb`. You can put a key ofrom the contexts hash of `lib/contexts.rb` or a custom context.
+
+`--context -c`: this will be the context prompt, see basic contexts in `gpt_contexts.sample.json`. You can put a key from `gpt_contexts.json` or a custom context. Default to ENV `OPENAI_DEFAULT_CONTEXT` if not set. Add your own context prompts in `gpt_contexts.json`.
+
`--prompt -p`: your actual prompt.
+
You can also run gpt without any arguments, just your question. In this case, the context prompt will default to the one defined by ENV var `OPENAI_DEFAULT_CONTEXT` if it exists. If not, no context will be added.
See examples above for an overview of some usecases. Possibilities are endless.
## Notes
Be aware that there is a cost associated every time GPT3 is invoked, so be mindful of your account usage. Also be wary of sending sensitive data to OpenAI, and also wary of arbitrarily executing scripts or programs that GPT3 generates.
Also, this is my very first time working in Ruby. So please be indulgent 🙏
-A future release will replace `lib/contexts.rb` by a JSON file so user will be able to easily add/modify custom context prompts.
+
+## TODO
+
+- Add conversation history support
+- Add internet search support to feed prompt more accurately
+- Add dall-e support
+- Add proper documentation
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.