Skip to main content

Prompt Builder — Jinja2 → XML compiler for DAP agent prompts

Project description

dap-prompt-dsl

Prompt Builder — kompilator JSON context + Jinja2 template → walidowany XML prompt dla DAP agentów.

Why

DAP zasada: prompt jest kodem. Każdy agent ma prompt_template (Jinja2) i input_schema. Builder jest deterministyczną pure function — input → output, brak side effects, brak LLM. Sandbox + defused parser dla bezpieczeństwa.

Usage

from dap_prompt_dsl import build_prompt

result = build_prompt(
    template="<agent_prompt><role>{{ role }}</role></agent_prompt>",
    context={"role": "test_author"},
)
# BuildResult(xml="...", warnings=[], valid=True)

Bezpieczeństwo

  • Jinja2 SandboxedEnvironment — agent prompt_template może pochodzić z user input (dashboard); sandbox blokuje access do dunder methods, file I/O.
  • defusedxml dla parsowania — protections XXE, billion laughs, external entities.

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

dap_prompt_dsl-0.3.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dap_prompt_dsl-0.3.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file dap_prompt_dsl-0.3.0.tar.gz.

File metadata

  • Download URL: dap_prompt_dsl-0.3.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for dap_prompt_dsl-0.3.0.tar.gz
Algorithm Hash digest
SHA256 14f9ed0bf9107f48c30858b78b5d8fb5098b6b50031b0dea6b807f0582e4a99d
MD5 071c120ae1f8199aae35eccb17576967
BLAKE2b-256 42bcf3aaf464852af2cd24c897ad02004dc1da35dc23dd96af0e6c3caf96af21

See more details on using hashes here.

File details

Details for the file dap_prompt_dsl-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: dap_prompt_dsl-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for dap_prompt_dsl-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5753aa9caf3944ba5c6fb6ff70041d763f0409cccf542b95d585ffe87b46ce0b
MD5 ac8ef986991b764f2f0c10e39349d16d
BLAKE2b-256 06b0a2468cb353c7d72cc2deb77430b104b89e09d49c183be0daa006928810c2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page