Command line REPL for GPT-based tools
Project description
gpt-repl
Interactively play with GPT-based tools from the command line
Description
gpt-repl is a REPL interface for interacting with GPT-based tools. The base mode is synth-chat which mimics ChatGPT functionality using the normal OpenAI GPT-3 API and iterative self-summary.
This project is still in the early stages of development. It will have bugs and frequent breaking changes.
Install
For now, Python >=3.9 is required. Use pip3 instead of pip if necessary.
pip install -U gpt-repl
If you don't have an OpenAI API key create one here and set it:
export OPENAI_API_KEY="<your api key>"
Usage
gpt-repl @thread-name [-m mode-name]
Use gpt-repl modes to list available REPL modes and gpt-repl threads to list open threads.
Inside the REPL, type .help for a list of commands and keyboard shortcuts. This is the current output of .help:
Commands
.clear or .cl: Clears the terminal screen.
.copy or .cp: Copies the first code block in the most recent response to the clipboard.
.debug or .db: Triggers a breakpoint in the mode backend.
.editor or .e: Opens the current message in the text editor specified by $EDITOR.
.exit: Closes the REPL.
.help or help: Prints a list of available commands and a brief description of each.
.print or .pp: Prints the internal prompt representation
.publish or .pub: Publishes the current thread online and prints the URL.
.retry: or .r: Resubmits the most recent successful response.
.rename: Renames the current thread. The new name must be provided as an argument to this command, e.g. ".rename my_new_name". The old thread isn't deleted.
.reset or .rs: Resets the history of the thread.
.seed or .s: The text following .seed will be set as the conversation seed. Set no text to clear the seed.
.thread or .name: Prints the current thread name.
.threads: Lists all threads.Shortcuts
Enter: Submits the current message.
Tab: Adds a new line.
C+c: Closes the REPL.
C+d: Closes the REPL.
C+r: Search message history.
C+x-C+e: Opens the current message in the text editor specified by $EDITOR.Tips:
To shape your conversation, consider setting a conversation seed using the
.seed DESCRIPTIONcommand. Some examples:
.seed You must use Markdown headers on every message.seed You must contantly use exclamation marks.seed You must speak in rhymesSeeds work best when set early in a conversation and are best phrased as commands.
If you don't like the most recent response, retry it with
.retryIf the thread has gone completely off the rails, reset it with
.resetMany commands have shorter aliases e.g.
.seedhas.s. See the command list for more info.
Custom Modes
Add a Python file that looks like this to $GPT_REPL_CONFIG_PATH/plugins/. By default this will be ~/.config/gpt_repl/plugins/.
See gpt_repl/modes for more complete examples.
Development
To install gpt-repl from source:
git clone git@github.com:veered/gpt-repl.git
cd gpt-repl
pip install -U flit
flit install -s
Screenshot
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gpt-repl-0.4.16.tar.gz.
File metadata
- Download URL: gpt-repl-0.4.16.tar.gz
- Upload date:
- Size: 24.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.27.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f783d687dcdb8c34976061c33d262b4f4d090167bbf756562e9bc9ac2e981a85
|
|
| MD5 |
a2c689d7b5ed6428246fdb8f25ad6ea9
|
|
| BLAKE2b-256 |
383b61b3cbf5a4a92d0d283e1909dc63b90783b921425ea718d8430b140df991
|
File details
Details for the file gpt_repl-0.4.16-py3-none-any.whl.
File metadata
- Download URL: gpt_repl-0.4.16-py3-none-any.whl
- Upload date:
- Size: 28.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.27.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f6f2e522622cb2f18638a667c6e8279b404e9caa4c9d0304173389299baea1b
|
|
| MD5 |
8d1702e0bce769f4d70cdd1de15bfb1e
|
|
| BLAKE2b-256 |
20c8ba0e7d414cc14d1c226f9acdab2baa5a6e17c71acaea23bbf446b7eed965
|