"GPT-3 Prompt to Text" tool

gpt3-prompt-to-text is a Python command line program that converts a prompt into text using OpenAI's GPT-3 API (which is the commercial API fopr which a free trial is available). You must have an OpenAI API key. 

It is a simple wrapper around the gpt3-client library and I built it as an experiment, iteratively first with #ChatGPT and then with itself (!) including all auxiliary files and the README. 

For convenience, run the script once with the -k and -s options to store the key in the config file. Once that's done, the key will be read from there for all subsequent uses.

gpt3-prompt-to-text -k [your api key] -s

The following are some usage examples:

Write a short story using the default engine and the API key stored in the configuration file

gpt3-prompt-to-text "Once upon a time"

Suppress repeating the prompt or input into the output

gpt3-prompt-to-text --noecho "print a cat as ASCII art"

Control the number of tokens (length of the output)

gpt3-prompt-to-text "Once upon a time" -t 100

Send the output to a file

gpt3-prompt-to-text "Once upon a time" -t 100 > myfile.txt

Correct the story by prepending an instruction to what has been created

gpt3-prompt-to-text --prepend "Make a dragon appear here:" < myfile.txt

Similar to above but use the GPT-3 edit mode

gpt3-prompt-to-text --edit "Make a dragon appear here:" < myfile.txt

Edit the story file directly with an instruction

gpt3-prompt-to-text --edit-file myfile.txt "Make a dragon appear here"
Share on Twitter, Reddit, Facebook or LinkedIn