Download Latest Version Version 0.9.3 source code.zip (5.3 MB)
Email in envelope

Get an email when there's a new version of Prompt Declaration Language

Home / v0.9.3
Name Modified Size InfoDownloads / Week
Parent folder
PDL_0.9.3_universal.app.tar.gz 2026-02-26 10.7 MB
PDL_0.9.3_universal.dmg 2026-02-26 10.7 MB
PDL_0.9.3_amd64.AppImage 2026-02-26 83.8 MB
PDL-0.9.3-1.x86_64.rpm 2026-02-26 6.5 MB
PDL_0.9.3_amd64.deb 2026-02-26 6.5 MB
PDL_0.9.3_aarch64.AppImage 2026-02-26 81.9 MB
PDL-0.9.3-1.aarch64.rpm 2026-02-26 6.3 MB
PDL_0.9.3_arm64.deb 2026-02-26 6.3 MB
README.md 2026-02-26 4.9 kB
Version 0.9.3 source code.tar.gz 2026-02-26 4.9 MB
Version 0.9.3 source code.zip 2026-02-26 5.3 MB
Totals: 11 Items   222.7 MB 0

New Features

The main new features are:

  • Add the variables pdl_usage and pdl_scope to the PDL scope
  • Add a scope field to the code blocks
  • Add a parameters field to Jinja code blocks

New special variable

The pdl_usage variable contains the statistics accumulated by the calls the the models. Here is a simple examples showing the fields of the pdl_usage variable.

text:

- Hello
- model: ollama/granite4:micro
- |
  Usage Statistics:
  - Model calls: ${ pdl_usage.model_calls }
  - Prompt tokens: ${ pdl_usage.prompt_tokens }
  - Completion tokens: ${ pdl_usage.completion_tokens }
  - Total tokens: ${ pdl_usage.prompt_tokens + pdl_usage.completion_tokens }

The pdl_scope variable allows to do reflexion on the variables in scope at the current execution point. The following examples list the available variables:

defs:
  greeting: Hello
  name: World
text:

- |
  ${ pdl_scope["greeting"]}, ${ pdl_scope["name"] }!
  Available variables in scope:
- for:
    key: ${ pdl_scope.keys() }
  repeat:
    text: |
      - ${ key }

The scope field in code blocks

The user can now specify which variables are available the the scope of the code executed in a code Python and Jinja code block (by default all of the variables in pdl_scope are available). Here is an example where the variable x and y are in scope for the code block, but not the variable z:

defs:
  z: 0
lang: python
scope:
  x: 10
  y: 20
code: |
  result = x + y

Jinja code block parameters

The user can now configure Jinja template behavior by passing parameters to the Jinja Template constructor. Here is an example that configures Jinja's whitespace handling:

defs:
  items:
    data:

    - apple
    - banana
    - cherry
lang: jinja
parameters:
  trim_blocks: true
  lstrip_blocks: true
code: |
  Shopping List:
  {% for item in items %}
    - {{ item }}
  {% endfor %}

  Total items: {{ items | length }}

Non-backward compatible changes

This release introduce some changes that are not compatible with previous versions of PDL:

  • the syntax of the signatures generated by .signature on functions has changed
  • the re-evaluation of rule of aggregator declarations, functions have changed

What's Changed

Full Changelog: https://github.com/IBM/prompt-declaration-language/compare/v0.9.2...v0.9.3

Source: README.md, updated 2026-02-26