Skip to content

Instantly share code, notes, and snippets.

@clemensv
Created December 11, 2022 14:28
Show Gist options
  • Save clemensv/7489010b044589d757a96237262c529a to your computer and use it in GitHub Desktop.
Save clemensv/7489010b044589d757a96237262c529a to your computer and use it in GitHub Desktop.
ChatGPT code-gen prompt
Try this:
First prompt:
=========================
Create a Python script. The script takes a prompt from the command line and creates text using OpenAI's GPT-3 API.
Write no explanations or step-by-step instructions. Do not tell me what to do. Do not show the files. Write no headlines. Verify that the script meets all requirements. Just tell me if you understood all requirements and have created the files.
The following requirements must be met for the script:
The script must be written in Python.
The script must use OpenAI's GPT-3 API.
The script must be a command line program.
The script must allow for providing the API key on the command line.
The script must have a default engine value.
The script must allow for storing parameters in a JSON configuration file.
The script must read the configuration file automatically and set the parameters.
The script must allow for overriding configuration file parameters with command line arguments.
The script must provide descriptive help.
The configuration file must be stored in the user's profile directory.
The script must be installable as an executable with PIP.
The script must have a setup.py file.
The script must be executable after installation.
The script version must be dependent on the repository version tag.
The script must allow for reading the prompt from stdin.
The script must not require the prompt when the --store parameter is given.
Print a list of the files you created.
=========================
Second prompt:
========================
Show for each file how to echo (using -e option) its literal content into corresponding files in the current directory. Do this separately for each file. Echo each line separately.
========================
The script is likely quite incomplete at this point. That is ok. But the echo commands must dump code. If the assistant tries to explain how to generically echo files at this point, reset.
Third prompt:
========================
I don't think the script meets all requirements. Correct that. Write no explanations or step-by-step instructions. Do not tell me what to do. Do not show the files. Write no headlines. Verify that the script meets all requirements. Show for each file how to echo (using -e option) its literal content into corresponding files in the current directory. Do this separately for each file. Echo each line separately.
========================
Then keep writing "continue output" as it stops. You will likely have to manually assembly some of the "echo" commands.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment