Skip to content
This repository has been archived by the owner on Jun 22, 2024. It is now read-only.

Improve the default prompt template #4

Open
12joan opened this issue Jan 13, 2023 · 0 comments
Open

Improve the default prompt template #4

12joan opened this issue Jan 13, 2023 · 0 comments
Labels
good first issue Good for newcomers

Comments

@12joan
Copy link
Owner

12joan commented Jan 13, 2023

OpenAI Codex has changed a lot since I first released this package. It's possible that the examples in the default prompt can be changed to improve the accuracy of completions.

By adding --show-prompt to the command, you can perform a dry run without sending anything to OpenAI.

The relevant source files are ./lib/please/request.rb and ./lib/please/context.rb.

Current default prompt
Write a one-line bash command for each of the following tasks.

# Find all files older than 1 week and open each of them in vim
$ find . -type f -mtime +7 -exec vim {} \;

# Show a clock which updates every second on a single line
$ printf 'import time\nwhile True:\n\tprint(time.strftime("%%H:%%M:%%S"), end="\\r")\n\ttime.sleep(1)' > /tmp/program.py; python3 /tmp/program.py; rm /tmp/program.py

# Write a python program that prints out hello world with each letter on its own line
$ printf 'print("\\n".join(list("Hello World"))' > /tmp/program.py; python3 /tmp/program.py; rm /tmp/program.py

# Read from stdin until EOF, and then output the length of the string
$ printf 'import sys\nprint(len(sys.stdin.read().strip()))' > /tmp/program.py; python3 /tmp/program.py; rm /tmp/program.py

# Run the fortune command 5 times
$ for i in $(seq 5); do fortune; done

# Repeadedly read a single line from the user, reverse it, and print it back
$ printf 'while True:\n\tline = input()\n\tprint(line[::-1])' > /tmp/program.py; python3 /tmp/program.py; rm /tmp/program.py

# Print the current working directory
$ pwd
/app

# Show information about the operating system
$ uname -a
Linux 5cd48dff0cd9 5.15.0-56-generic #62-Ubuntu SMP Tue Nov 22 19:54:14 UTC 2022 x86_64 GNU/Linux

# List all files in the current directory
$ ls -a
.
..
.env
.env.example
.git
.gitignore
.rubocop.yml
Dockerfile
Gemfile
Gemfile.lock
LICENSE.txt
README.md
Rakefile
bin
docker-compose.yml
exe
lib
please.gemspec
test


# say hello
$
@12joan 12joan added the good first issue Good for newcomers label Jan 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant