Prompt-peel 🍌
A Python prompt design library heavily based on Priompt from Cursor/Anysphere. Build declarative prompts that automatically select the "optimal" prompt based on priority
What's wrong with prompt design today?
TODO
How does priompt/prompt-peel aim to fix it?
TODO
DSL
Top level
system_prompt(*children): Self explanatoryuser_prompt(*children): Self explanatoryassistant_prompt(*children): Self explanatoryscope(*children): Create a new scopetop_k(*children, top_k_value=N)empty(tokens=N): Empty cell used to to define how many tokens you require
Getting started
Using the library
poetry add prompt-peel
Contributing to the library
TODO
git checkout ____
- Look to the tests to get the best understanding of library features and practices. Ensure tests pass before PR-ing
- Before PRs, run linting via
./lint.sh
TODO
- Token counting logic
- Binary search for optimal priority
- Empty node to save space for N tokens
- Top K node to only take top k elements from a list
- Accept function calling
- Allow images in prompts
Caveats
- JSX is much more ergonomic than python strings. Automatic node splitting (when you embed elements amonst strings), automatic spacing on new line, automatic de-tabbing, etc. You must actively account for this in python (as seen in the examples)
- The aim is not to have feature parity with Priompt or even to follow their architecture in the long run. We think they've done a great job and currently provide the functionality we ourselves need,
Contributing
Contributions are welcome. Please open an issue or a pull request. Test cases are required.
Relevant reading
- Priompt: What this library is based off. A good read to understand their foundational principals.
- Writing DSLs: A short primer for what a DSL is and why you'd want to write one
- Build your own React: A good look into how the DSL of React/JSX is implemented and handled
Metadata
Release files for prompt_peel 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| prompt_peel-0.1.0.tar.gz | 7.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| prompt_peel-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.8 kB
Release files / prompt_peel-0.1.0.tar.gz
| Download URL | prompt_peel-0.1.0.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21613e77e0887800ab85718ab2d60f2d25051d5c1b0c13067ba82d8c0df014a5
|
|
BLAKE2b-256 checksum How to use checksums |
1b67dc42132b620e5daf3c186434c6e231316bc68d69d8f2faf5868396a09a49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.4 Darwin/23.1.0
|
Release files / prompt_peel-0.1.0-py3-none-any.whl
| Download URL | prompt_peel-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
656a01a14003b431ed50bd63d86047280f187bdb3b3ec58bf6f147d94b6099f6
|
|
BLAKE2b-256 checksum How to use checksums |
dd9b2dcd77bf9e5ef6c4c4c8737344ae6a9e86d127b0e627eb19735a91be4dba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.4 Darwin/23.1.0
|