Lightweight Python library for parsing and rendering POML prompts
Project description
Pomlight (Python)
Lightweight Python library for parsing and rendering POML prompts.
Install
pip install pomlight
Usage
from pomlight import poml
messages = poml("""<poml>
<system>You are a helpful assistant.</system>
<user>What is 2 + 2?</user>
</poml>""")
print(messages[0]["content"]) # "You are a helpful assistant."
print(messages[1]["content"]) # "What is 2 + 2?"
Use with OpenAI SDK
from openai import OpenAI
from pomlight import poml
client = OpenAI()
params = poml("""<poml>
<runtime model="gpt-4o-mini" />
<system>You are a helpful assistant. Reply in one short sentence.</system>
<user>What is the capital of France?</user>
</poml>""", format="openai_chat")
response = client.chat.completions.create(**params)
print(response.choices[0].message.content)
Feature Coverage
See FeatureCoverage.md for supported components, template features, and what is not implemented.
Development
pip install -e .[dev]
pytest tests/
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 pomlight-0.1.2.tar.gz.
File metadata
- Download URL: pomlight-0.1.2.tar.gz
- Upload date:
- Size: 61.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3151c42a3c67e11852b2d01f3ff6f1f90c39e68d3b9cfab4f90e255ee8aea00
|
|
| MD5 |
a859dc23695cb08c25908addc9740bb1
|
|
| BLAKE2b-256 |
a09f131bdd2c1135e8d0108509383c21b5246df61681ae6f758a391c0685f694
|
Provenance
The following attestation bundles were made for pomlight-0.1.2.tar.gz:
Publisher:
publish-python.yml on gfauchart/pomlight
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pomlight-0.1.2.tar.gz -
Subject digest:
a3151c42a3c67e11852b2d01f3ff6f1f90c39e68d3b9cfab4f90e255ee8aea00 - Sigstore transparency entry: 1312387531
- Sigstore integration time:
-
Permalink:
gfauchart/pomlight@295d203676e44eedc51829892438c9ec0c7d7bc0 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/gfauchart
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@295d203676e44eedc51829892438c9ec0c7d7bc0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pomlight-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pomlight-0.1.2-py3-none-any.whl
- Upload date:
- Size: 28.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcd21179f1db54ee178711679b49920571253a56300f02cfa69e57b5dc6550d2
|
|
| MD5 |
f8529ebb644ea21440e9bdc0c5379583
|
|
| BLAKE2b-256 |
252cd963d3d5b806735e91672f1e8643626c552fdf6500cb2f9722fca508622d
|
Provenance
The following attestation bundles were made for pomlight-0.1.2-py3-none-any.whl:
Publisher:
publish-python.yml on gfauchart/pomlight
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pomlight-0.1.2-py3-none-any.whl -
Subject digest:
fcd21179f1db54ee178711679b49920571253a56300f02cfa69e57b5dc6550d2 - Sigstore transparency entry: 1312387681
- Sigstore integration time:
-
Permalink:
gfauchart/pomlight@295d203676e44eedc51829892438c9ec0c7d7bc0 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/gfauchart
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@295d203676e44eedc51829892438c9ec0c7d7bc0 -
Trigger Event:
push
-
Statement type: