Package: gpt3-prompt-to-text
gpt3-prompt-to-textgpt3-prompt-to-text is a command line program that converts a prompt into text using OpenAI's GPT-3 API. It is a simple wrapper around thegpt3-clientlibrary. The program is meant to be simple and easy to use.This code was developed by the very junior developer GPT-3 with patient mentoring by Clemens Vasters.InstallationWith Python 3 installed, runpip install git+https://github.com/clemensv/gpt3-prompt-to-text.gitSign up for an OpenAI API KeyTo use this tool, you need to sign up for an API key atOpenAI.Usagegpt3-prompt-to-text [prompt] [-k | --api-key] [-e | --engine] [-s | --store] [-t | --tokens] [--edit] [--edit-file] [--noecho] [--amend] [--prepend]OptionsOptionDescriptionpromptThe prompt to convert into text-h, --helpshow this help message and exit-k API_KEY, --api-key API_KEYThe OpenAI API key to use-e ENGINE, --engine ENGINEThe GPT-3 engine to use (e.g.gpt3-davinci-003orada). Optional.gpt3-davinci-003is the default.-s, --storeStore the provided parameters in a configuration file-t TOKENS, --tokens TOKENSThe maximum number of tokens to generate--editUse the edit option. Takes the input to edit from stdin and the prompt from the command line--edit-file EDIT_FILEUse the edit option. Takes the input to edit from a file and the prompt from the command line. Writes the output back to the file.--endpointThe OpenAI endpoint to use. Optional. Defaults tohttps://api.openai.com/v1/engines.--show-deploymentsShow model deployments when running in Azure OpenAI--noechodon't echo the input--prepend PREPENDadd the prepend text to the input (which is read from stdin)Read prompt from stdinecho [prompt] | gpt3-prompt-to-textConfiguration fileThe configuration file is stored in the user's profile directory and is named.gpt3-prompt-to-text-config.json. It contains the following fields:{
"api_key": "The OpenAI API key to use",
"engine": "The GPT-3 engine to use",
"tokens": "The maximum number of tokens to generate"
}Store the API keyFor convenience, run the script once with the -kl 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] -sExamplesThere are a few examples for how to use the tool:Get helpgpt3-prompt-to-text -hWrite a short story using the default engine and the API key stored in the configuration filegpt3-prompt-to-text "Once upon a time"Suppress repeating the prompt or input into the outputgpt3-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 100Send the output to a filegpt3-prompt-to-text "Once upon a time" -t 100 > myfile.txtCorrect the story by prepending an instruction to what has been createdgpt3-prompt-to-text --prepend "Make a dragon appear here:" < myfile.txtSimilar to above but use the GPT-3 edit modegpt3-prompt-to-text --edit "Make a dragon appear here:" < myfile.txtEdit the story file directly with an instructiongpt3-prompt-to-text --edit-file myfile.txt "Make a dragon appear here"DevelopmentFor information on how to contribute to the project and what prerequisites must be installed, seeCONTRIBUTING.md.LicenseThis project is licensed under the MIT License - see theLICENSEfile for details.Code of ConductThis project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. SeeCODE_OF_CONDUCT.mdfor details.