A lightweight, modular library for building, composing, and managing structured prompts for LLMs
Project description
prompting-forge
Minimal, focused prompting library for the Tool-Forge ecosystem.
This package provides the core prompt primitives only:
PromptTemplate: define structured prompts with{variables}ChatPrompt: rendered prompt as messages (system + user)
All LLM execution, chaining, and parsing utilities live in genai-forge.
Install
pip install prompting-forge
For chaining (query | template | llm | parser) and model calls:
pip install genai-forge
Python 3.10+.
Quickstart (with genai-forge)
from prompting_forge.prompting import PromptTemplate
from genai_forge import create_llm, PydanticOutputParser
from pydantic import BaseModel
class CityPlan(BaseModel):
city: str
attractions: list[str]
days: int
template = PromptTemplate(
system="You are a concise assistant.",
template="Create a weekend plan.\nCity: {city}",
)
llm = create_llm("openai:gpt-4o-mini", temperature=0.2)
parser = PydanticOutputParser(CityPlan)
query = "Generate a simple weekend plan for a city."
chain = query | template | llm | parser
plan = chain({"city": "Lisbon"})
print(plan)
Notes
PromptTemplateuses Pythonstr.format. Missing variables raise clear errors.- When used with
genai-forge, parser instructions can be appended automatically. - The pipe operators on
PromptTemplateare enabled via a lazy import ofgenai_forge.chain. If you don’t installgenai-forge, you can still calltemplate.format(...)manually and pass the result to your own client.
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 prompting_forge-0.1.2.tar.gz.
File metadata
- Download URL: prompting_forge-0.1.2.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5163b0e67ff873033d8f422678909ab3a4587fc370b924b3e113e605aba13e85
|
|
| MD5 |
60583b7a98ea290b4fc2216687726abc
|
|
| BLAKE2b-256 |
56c84d30b96a2f2653687a02d14159b6825bfaa14bca01a74a259aa453baedf5
|
Provenance
The following attestation bundles were made for prompting_forge-0.1.2.tar.gz:
Publisher:
release.yml on ToolForge-AI/prompting-forge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prompting_forge-0.1.2.tar.gz -
Subject digest:
5163b0e67ff873033d8f422678909ab3a4587fc370b924b3e113e605aba13e85 - Sigstore transparency entry: 688769387
- Sigstore integration time:
-
Permalink:
ToolForge-AI/prompting-forge@949aba33055954e119b2022c805b6115c2fe79da -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/ToolForge-AI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@949aba33055954e119b2022c805b6115c2fe79da -
Trigger Event:
push
-
Statement type:
File details
Details for the file prompting_forge-0.1.2-py3-none-any.whl.
File metadata
- Download URL: prompting_forge-0.1.2-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8942c2b9578b3ed7ef9cc6b7d8f2c870226eeeea369bf143cd3b10d62f621ee7
|
|
| MD5 |
afc02c6f219f0680067b5c6b334816e3
|
|
| BLAKE2b-256 |
dbf2f9fbbecd5f5293f6cf55368efb68bc080f4de96804275f5764b6c139f580
|
Provenance
The following attestation bundles were made for prompting_forge-0.1.2-py3-none-any.whl:
Publisher:
release.yml on ToolForge-AI/prompting-forge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prompting_forge-0.1.2-py3-none-any.whl -
Subject digest:
8942c2b9578b3ed7ef9cc6b7d8f2c870226eeeea369bf143cd3b10d62f621ee7 - Sigstore transparency entry: 688769450
- Sigstore integration time:
-
Permalink:
ToolForge-AI/prompting-forge@949aba33055954e119b2022c805b6115c2fe79da -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/ToolForge-AI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@949aba33055954e119b2022c805b6115c2fe79da -
Trigger Event:
push
-
Statement type: