| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| PDL_darwin_universal.app.tar.gz | 2025-11-10 | 10.7 MB | |
| PDL_0.9.0_universal_darwin.dmg | 2025-11-10 | 10.7 MB | |
| PDL_0.9.0_aarch64_linux.AppImage | 2025-11-10 | 80.8 MB | |
| PDL-0.9.0-1.aarch64_linux.rpm | 2025-11-10 | 6.4 MB | |
| PDL_0.9.0_arm64_linux.deb | 2025-11-10 | 6.4 MB | |
| PDL_0.9.0_amd64_linux.AppImage | 2025-11-10 | 82.9 MB | |
| PDL-0.9.0-1.x86_64_linux.rpm | 2025-11-10 | 6.5 MB | |
| PDL_0.9.0_amd64_linux.deb | 2025-11-10 | 6.5 MB | |
| README.md | 2025-11-10 | 5.0 kB | |
| Version 0.9.0 source code.tar.gz | 2025-11-10 | 4.8 MB | |
| Version 0.9.0 source code.zip | 2025-11-10 | 5.2 MB | |
| Totals: 11 Items | 221.0 MB | 0 | |
New Features
The main new features are:
contributeto a file or standard input and error@pdlPython decorator
contribute to files
The user can declare a file aggregator that can be used in the contribute to accumulate the results of the blocks.
For example, in the following program, an aggregator named log associated to the file /tmp/log.txt is declared.
This aggregator is used to store the output of the model in the file /tmp/log.txt.
defs:
log:
aggregator:
file: /tmp/log.txt
text:
- Hello
- model: ollama_chat/granite3.3:2b
contribute: [ result, context, log ]
By default, the aggregator stdin and stderr are available to contribute to the standard input and standard error.
It is useful, for example to outpout debug information. In the following program, the raw output of the model is emitted
on the standard error:
text:
- Hello
- model: ollama_chat/granite3.3:2b
modelResponse: raw_response
contribute:
- result
- context
- stderr:
value: ${raw_response}
@pdl Python decorator
In order to make it easy to define functions as PDL programs, we provide a @pdl decorator.
from pdl.pdl import pdl
@pdl
def chain_of_thought(scope):
"""
lastOf:
- "Question: ${ question }\n"
- "Answer: Let's think step by step. "
- model: ollama_chat/granite3.3:2b
parameters:
stop:
- "<|endoftext|>"
- "Question:"
include_stop_sequence: false
"""
return
def main():
result = chain_of_thought(
scope={"model": "ollama_chat/granite3.2:2b",
"question": "How to write Hello World in OCaml?\n"}
)
print(result)
if __name__ == "__main__":
main()
In this example, the function chain_pf_thought is a string representing a PDL program. The free variables in the string are values passed in the dictionary scope given on argument.
What's Changed
- tests: update expected result by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1158
- First class aggregators by @mandel in https://github.com/IBM/prompt-declaration-language/pull/706
- refactor: react pattern in prompt library by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1162
- PDL Python decorator by @vazirim in https://github.com/IBM/prompt-declaration-language/pull/1166
- fix: type error location by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1169
- refactor: interpreter by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1170
- fix: return the value not the future when a closure is called fro jin… by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1208
- feat: the scope of the
contentfield is local by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1225 - feat: replay an execution by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1211
- refactor: performance optimizations by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1228
- feat: add
event_loopto the interpreter config by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1235 - feat: do not reload library when importing multiple time a file by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1243
- feat:
structuredDecodingfield on themodelblock by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1250 - docs: update type checking and structured decoding in the tutorial by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1254
- feat: improve error messages by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1259
- fix: imported files can use stdlib by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1264
- fix: improve error messages by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1276
- fix: avoid catching
KeyboardInterruptby @mandel in https://github.com/IBM/prompt-declaration-language/pull/1298 - fix: bug in ipython code block by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1314
- refactor: use TypedDict for exec program output by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1322
- feat: do not dump location tables in the trace by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1326
- feat: collect global statistics on LLM usage by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1328
- feat: add
llm_usageto theexec_*config by @mandel in https://github.com/IBM/prompt-declaration-language/pull/1331
Full Changelog: https://github.com/IBM/prompt-declaration-language/compare/v0.8.0...v0.9.0