-
Notifications
You must be signed in to change notification settings - Fork 39
Description
Is your feature request related to a problem? Please describe.
Ability to run in browser, and other non-python-friendly environments. Improve startup time. Establish a common ground across the many agent libraries, by providing a common AST+interpreter+toolchain.
Describe the solution you'd like
By implementing the interpreter in Rust, we achieve many of these goals. For example, Rust has a direct path to WASM, which enables running at least partially in a serverless web app. It also allows PDL to be embedded into other python projects while avoiding python versioning issues.
Describe alternatives you've considered
We could instead have implemented a set of interpreters, e.g. one in python, one in typescript, ...
Punch List
We have already merged (via #857) some initial work on this. Remaining work is summarized below.
Orthogonal Features
-
--data
and--data-file
command line option feat: support for --data and --data-file in rust interpreter #894 - trace generation feat: initial pdl__id and --trace support for rust interpreter #912
- defsite information for messages
- parallel model calls
- stream none feat: rust interpreter support for modelResponse, ollama-rs tooling calling, and no-stream #883
- contribute
- parser: json
- parser: jsonl fix: rust ast support for gsm8k, including jsonl parser #924
- parser: yaml
- parser: regex findall, findmatch, match, default feat: some regex parser support for rust interpreter #929
- parser: regex split mode (stubs in place, with
todo!()
panic - parser: pdl (missing from ast)
- join
- python structs in PdlResult
- concrete types for LocalizedExpression instead of String feat: introduce Expr typing and apply it to IfBlock.condition #899 feat: update rust Call AST to use Expr for condition attr #901 feat: update rust Repeat AST to use Expr for
for
attr #904 fix: in rust ast, allow ModelBlock model to be an expr #911 fix: update rust interpreter to create Data blocks for expr eval, and model_input trace field #914 - line number information
- minijinja eval_str -> render_and_return_state and... somehow make PdlResult compatible with state.lookup() results
Blocks
- String block
- Jinja expansions
- MessageBlock
- TextBlock basic
- TextBlock def
- TextBlock defs
- ModelBlock Ollama
- ModelBlock Ollama tool calling feat: rust interpreter support for modelResponse, ollama-rs tooling calling, and no-stream #883
- ModelBlock non-Ollama
- ModelBlock granite.io
- CallBlock (no args)
- CallBlock (with args)
- CodeBlock Python
- CodeBlock Python pips
- CodeBlock Python cross-block variables
- CodeBlock other
- EmptyBlock
- IfBlock
- RepeatBlock
- MatchBlock
- DataBlock
- ArrayBlock
- ObjectBlock
- LastOfBlock
- ReadBlock stdin
- ReadBlock text file
- ReadBlock struct file with def
- ReadBlock multiline feat: add support for multiline reads to rust interpreter #868
- ImportBlock
- IncludeBlock
TO BE DEPRECATED
- GetBlock