Skip to content

reworkd/prompt-peel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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 explanatory
  • user_prompt(*children): Self explanatory
  • assistant_prompt(*children): Self explanatory
  • scope(*children): Create a new scope
  • top_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

About

[WIP] Peel back your prompts 🍌

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages