| Name | Modified | Size | Downloads / 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_usageandpdl_scopeto the PDL scope - Add a
scopefield to the code blocks - Add a
parametersfield 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
.signatureon functions has changed - the re-evaluation of rule of aggregator declarations, functions have changed
What's Changed
- Fix in MessageBlock by @vazirim in https://github.com/IBM/prompt-declaration-language/pull/1410
- fix: close event loop cleanly by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1415
- tests: update tests results by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1438
- docs: Add missing comments and docstrings to pdl_ast.py by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1440
- refactor: replace Union and Optional with | None syntax by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1441
- change to assistant message post-processing by @vazirim in https://github.com/IBM/prompt-declaration-language/pull/1442
- Prevent AggregatorBlock from being cached in replay by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1449
- Add usage to scope by @gbdrt in https://github.com/IBM/prompt-declaration-language/pull/1448
- Change MessageBlock.tool_calls type to OptionalExpressionList by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1447
- fix: replay of blocks raising exceptions by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1451
- Fix: Add FunctionBlock to replay check in process_block_body_with_replay by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1464
- feat: implement scope field handling for CodeBlock by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1479
- feat: add
pdl_scopeto the scope by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1480 - feat: Use LiteLLM syntax for tool call signature by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1477
- tests: switch examples to granite 4 by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1475
- feat: add a
parametersfield to Jinja code blocks by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1485 - feat: add a
get_tool_callsfunction instdlibby @mandel in https://github.com/IBM/prompt-declaration-language/pull/1484 - docs: fix tutorial by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1496
- fix: FileAggregator resource leak by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1497
Full Changelog: https://github.com/IBM/prompt-declaration-language/compare/v0.9.2...v0.9.3