A simple yet powerful prompt templating engine
Project description
Promuet
A simple yet powerful prompt templating engine
Promuet is a simple Python library for designing complex chains of prompts using basic prompt templates. See below for an example.
Example Usage
At the core, Promuet is just
template = TemplateMatchItem(
"""
Task {{task_number:int}}: {{task_title}}
Description: {{task_description}}
Verification: {{task_verification_items:list}}
"""
)
input_string = """
Task 12: Clean the house
Description:
I need to clean the house to make it nice.
The floors need to be cleaned, the rugs vacuumed, and the laundry folded.
Verification:
- Floors should have no dust
- Rugs should be free of dirt
- Laundry should be folded
"""
data = template.parse(input_string)
assert data['.str'].strip() == textwrap.dedent(input_string).strip()
data = extract_data_vars(data)
assert data == dict(
task_number=12,
task_title='Clean the house',
task_description='I need to clean the house to make it nice.\n\nThe floors need to be cleaned, the rugs vacuumed, and the laundry folded.',
task_verification_items=[
'Floors should have no dust',
'Rugs should be free of dirt',
'Laundry should be folded',
],
)
Installation
pip install promuet
License
promuet is distributed under the terms of the MIT license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
promuet-0.3.2.tar.gz
(8.4 kB
view details)
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 promuet-0.3.2.tar.gz.
File metadata
- Download URL: promuet-0.3.2.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ffa15504c07a68da6036ec130ef496ada8410ab393ddb59aa361468e3bab268
|
|
| MD5 |
3f262fbdcbead0cc3fcc4f57242631b4
|
|
| BLAKE2b-256 |
d2f237442c61a8b8e71b40fbe0d3f6a8b44c409162a369566f3340afa6a58b16
|
File details
Details for the file promuet-0.3.2-py3-none-any.whl.
File metadata
- Download URL: promuet-0.3.2-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af746742268db0d5bf4c784d9c999b74ab952439e39c47a960e27c0501b76154
|
|
| MD5 |
04ca0fb4ecfdd08a6f67ebfe15f3851f
|
|
| BLAKE2b-256 |
8d7121b648f5d3e52009216bb832c65cb48ce3b67ce52d0547d0ee97e445ea85
|