PromptL
pip install promptl-ai
Requires Python 3.9 through 3.14.
What is PromptL?
PromptL offers a common, easy-to-use syntax for defining dynamic prompts for LLMs. It is a simple, yet powerful language that allows you to define prompts in a human-readable format, while still being able to leverage the full power of LLMs.
This repository contains the Python bindings for PromptL. Go to the main repository to learn more.
Usage
from promptl_ai import Promptl
promptl = Promptl()
prompt = """
<step>
First, think step by step about how to answer the user's question.
<user>
Taking into account this context: {{context}}
I have the following question: {{question}}
</user>
</step>
<step>
Finally, answer the user's question succinctly yet complete.
</step>
"""
chain = promptl.chains.create(
prompt=prompt,
parameters={
"context": "PromptL is a templating language specifically designed for LLM prompting.",
"question": "What is PromptL?",
},
)
conversation = chain.step()
conversation = chain.step("Reasoning...") # LLM response
conversation = chain.step("Answer...") # LLM response
print(conversation.messages)
Find more examples.
Development
Requires uv 0.8.17 or higher.
- Install dependencies:
uv venv && uv sync --all-extras --all-groups - Add [dev] dependencies:
uv add [--dev] <package> - Run linter:
uv run scripts/lint.py - Run formatter:
uv run scripts/format.py - Run tests:
uv run scripts/test.py - Build package:
uv build - Publish package:
uv publish
License
The PromptL bindings are licensed under the MIT License - read the LICENSE file for details.
Release files for promptl-ai 1.5.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 | |
|---|---|---|---|
| promptl_ai-1.5.0.tar.gz | 952.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| promptl_ai-1.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.9 MB
Release files / promptl_ai-1.5.0.tar.gz
| Download URL | promptl_ai-1.5.0.tar.gz |
|---|---|
| Size | 952.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2505ccdfea70eb03df3c29edb7e57e0823a4ae016bcaeb944624240c6b118699
|
|
BLAKE2b-256 checksum How to use checksums |
07a3d292235ce07cec8bb6ef8f4e3ff219d729c203196b62e2c3db717fb46b5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / promptl_ai-1.5.0-py3-none-any.whl
| Download URL | promptl_ai-1.5.0-py3-none-any.whl |
|---|---|
| Size | 929.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1a98badc272289caec23a73004fffdc83a396485f3febe90eaccd5487f32b85f
|
|
BLAKE2b-256 checksum How to use checksums |
4a2b6c8b3f081ac3b244651e59722e11a0ab86ce5861947750c91e8cb15ff7cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|