No project description provided
Project description
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
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
prompt_peel-0.1.0.tar.gz
(7.2 kB
view details)
Built Distribution
File details
Details for the file prompt_peel-0.1.0.tar.gz
.
File metadata
- Download URL: prompt_peel-0.1.0.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.4 Darwin/23.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21613e77e0887800ab85718ab2d60f2d25051d5c1b0c13067ba82d8c0df014a5 |
|
MD5 | 119be75e239dddd66e72ef1c851c090f |
|
BLAKE2b-256 | 1b67dc42132b620e5daf3c186434c6e231316bc68d69d8f2faf5868396a09a49 |
File details
Details for the file prompt_peel-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: prompt_peel-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.12.4 Darwin/23.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 656a01a14003b431ed50bd63d86047280f187bdb3b3ec58bf6f147d94b6099f6 |
|
MD5 | 0d3ce39b22dbca659d38a38b662bcfaa |
|
BLAKE2b-256 | dd9b2dcd77bf9e5ef6c4c4c8737344ae6a9e86d127b0e627eb19735a91be4dba |