semql-prompt
LLM-facing prompt rendering for a semql
Catalog.
semql's compiler is pure — it turns a SemanticQuery into SQL and never
renders a prompt. This package is the rendering layer on top:
- Four-role prompt fragments —
build_planner_prompt_fragment,build_router_prompt_fragment,build_presenter_prompt_fragment,build_drilldown_prompt_fragment,build_query_generator_prompt_fragment. - Cacheable segments —
CatalogPrompt(viewer-invariantstatic+ per-vieweroverlay) for prompt-cache breakpoints, plusprompt_hash. - Tool-description projection —
to_openai_tools/to_langchain_tools/to_openai_functionfor function-calling clients, andto_bedrock_converse_toolsfor the Bedrock Converse API (object-rootedinputSchema). - Prompt-token budgeting —
PromptBudget,apply_budget,estimate_tokens.
Install
pip install semql-prompt
Quick start
The catalog-level conveniences take the catalog as their first argument:
from semql import Catalog
from semql_prompt import planner_prompt, planner_prompt_segments, prompt_hash, to_openai_tools
text = planner_prompt(catalog, viewer=viewer)
segs = planner_prompt_segments(catalog)
key = prompt_hash(catalog)
tools = to_openai_tools(catalog, viewer=viewer)
For the lower-level per-role fragment builders, see API reference.
License
BSD-3-Clause.
Release files for semql-prompt 0.7.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 | |
|---|---|---|---|
| semql_prompt-0.7.0.tar.gz | 29.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| semql_prompt-0.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 61.6 kB
Release files / semql_prompt-0.7.0.tar.gz
| Download URL | semql_prompt-0.7.0.tar.gz |
|---|---|
| Size | 29.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
730932c49aa48af42cceb45269e8abc82d9532b0a2fbe6e0462ab5d0ac2fb0d4
|
|
BLAKE2b-256 checksum How to use checksums |
2ed4b577c10ab842ba6fdba82c5547b7ac42ec81159c2f454c74d94b0584706e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 21, 2026.
Transparency logRelease files / semql_prompt-0.7.0-py3-none-any.whl
| Download URL | semql_prompt-0.7.0-py3-none-any.whl |
|---|---|
| Size | 32.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
376304e4a57f3727c3bf3259a0b8b52996ea3f209b270b29473b7ff627e48aca
|
|
BLAKE2b-256 checksum How to use checksums |
6aa03c3a38c3589a2434a3be9765d4730236b8415da698df8c42727273c3337a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 21, 2026.
Transparency log