diff --git a/.github/actions/ollama/action.yml b/.github/actions/ollama/action.yml index 9af8b4fa0..841890b13 100644 --- a/.github/actions/ollama/action.yml +++ b/.github/actions/ollama/action.yml @@ -20,6 +20,7 @@ runs: run: | ollama pull granite3.2:2b ollama pull granite3.2:8b + ollama pull granite3.3:2b ollama pull granite3.3:8b ollama pull mxbai-embed-large ollama list diff --git a/.github/actions/run-examples/action.yml b/.github/actions/run-examples/action.yml index 9dc8205bb..eea97a8e3 100644 --- a/.github/actions/run-examples/action.yml +++ b/.github/actions/run-examples/action.yml @@ -32,7 +32,7 @@ runs: - uses: ./.github/actions/ollama # Configure Run Examples environment - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: token: ${{ inputs.token }} ref: ${{ inputs.head-ref }} @@ -50,7 +50,7 @@ runs: # Run tests - name: Set up Python ${{ inputs.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ inputs.python-version }} - name: Cache pip diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 16f72fe40..1ca33e1c6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,9 +18,9 @@ jobs: python-version: ['3.11', '3.12', '3.13'] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - name: Cache pip diff --git a/.github/workflows/mkdocs-gh-pages.yml b/.github/workflows/mkdocs-gh-pages.yml index b4b90d4b0..216e16d87 100644 --- a/.github/workflows/mkdocs-gh-pages.yml +++ b/.github/workflows/mkdocs-gh-pages.yml @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 # Schema - name: Copy schema run: | @@ -42,9 +42,9 @@ jobs: - name: Setup Pages uses: actions/configure-pages@v5 - name: Setup Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: - python-version: '3.12' + python-version: '3.13' - name: Install required packages run: pip install -U mkdocs "mkdocstrings[python]" mkdocs-material pymdown-extensions - name: Build site (_site directory name is used for Jekyll compatiblity) @@ -53,7 +53,7 @@ jobs: CI: true # Deploy - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@v4 # Deployment job deploy: diff --git a/.github/workflows/pdl-live-react-tests.yml b/.github/workflows/pdl-live-react-tests.yml index 58e14f3e6..87ea2926e 100644 --- a/.github/workflows/pdl-live-react-tests.yml +++ b/.github/workflows/pdl-live-react-tests.yml @@ -19,9 +19,9 @@ jobs: run: working-directory: ./pdl-live-react steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up node - uses: actions/setup-node@v4 + uses: actions/setup-node@v5 with: node-version: 22 - name: Install dependencies diff --git a/.github/workflows/publish-quay.yaml b/.github/workflows/publish-quay.yaml index 296ea4de8..d27d1f79a 100644 --- a/.github/workflows/publish-quay.yaml +++ b/.github/workflows/publish-quay.yaml @@ -22,23 +22,23 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v5 - name: Docker Setup QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ secrets.QUAYIO_USERNAME }} password: ${{ secrets.QUAYIO_TOKEN }} - name: Build and push ${{ github.ref_name }} to ${{ env.REGISTRY }} - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v6 with: context: . platforms: linux/amd64,linux/arm64 diff --git a/.github/workflows/release-static-web-app.yml b/.github/workflows/release-static-web-app.yml index a235da9a9..9a818d819 100644 --- a/.github/workflows/release-static-web-app.yml +++ b/.github/workflows/release-static-web-app.yml @@ -13,15 +13,15 @@ jobs: strategy: fail-fast: false - runs-on: 'ubuntu-22.04' + runs-on: 'ubuntu-24.04' defaults: run: working-directory: ./pdl-live-react steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: setup node - uses: actions/setup-node@v4 + uses: actions/setup-node@v5 with: node-version: lts/* diff --git a/.github/workflows/release-ui.yml b/.github/workflows/release-ui.yml index 6628ceec6..486239a72 100644 --- a/.github/workflows/release-ui.yml +++ b/.github/workflows/release-ui.yml @@ -30,10 +30,10 @@ jobs: run: working-directory: ./pdl-live-react steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: setup node - uses: actions/setup-node@v4 + uses: actions/setup-node@v5 with: node-version: lts/* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ee1e0cffe..a9df29ab4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,9 +16,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: "3.x" - name: Install pypa/build @@ -50,7 +50,7 @@ jobs: steps: - name: Download all the dists - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: name: python-package-distributions path: dist/ @@ -115,7 +115,7 @@ jobs: steps: - name: Download all the dists - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: name: python-package-distributions path: dist/ diff --git a/.github/workflows/run-examples-prep.yml b/.github/workflows/run-examples-prep.yml index 9ea984412..5f9d0f6df 100644 --- a/.github/workflows/run-examples-prep.yml +++ b/.github/workflows/run-examples-prep.yml @@ -12,12 +12,12 @@ jobs: steps: # Detect modified PDL files, includes Add, Modified, but not Deleted - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 - name: Detect all PDL files that were changed or added id: changed-pdl-files - uses: tj-actions/changed-files@6cb76d07bee4c9772c6882c06c37837bf82a04d3 # v46 + uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47 with: files: | **.pdl diff --git a/.github/workflows/run-examples.yml b/.github/workflows/run-examples.yml index abc7fd933..6f5a8ec5d 100644 --- a/.github/workflows/run-examples.yml +++ b/.github/workflows/run-examples.yml @@ -15,7 +15,7 @@ jobs: matrix: python-version: ['3.11', '3.12', '3.13'] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: ref: ${{ github.head_ref }} - uses: ./.github/actions/run-examples diff --git a/.github/workflows/rust-interpreter.yml b/.github/workflows/rust-interpreter.yml index 2d05d439d..05371f8d3 100644 --- a/.github/workflows/rust-interpreter.yml +++ b/.github/workflows/rust-interpreter.yml @@ -5,6 +5,7 @@ on: branches: [ main ] pull_request: branches: [ main ] + workflow_dispatch: # cancel any prior runs for this workflow and this PR (or branch) concurrency: @@ -19,9 +20,9 @@ jobs: run: working-directory: ./pdl-live-react steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up node - uses: actions/setup-node@v4 + uses: actions/setup-node@v5 with: node-version: 22 - name: Install dependencies diff --git a/.github/workflows/tauri-cli.yml b/.github/workflows/tauri-cli.yml index 47886a006..f492de054 100644 --- a/.github/workflows/tauri-cli.yml +++ b/.github/workflows/tauri-cli.yml @@ -19,9 +19,9 @@ jobs: run: working-directory: ./pdl-live-react steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up node - uses: actions/setup-node@v4 + uses: actions/setup-node@v5 with: node-version: 22 - name: Install dependencies diff --git a/.gitignore b/.gitignore index 29771e25e..541d7bd93 100644 --- a/.gitignore +++ b/.gitignore @@ -154,6 +154,9 @@ pdl-live/package-lock.json # Demo files pdl-rag-demo.db test.jsonl +train.jsonl +validation.jsonl +experiments/ # Built docs _site diff --git a/README.md b/README.md index bb0bc3c4a..3d73ef3ef 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,12 @@ To install the `pdl` command line tool: pip install prompt-declaration-language ``` +## What's New + +Check out AutoPDL, PDL's prompt optimizer tool [Spiess et al. (2025)](https://openreview.net/forum?id=CAeISyE3aR)! AutoPDL can be used to optimize any part of a PDL program. This includes few-shots examples and textual prompts, but also prompting patterns. It outputs an optimized PDL program with optimal values. + +For a tutorial on how to use AutoPDL, see [AutoPDL](https://ibm.github.io/prompt-declaration-language/autopdl/) + ## Example Program: A Basic LLM Call PDL GUI diff --git a/contrib/prompt_library/ReAct.pdl b/contrib/prompt_library/ReAct.pdl index f1eb5dcdd..7381e3551 100644 --- a/contrib/prompt_library/ReAct.pdl +++ b/contrib/prompt_library/ReAct.pdl @@ -1,7 +1,7 @@ description: ReAct pattern from Yao et al., [ICLR 2023](https://openreview.net/forum?id=WE_vluYUL-X) # See alternative implementation here: https://smith.langchain.com/hub/hwchase17/react-chat defs: - react_block: + render_icl_sample: function: trajectory: [ object ] return: @@ -9,29 +9,26 @@ defs: - for: trajectory: ${ trajectory } repeat: - text: - - defs: - type: - text: ${ trajectory.keys()|first } - - match: ${ type } - with: - - case: question - then: | - Question: ${ trajectory[type]|trim } - - case: task - then: | - Task: ${ trajectory[type]|trim } - - case: thought - then: | - Tho: ${ trajectory[type]|trim } - - case: action - then: | - Act: ${ trajectory[type]|trim } - - case: observation - then: | - Obs: ${ trajectory[type]|trim } - - if: ${ type not in ['question', 'task', 'thought', 'action', 'observation'] } - then: "${ type }: ${ trajectory[type]|trim }" + defs: + type: ${ trajectory.keys()|first } + match: ${ type } + with: + - case: question + then: | + Question: ${ trajectory[type]|trim } + - case: task + then: | + Task: ${ trajectory[type]|trim } + - case: thought + then: | + Tho: ${ trajectory[type]|trim } + - case: action + then: | + Act: ${ trajectory[type]|trim } + - case: observation + then: | + Obs: ${ trajectory[type]|trim } + - then: "${ type }: ${ trajectory[type]|trim }" - "\n" react: @@ -56,66 +53,77 @@ defs: Respond in the format {"name": function name, "arguments": dictionary of argument name and its value}. Do not use variables. ${ tool_schema } - contribute: [context] - "\n" - for: traj: ${ trajectories } repeat: text: - call: ${ react_block } + call: ${ render_icl_sample } args: trajectory: ${ traj } - ${ task } - - def: prev_action - contribute: [] - data: none - - def: exit - contribute: [] - data: False - - def: tool_names - contribute: [] - text: ${ tool_schema|map(attribute='name')|list } - - repeat: + - defs: + prev_action: null + exit: false + tool_names: ${ tool_schema|map(attribute='name')|list } + repeat: text: - "\nTho: " - - def: thought - model: "${ model }" - contribute: [] - parameters: - stop: - - "Act:" - max_tokens: 256 - include_stop_sequence: false + - defs: + thought: + model: "${ model }" + parameters: + stop: + - "Act:" + max_tokens: 256 + include_stop_sequence: false - "${ thought|trim }" - "\nAct: " - - def: action - model: "${ model }" - parser: json - parameters: - temperature: 0 - stop: ["\n", "Obs:", "<|eom_id|>"] - include_stop_sequence: false - spec: { name: string, arguments: object } - - if: ${ action != prev_action } - then: - def: observation - if: ${ action.name.lower() != "finish" } + - defs: + action: + model: "${ model }" + parser: json + parameters: + temperature: 1.0 + stop: ["\n", "Obs:", "<|eom_id|>"] + include_stop_sequence: false + spec: { name: string, arguments: object } + fallback: + data: + name: error + arguments: { msg: "failed to generate a valid action" } + - "${ action|trim }" + - match: ${ action.name.lower() } + with: + - case: finish then: + def: exit + data: true + contribute: [] + - if: ${ action == prev_action } + then: + def: exit + data: true + contribute: [] + - if: ${ action.name.lower() in tools } + then: + def: observation + text: + - "\nObs: " + - call: ${ tools[action.name.lower()] } + args: + arguments: ${ action.arguments } + - then: + def: observation text: - "\nObs: " - - if: ${ action.name.lower() in tools } - then: - call: ${ tools[action.name.lower()] } - args: - arguments: ${ action.arguments } - else: "Invalid action. Valid actions are ${ tool_names[:-1]|join(', ') }, and ${ tool_names[-1] }." - else: - def: exit - contribute: [] - data: True - - def: prev_action - contribute: [] - data: ${ action } - until: ${ action.name.lower() == "finish" or exit } + - "Invalid action. Valid actions are ${ tool_names[:-1]|join(', ') }, and ${ tool_names[-1] }." + + - defs: + prev_action: ${ action } + until: ${ exit } - data: - answer: ${ (action.arguments.answer|default("No answer found."))|trim } + answer: ${ action.arguments.answer | trim } + fallback: + data: + answer: "No answer found." diff --git a/dockerfile b/dockerfile index 6e8b6d296..6869ff7ba 100644 --- a/dockerfile +++ b/dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11-slim +FROM python:3.13-slim WORKDIR /pdl diff --git a/docs/README.md b/docs/README.md index d000a9430..4224102f1 100644 --- a/docs/README.md +++ b/docs/README.md @@ -50,13 +50,13 @@ pip install 'prompt-declaration-language[examples]' The Live Explorer can be installed as follows (MacOS): ``` -brew install pdl +brew install pdl ``` For other platforms, see installation notes. You can run PDL with LLM models in local using [Ollama](https://ollama.com), or other cloud service. -See [here](https://ibm.github.io/prompt-declaration-language/tutorial/#using-ollama-models) for +See [here](https://ibm.github.io/prompt-declaration-language/tutorial/#using-ollama-models) for instructions on how to install an Ollama model locally. Most examples in this repository use IBM Granite models on [Ollama](https://ollama.com) and some are on [Replicate](https://replicate.com/). In order to run these examples, you need to create a free account @@ -172,7 +172,7 @@ text: temperature: 0 ``` -Notice the syntactic differences. Model ids on watsonx start with `watsonx`. +Notice the syntactic differences. Model ids on watsonx start with `watsonx`. Watsonx also provides a text completion endpoint as shown in the following example. A text completion endpoint does not take chat templates into account: @@ -201,7 +201,7 @@ text: ``` -A PDL program computes 2 data structures. The first is a JSON corresponding to the result of the overall program, obtained by aggregating the results of each block. This is what is printed by default when we run the interpreter. The second is a conversational background context, which is a list of role/content pairs, where we implicitly keep track of roles and content for the purpose of communicating with models that support chat APIs. The contents in the latter correspond to the results of each block. The conversational background context is the list of messages used to make calls to LLMs via LiteLLM. +A PDL program computes two data structures. The first is a JSON corresponding to the result of the overall program, obtained by aggregating the results of each block. This is what is printed by default when we run the interpreter. The second is a conversational background context, which is a list of role/content pairs, where we implicitly keep track of roles and content for the purpose of communicating with models that support chat APIs. The contents in the latter correspond to the results of each block. The conversational background context is the list of messages used to make calls to LLMs via LiteLLM. The PDL interpreter can also stream the background conversation instead of the result: @@ -266,10 +266,10 @@ When we execute this program with the PDL interpreter, we obtain the following t @SuppressWarnings("unchecked") public static Map deserializeOffsetMap(String lastSourceOffset) throws IOException { Map offsetMap; - if (lastSourceOffset == null || lastSourceOffset.isEmpty()) { - offsetMap = new HashMap<>(); + if (lastSourceOffset == null || lastSourceOffset.isEmpty()) { + offsetMap = new HashMap<>(); } else { - offsetMap = JSON_MAPPER.readValue(lastSourceOffset, Map.class); + offsetMap = JSON_MAPPER.readValue(lastSourceOffset, Map.class); } return offsetMap; } @@ -293,10 +293,10 @@ When we execute this new program, we obtain the following: @SuppressWarnings("unchecked") public static Map deserializeOffsetMap(String lastSourceOffset) throws IOException { Map offsetMap; - if (lastSourceOffset == null || lastSourceOffset.isEmpty()) { - offsetMap = new HashMap<>(); + if (lastSourceOffset == null || lastSourceOffset.isEmpty()) { + offsetMap = new HashMap<>(); } else { - offsetMap = JSON_MAPPER.readValue(lastSourceOffset, Map.class); + offsetMap = JSON_MAPPER.readValue(lastSourceOffset, Map.class); } return offsetMap; } diff --git a/docs/assets/pdl_quick_reference.pdf b/docs/assets/pdl_quick_reference.pdf index 43a33b0ae..cee203cf9 100644 Binary files a/docs/assets/pdl_quick_reference.pdf and b/docs/assets/pdl_quick_reference.pdf differ diff --git a/docs/assets/pdl_quick_reference.png b/docs/assets/pdl_quick_reference.png index 3d1c260c9..7dde23456 100644 Binary files a/docs/assets/pdl_quick_reference.png and b/docs/assets/pdl_quick_reference.png differ diff --git a/docs/autopdl.md b/docs/autopdl.md index 73b055ad1..b6d63dff5 100644 --- a/docs/autopdl.md +++ b/docs/autopdl.md @@ -7,108 +7,96 @@ hide: # AutoPDL Tutorial -The following sections show how to use the AutoPDL optimizer to produce optimized PDL programs for specific tasks. - -To optimize a PDL program, we need the program, an optimizer configuration, a dataset, and an _evaluator_. An evaluator is a Python subclass of `OptimizerEvaluator` that evaluates a candidate, which is a generated configuration instance consisting of e.g. fewshot examples. The evaluator class follows this structure: - -```python title="src/pdl/optimize/optimizer_evaluator.py" linenums="1" -class OptimizerEvaluator(Thread): - """Evaluates a candidate (configuration, i.e. fewshots, style) against **one** test example.""" - - def __init__( - self, - pdl_program: Program, - example: dict, - candidate: dict, - index: int, - timeout: int, - yield_output: bool, - config: OptimizationConfig, - cwd: Path, - answer_key: str = "answer", - ) -> None: - super().__init__() - self.pdl_program = pdl_program - ... - - def get_scope(self) -> ScopeType: - """ - Constructs a PDL scope for the candidate, - can take self.candidate and self.config into account - """ - - def extract_answer(self, document: str) -> Any: - """ - Extracts the final answer from the PDL result document, - i.e. the string the PDL program returns - """ - - def answer_correct(self, document: str, answer: Any, truth: Any) -> bool: - """ - Checks the extracted answer against the groundtruth value, - in self.example[self.answer_key] - """ +This tutorial describes how to use AutoPDL, PDL's prompt optimizer tool [Spiess et al. (2025)](https://openreview.net/forum?id=CAeISyE3aR). AutoPDL can be used to optimize any part of a PDL program. This includes few-shots examples and textual prompts, but also prompting patterns. It outputs an optimized PDL program with optimal values. + +## Installing AutoPDL + +Please ensure PDL was installed with extras e.g. + +``` { .bash .copy .annotate linenums="1" } +pip install 'prompt-declaration-language[all]' +# or from source +git clone git@github.com:IBM/prompt-declaration-language.git +cd prompt-declaration-language +pip install -e '.[all]' ``` -Let's go through an example for `GSM8K`. Our PDL program uses different prompt patterns from the prompt library, and the variables `prompt_pattern`, `question`, `model`, and `demonstrations` are inserted at runtime by the evaluator. +## Writing a PDL program to optimize +The first step in using AutoPDL is to write a PDL program that has free variables. Consider for example, the following PDL program, which queries an LLM to correct a sentence with grammatical errors ([file](https://github.com/IBM/prompt-declaration-language/blob/main/examples/optimizer/grammar_correction.pdl)): -```yaml title="examples/optimizer/gsm8k.pdl" linenums="1" ---8<-- "./examples/optimizer/gsm8k.pdl" +```yaml linenums="1" +--8<-- "./examples/optimizer/grammar_correction.pdl" ``` -We write a configuration file for the optimizer, see `src/pdl/optimize/config_parser.py` for all fields: - -``` { .yaml .copy .annotate title="gsm8k_optimizer_config.yml" linenums="1" } -benchmark: gsm8k # Name our benchmark -budget: null # Set a budget, can be number of iterations, or a duration string e.g. "2h" -budget_growth: double # double validation set size each iteration -# or to_max: reach max_test_set_size by final iteration -initial_test_set_size: 2 # size of test set in first iteration -max_test_set_size: 10 # maximum test set size -num_candidates: 100 # how many candidates to evaluate -num_demonstrations: 5 # how many demonstrations to include per candidate -parallelism: 1 # how many threads to run evaluations across -shuffle_test: false # shuffling of test set -test_set_name: test # name of test set -train_set_name: train # name of train set -validation_set_name: validation # name of validation set -demonstrations_variable_name: demonstrations # variable name to insert demonstrations into -variables: # define discrete options to sample from - model: # set ${ model } variable - - watsonx/meta-llama/llama-3-1-8b-instruct - prompt_pattern: # set ${ prompt_pattern } variable to one of these - - cot - - react - - rewoo - num_demonstrations: # overrides num demonstrations above - - 0 - - 3 - - 5 +This program starts with a definition section. Note that a `defs` section is necessary. This is followed by a `lastOf` sequence (a list of blocks to be executed where the result of the last block is returned as the result of the whole sequence). First, the program establishes some demonstrations obtained from a `demonstrations` variable. The `for` loop at lines 5 to 10 ensures that all demonstrations are formatted in a consistent way. On lines 11 to 16 the program formulates a prompt to correct a sentence stored in variable `input`. Lines 17 through 21 show a model call where the model id is given by variable `model`. Finally, lines 23 through 28 check if variable `verify` is set to `true`. If so, it makes another model to verify the previous response and to produce a new one if needed. + +Notice that variables `input`, `model`, `demonstrations`, `verify` are not defined. The first of these is an instance variable that will help in holding different instances when the optimizer is running. The rest of them are parameters to be optimized. We can pick among different models, different demonstrations, and especially different prompting patterns. PDL supports first-class functions, so the program could be made to pick the optimal function to be used, thereby choosing the prompting pattern. In this example, finding an optimal value for `verify` will determine whether it's best to call the model once or twice. + + + +## Dataset + +In addition to the PDL program, AutoPDL also needs a dataset. These will be used to perform the optimization, and as a source of demonstrations. The train split will be used to draw instances and demonstrations, the validation for checking during the optimization, and test to evaluate and obtain a final score at the end of the optimization run. + + In this example, we need a dataset containing sentences with mistakes and the corrected version. We can use [process_grammar_correction.py](https://github.com/IBM/prompt-declaration-language/blob/main/examples/optimizer/process_grammar_correction.py) to obtain a dataset split into train/validation/test. Simply run: + +``` +python process_grammar_correction.py ``` +## Loss function -```python title="examples/optimizer/gsm8k_evaluator.py" linenums="1" ---8<-- "./examples/optimizer/gsm8k_evaluator.py" +The lost function is use to guide the optimizer towards the best solution and evaluate the final program. The loss function can must be a PDL function named `score` that takes as input the result of the program, the ground truth, and returns a floating point number. +In our example, we are using the Levenshtein distance that we import from the `textdistance` Python module. The `score` function is defined in the [`eval_levenshtein.pdl` file](https://github.com/IBM/prompt-declaration-language/blob/main/examples/optimizer/eval_levenshtein.pdl): + +```yaml +--8<-- "./examples/optimizer/eval_levenshtein.pdl" ``` -We can see an example of a script to run the optimization process in `examples/optimizer/optimize.py`. -Usage: +The final ingredient needed is a configuration file as explained in the next section. + +## Writing a configuration file + +An AutoPDL configuration file describes the state-space and parameters for the search. In this example, the configuration is given in the following [file](https://github.com/IBM/prompt-declaration-language/blob/main/examples/optimizer/grammar_correction.yaml): +```yaml +--8<-- "./examples/optimizer/grammar_correction.yaml" ``` -python optimize.py optimize -h -usage: optimize.py optimize [-h] --config CONFIG --dataset-path DATASET_PATH [--experiments-path EXPERIMENTS_PATH] - [--yield_output | --no-yield_output] [--dry | --no-dry] - pdl_file + +Field `pdl_path` is the path to the PDL program to optimize. `dataset` points to the dataset to be used. In this case, it's an object with paths for train/validation/test splits. +`demonstrations_variable_name` gives the name of the PDL variable that will hold the demonstrations in the optimized program. `demonstration_columns` indicates the field names in the dataset that will be used to create demonstrations, and `instance_columns` are those fields that will be used to formulate an instance query (see the query in the PDL program above, which uses `input`). The `groundtruth_column` holds the field with the ground truth (in this case `output`). `eval_pdl` is the path of the PDL program that encapsulates the loss function. + +`initial_validation_set_size` is the initial size of the validation set (i.e., the number of tests used initially to validate candidates). `max_validation_set_size` indicates the maximum to which this validation set will grow. For more details on the successive halving algorithm used in AutoPDL see [here](https://arxiv.org/abs/2504.04365). `max_test_set_size: 10` is the maximum of the test set used to evaluate at the end of the evaluation run. `num_candidates` indicates the number of candidates to consider (sampled randomly). `parallelism` indicates the level of parallelism used by the optimizer. + +Last but not least, `variables` indicates the domain of each variable that needs to be tuned. In this case, `model` can be either an Ollama Granite model or gpt-oss. `num_demonstration` is a special variable that the user can set to indicate how many demonstrations to consider. In this case, zero-shot is also included. Finally, the domain of variable `verify` can be `true` or `false`. + +Notice that variable `input` in the PDL program is not given a domain. This is because it will hold the different instances that will be evaluated (it was included in the `instance_columns` field). + +For a complete list of available fields in the configuration file is given in the configuration parser [file](https://github.com/IBM/prompt-declaration-language/blob/main/src/pdl/optimize/config_parser.py). + + +We are ready to run the optimizer! + +## Running AutoPDL + +To run the optimizer, execute the following command: + +``` +pdl-optimize -c grammar_correction_example.yml ``` -We also need a dataset to optimize against, with `train`, `test`, and `validation` splits. To produce such a dataset, we can use HuggingFace Datasets `load_dataset` and `save_to_disk`. This example requires the dataset to have columns `question`, `reasoning`, and `answer`, which can be created from the original `openai/gsm8k` dataset. Processing scripts are under development and will follow shortly. +After a while, AutoPDL creates a new file `optimized_grammar_correction.pdl` with definitions for all the free variables. It determined that gtp-oss is the better model for the task at hand, and that `verify` is best set to False. The optimized program contains the selection of demonstrations. To run this program add a definition for `input`: -We can run an example like so: +``` +defs: + ... + input: This sentence have an error. +``` +To run the optimized program, execute the command: ``` -cd examples/optimizer -python optimize.py optimize --config config.yml --dataset-path datasets/gsm8k gsm8k.pdl +pdl optimized_grammar_correction.pdl ``` -Once the process is complete, a file `optimized_gsm8k.pdl` is written. This file contains the optimal configuration and is directly executable by the standard PDL interpreter. +A log of the optimization process is written to `experiments/` by default. diff --git a/docs/tutorial.md b/docs/tutorial.md index 2f0f37d70..2e6f84fc3 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -35,42 +35,39 @@ Hello, world! In this program ([file](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/calling_llm.pdl)), the `text` starts with the word `"Hello\n"`, and we call a model (`ollama/granite3.2:2b`) with this as input prompt. The model is passed a parameter `stop` to indicate the stop sequences. -A PDL program computes 2 data structures. The first is a JSON corresponding to the result of the overall program, obtained by aggregating the results of each block. This is what is printed by default when we run the interpreter. The second is a conversational background context, which is a list of role/content pairs (list of messages), where we implicitly keep track of roles and content for the purpose of communicating with models that support chat APIs. The contents in the latter correspond to the results of each block. The conversational background context is what is used to make calls to LLMs via LiteLLM. +A PDL program computes two data structures. The first is a JSON corresponding to the result of the overall program, obtained by aggregating the results of each block. This is what is printed by default when we run the interpreter. The second is a conversational background context, which is a list of role/content pairs (list of messages), where we implicitly keep track of roles and content for the purpose of communicating with models that support chat APIs. The contents in the latter correspond to the results of each block. The conversational background context is what is used to make calls to LLMs via LiteLLM. -In this example, since the `input` field is not specified in the model call, the entire text up to that point is passed to the model as input context, using the +In this example, the input of the model is `[{"role": "user", "content": "Hello\n"}]` which corresponds to the entire text up to that point using the default role `user`. -When we execute this program using the interpreter, we obtain: +When we execute this program using the interpreter, we obtain the following result where the second `Hello` has been generated by Granite: ``` Hello Hello ``` -where the second `Hello` has been generated by Granite. - -Here's another example of model call that includes an `input` field ([file](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/calling_llm_with_input.pdl)): +The input of to the model can also be provided explicitly using the `input` field. +Here is an example of model call using this feature ([file](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/calling_llm_with_input.pdl)): ```yaml --8<-- "./examples/tutorial/calling_llm_with_input.pdl" ``` -In this case, the input passed to the model is the sentence: `Translate the word 'Hello' to French` and nothing else from the surrounding document. When we execute this program, we obtain: +In this case, the input passed to the model is `[{"role": "user", "content": "Translate the word 'Hello' to French"}]` and nothing else from the surrounding document. When we execute this program, we obtain the following result where the second line is generated by the model.: ``` Hello Bonjour (pronounced bon-zhoor) is the translation for "Hello" in French. It's an informal greeting used during the day, similar to how we use "Hi" or "Hello." For a more formal context, you might say "Bonjour," which means "Good day." ``` -where the second line is generated by the model. - Using the `input` field, we can also give a directly an array of messages (`role`/`content`) to the model ([file](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/calling_llm_with_input_messages.pdl)): ```yaml --8<-- "./examples/tutorial/calling_llm_with_input_messages.pdl" ``` -This has the same output as the previous program. An alternative way of writing this is [this](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/calling_llm_with_input_messages_var.pdl) program. +This has a similar output as the previous program. An alternative way of writing this program using a variable to store the prompt is [this program](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/calling_llm_with_input_messages_var.pdl). ### Parameter defaults for watsonx Granite models @@ -89,25 +86,45 @@ When using Granite models, we use the following defaults for model parameters: The user can override these defaults by explicitly including them in the model call. -## Variable Definition and Use -Any block can define a variable using a `def: ` field. This means that the output of that block is assigned to the variable ``, which may be reused at a later point in the document. +## Building the background context with `lastOf` -Consider the following example ([file](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/variable_def_use.pdl)): +The pervious example explicitly provides a list of messages with different roles to the LLM call. This can also be done implicitly using the background context. + +Each block can be annotated with a `role` field indicating the role that is used when a message is added to the background context by the block or any of the sub-block that does not redefine it. +In this example, we add a `system` message asking the model to provide answer formally ([file](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/role.pdl)): ```yaml ---8<-- "./examples/tutorial/variable_def_use.pdl" +--8<-- "./examples/tutorial/role.pdl" ``` -Here we assign the output of the model to variable `GEN` using the `def` field. The last line of the program prints out the value of `GEN`. Notice the notation `${ }` for accessing the value of a variable. Any [Jinja](https://jinja.palletsprojects.com/en/3.1.x/) expression is allowed to be used inside these braces. These expressions -are also used to specify conditions for loops and conditionals. See for example this [file](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/programs/chatbot.pdl). +In this program, we explicitly indicated the top-level `user` role which is added automatically by the interpreter otherwise. +This role is inherited by the `"Hello\n"` block and masked in the next block to define a system prompt. +So the context provided as input to the LLM is `[{"role": "user", "content": "Hello\n"}, {"role": "system", "content": "You are a polite assistant that likes to answer very formally."}]`. The answer produced by the model block has the `assistant` role. -When we execute this program, we obtain: +The execution of this program produces: ``` Hello +You are a polite assistant that likes to answer very formally. +Greetings! I trust this message finds you in good health and high spirits. How may I be of assistance today? Please feel free to pose your query or request, knowing that I am here to serve with diligence and precision. +``` + +If we want to add the `system` message to the background context without having it present in the result, we can use a `lastOf` block. +The `lastOf` is associated to a list of blocks that are executed in sequence. +Each sub-block contributes messages to the background context but the result of the block is the result of the last block. +The following program provides the same input to the LLM, but the system prompt is not part of the result ([file](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/lastOf.pdl)): + +```yaml +--8<-- "./examples/tutorial/lastOf.pdl" +``` + +Therefore, the result of the program is: + +``` Hello -GEN is equal to: Hello + +Greetings! I trust this message finds you in good health and high spirits. How may I be of assistance today? Please feel free to pose your query or request, knowing that I am here to serve with diligence and precision. ``` ## Model Chaining @@ -118,77 +135,97 @@ In PDL, we can declaratively chain models together as in the following example ( --8<-- "./examples/tutorial/calling_llm_chaining.pdl" ``` -In this program, the first call is to a Granite model with the prompt `"Hello\n"`. The following block in the program prints out the sentence: `"\nDid you just say Hello?\n"`. The final line of the program takes the entire context produced so far and passes it as input to the Granite model. Notice that the input passed to this model is the context up to that point, represented as a conversation. This makes it easy to chain models together and continue building on previous interactions. Notice how the conversational context is accumulated implicitly without requiring the user to explicitly manage messages. +In this program, the first block result is `Hello\n` and adds a message with this value to the background context. The second block calls Granite on the background context containing the Hello message and adds the response of the model to the result and context. The following block contributes the sentence: `\nTranslate the above to French\n`. The final line of the program takes the entire context produced so far and passes it as input to the Granite model. Notice that the input passed to this model is the context up to that point, represented as a conversation. This makes it easy to chain models together and continue building on previous interactions. Notice how the conversational context is accumulated implicitly without requiring the user to explicitly manage messages. When we execute this program, we obtain: ``` Hello Hello -Did you just say Hello? -Yes, I did. That's how I greet people in this conversation. It's a common way to start a dialogue. How can I assist you today? +Translate the above to French +Bonjour ``` -## Function Definition +## Variable Definition and Use -PDL also supports function definitions to make it easier to reuse code. -Suppose we want to define a translation function that takes a string and calls a Granite model for the translation. This would be written in PDL as follows ([file](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/function_definition.pdl)): +Any block can define a variable using a `def: ` field. This means that the result of that block is assigned to the variable ``, which may be reused at a later point in the document. + +Consider the following example ([file](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/variable_def_use.pdl)): ```yaml ---8<-- "./examples/tutorial/function_definition.pdl" +--8<-- "./examples/tutorial/variable_def_use.pdl" ``` -In this program, the first block defines a function `translate` that takes as parameters `sentence` and `language`, both of which are of type string. The body of the function is defined by its `return` field. In this case, we formulate a translation prompt using the parameters and send it to a Granite model. +Here we assign the response of the model to variable `GEN` using the `def` field. The last line of the program prints out the value of `GEN`. Notice the notation `${ }` for accessing the value of a variable. Any [Jinja](https://jinja.palletsprojects.com/en/3.1.x/) expression is allowed to be used inside these braces. These expressions +are also used to specify conditions for loops and conditionals. See for example this [file](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/programs/chatbot.pdl). -The last two blocks are calls to this function, as indicated by `call: ${ translate }`. This block specifies the arguments to be passed. When we execute this program, we obtain: +When we execute this program, we obtain: ``` -'J'aime Paris !' -'Me encanta Madrid.' +Hello +Hello +The variable GEN is equal to: Hello ``` -A function only contributes to the result when it is called. So the definition itself results in `""`. When we call a function, we implicitly pass the current background context, and this is used as input to model calls inside the function body. In the above example, since the `input` field is omitted, the entire document produced at that point is passed as input to the Granite model. - -To reset the context when calling a function, we can pass the special argument: `pdl_context: []`. - -Notice that the arguments of function calls are expressions and cannot be arbitrary PDL blocks. +## Local Computation Using `defs` -A function name can be aliased (see [example](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/function_alias.pdl)). +In the previous example, the value of the variable `GEN` computed by the `model` block is part of the result and is added to the background context. To define the variable `GEN` without contributing to the result and context, the `model` block can be moved into a `defs` ([file](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/local_computation.pdl)): -The context inherited by a function can be reset at the call site (see [example](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/function_empty_context.pdl)). +```yaml +--8<-- "./examples/tutorial/local_computation.pdl" +``` -Functions can be declared with optional parameters (see [example](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/function_optional_params.pdl)). +The execution of this program produces: -## Grouping Variable Definitions in Defs +``` +Hello +The variable GEN is equal to: Hello +``` -In PDL, the above program can be written more neatly by grouping certain variable definitions into a `defs` section, as follows ([file](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/defs.pdl)): +The `defs` field can be added on any block and can introduce multiple variables. +The following program defines two variables `fr` and `es` associated to a `text` block that uses them ([file](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/defs.pdl)): ```yaml --8<-- "./examples/tutorial/defs.pdl" ``` -This program has the same output has the one from the previous section. +This program first output `Hello` and add it in the context. +Then, the blocks defining the `fr` and `es` variables are both executed in a context containing only the `Hello` message. These blocks are using a `lastOf` that adds the value to each sub-blocs to the context and output the value of the last block. Finally, the value of the variables are used in the `text` block. -Any block can have a `defs` field defining variables used in that block. Notice it's different than the `def` field which stores the -result of the block after execution. +The output of this program is: -For another example, see [file](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/defs-hello.pdl). +``` +Hello -## Muting Block Output with contribute +In Fench: Bonjour! -By default, when a PDL block is executed it produces a result that is contributed to the overall result, and it also contributes to the background context. It is possible to mute both contributions by setting `contribute` to `[]` for any block. This feature allows the computation of intermediate values that are not necessarily output as a result. The value of the variable specified in `def` is still set to the result of the block. +Translation of "Hello" in French is "Bonjour". -Consider the similar example as above, but with `contribute` set to `[]` ([file](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/muting_block_output.pdl)): +In Spanish: Hola! + +La traducción de "Hello" al español es "Hola". +``` + +## Control Block Outputs with `contribute` + +By default, when a PDL block is executed, it produces a result that is contributed to the overall result, and it also contributes to the background context. We saw that `defs` and `lastOf` gives some control over the contribution to the result of context. `defs` executes a block without contributing to the context and name the result that can be used later. `lastOf` contributes only to the context for all of its sun-blocks except the last one. It is also possible to control the contribution of each block using the `contribute` field. + +Consider an example similar as above, but that uses `contribute` instead of `defs` and `lastOf` ([file](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/muting_block_output.pdl)): ```yaml --8<-- "./examples/tutorial/muting_block_output.pdl" ``` -The call to the translator with French as language does not produce an output. However, we save the result in variable `FRENCH` and use it in the last sentence of the document. When we execute this program, we obtain: +Instead of a `lastOf`, we set `contribute` to `[context]` for the block that produces `"\nTranslate to French\n"`. That way, we only contribute to the context and not to the result. +We set `contribute` to `[]` for the call to the LLM such that it does not produce an output but only save the result in the `fr` variable that is used in the last block of the program. When we execute this program, we obtain: ``` -The french sentence was: 'J'aime Paris !' -``` +Hello + +In Fench: Bonjour! + +Translation of "Hello" in French is "Bonjour". +``` In general, `contribute` can be used to set how the result of the block contribute to the final result and the background context. Here are its possible values: @@ -201,7 +238,43 @@ Here are its possible values: - `[result, context]`: contribute to both, which is also the default setting. -## Specifying Data + +## Function Definition + +PDL supports function definitions to make it easier to reuse code. +Suppose we want to define a translation function that takes a string and calls a Granite model for the translation. This would be written in PDL as follows ([file](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/function_definition.pdl)): + +```yaml +--8<-- "./examples/tutorial/function_definition.pdl" +``` + +In this program, the `defs` field defines a function `translate` that takes as parameters `sentence` and `language`, both of which are of type string. The body of the function is defined by its `return` field. In this case, we formulate a translation prompt using the parameters and send it to a Granite model. + +The body of the program is a `text` block that calls this function twice, as indicated by `call: ${ translate }`. The `call` block specifies the arguments to be passed. When we execute this program, we obtain: + +``` +J'aime Paris ! +Me encanta Madrid. +``` + +When we call a function, we implicitly pass the current background context, and this is used as input to model calls inside the function body. In the above example, since the `input` field is omitted, the entire document produced at that point is passed as input to the Granite model. + +To reset the context when calling a function, we can pass the special argument: `pdl_context: []` (see [example](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/function_empty_context.pdl)). + +Functions can be declared with optional parameters (see [example](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/function_optional_params.pdl)). + +PDL is a language with higher order functions meaning that functions are values. So for example, a function can be aliased (see [example](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/function_alias.pdl)). + +PDL functions can also be called from Jinja expressions as in the following example ([file](https://github.com/IBM/prompt-declaration-language/blob/main/examples/tutorial/function_call_in_jinja.pdl)): + +```yaml +--8<-- "./examples/tutorial/function_call_in_jinja.pdl" +``` + +Notice that arguments can be positional or named. + + +## Building Data Structures In PDL, the user specifies step by step the shape of data they wish to generate. A `text` block takes a list of blocks, stringifies the result of each block, and concatenates them. @@ -975,10 +1048,24 @@ What is the color of the sky? ## Python SDK -See examples of PDL being called programmatically in Python -[here](https://github.com/IBM/prompt-declaration-language/blob/main/examples/sdk). +PDL programs can be defined and called programmatically directly in Python. +In the following example, the PDL program is defined as a string and then parsed and executed using the [`exec_str`](https://ibm.github.io/prompt-declaration-language/api_reference/#src.pdl.pdl.exec_str) function ([file](https://github.com/IBM/prompt-declaration-language/blob/main/examples/tutorial/sdk/hello_str.py)). + +```python +--8<-- "./examples/tutorial/sdk/hello_str.py" +``` + +The SDK also provides functions to execute programs defined in a file (see [example](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/sdk/hello_file.py)), as a Python dictionary (see [example](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/sdk/hello_dict.py)), or PDL abstract syntax tree defined by a [Pydantic](https://docs.pydantic.dev) data structure (see [example](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/sdk/hello_prog.py)). The documentation of the API is available [here](https://ibm.github.io/prompt-declaration-language/api_reference/). + + +A way to handle the processing of large datasets using PDL is to use Python multiprocessing capabilities to launch multiple instances of the PDL interpreter. The example below, w are using the Python's `concurrent.futures.ProcessPoolExecutor` to execute in parallel multiple instances of the PDL program `HELLO` where the free variable `name` is instantiated with a different value for each instance ([file](https://github.com/IBM/prompt-declaration-language/blob/main/examples/tutorial/sdk/hello_parallel.py)). + +```python +--8<-- "./examples/tutorial/sdk/hello_parallel.py" +``` -For a more sophisticated example, see [here](https://github.com/IBM/prompt-declaration-language/blob/main/examples/callback). +Finally, it possible to interleave the use of Python and PDL. +You can find an example [here](https://github.com/IBM/prompt-declaration-language/blob/main/examples/callback) of a Python application which is using a function defined in PDL which itself depend on the Python application. ## Debugging PDL Programs @@ -1034,9 +1121,9 @@ export OPENAI_ORGANIZATION=ollama # not required pdl <...> ``` -## Strings In Yaml +## Strings in Yaml -Multiline strings are commonly used when writing PDL programs. There are two types of formats that YAML supports for strings: block scalar and flow scalar formats. Scalars are what YAML calls basic values like numbers or strings, as opposed to complex types like arrays or objects. Block scalars have more control over how they are interpreted, whereas flow scalars have more limited escaping support. (Explanation here is thanks to [Wolfgang Faust](https://yaml-multiline.info/)) +Multiline strings are commonly used when writing PDL programs. There are two types of formats that YAML supports for strings: block scalar and flow scalar formats. Scalars are what YAML calls basic values like numbers or strings, as opposed to complex types like arrays or objects. Block scalars have more control over how they are interpreted, whereas flow scalars have more limited escaping support. (Explanation in this section are based on [yaml-multiline.info](https://yaml-multiline.info/) by Wolfgang Faust.) ### Block Scalars diff --git a/examples/aggregators/contribute_in_file.pdl b/examples/aggregators/contribute_in_file.pdl new file mode 100644 index 000000000..4cb7bbcb4 --- /dev/null +++ b/examples/aggregators/contribute_in_file.pdl @@ -0,0 +1,20 @@ +defs: + log: + aggregator: + file: /tmp/log.txt +text: +- Hello +- model: ollama_chat/granite3.3:2b + parameters: + temperature: 0 + contribute: [ result, context, log ] +- nice to meet you. +- model: ollama_chat/granite3.3:2b + parameters: + temperature: 0 + modelResponse: raw_response + contribute: + - result + - log: + value: ${raw_response} +- Bye diff --git a/examples/aggregators/contribute_in_stderr.pdl b/examples/aggregators/contribute_in_stderr.pdl new file mode 100644 index 000000000..83faf41de --- /dev/null +++ b/examples/aggregators/contribute_in_stderr.pdl @@ -0,0 +1,10 @@ +text: +- Hello +- text: Before model call + contribute: [ stderr ] +- model: ollama_chat/granite3.3:2b + parameters: + temperature: 0 +- contribute: + - stderr: + value: After model call diff --git a/examples/aggregators/contribute_in_stdout.pdl b/examples/aggregators/contribute_in_stdout.pdl new file mode 100644 index 000000000..fed5cfc47 --- /dev/null +++ b/examples/aggregators/contribute_in_stdout.pdl @@ -0,0 +1,10 @@ +text: +- Hello +- text: Before model call + contribute: [ stdout ] +- model: ollama_chat/granite3.3:2b + parameters: + temperature: 0 +- contribute: + - stdout: + value: After model call diff --git a/examples/demo/9-react.pdl b/examples/demo/9-react.pdl index 13621edcd..4225ed076 100644 --- a/examples/demo/9-react.pdl +++ b/examples/demo/9-react.pdl @@ -1,31 +1,33 @@ description: Demonstrating a React program defs: + Calc: + description: Calculator function + function: + expr: + type: string + description: Arithmetic expression to calculate + return: + lang: python + code: result = ${ expr } + Search: + description: Wikipedia search + function: + topic: + type: string + description: Topic to search + return: + lang: python + code: | + import warnings, wikipedia + warnings.simplefilter("ignore") + try: + result = wikipedia.summary("${ topic }") + except wikipedia.WikipediaException as e: + result = str(e) tools: data: - - type: function - function: - name: Calc - description: Calculator function - parameters: - type: object - properties: - expr: - type: string - description: Arithmetic expression to calculate - required: - - expr - - type: function - function: - name: Search - description: Wikipedia search - parameters: - type: object - properties: - topic: - type: string - description: Topic to search - required: - - topic + - ${ Calc.signature } + - ${ Search.signature } text: - role: system text: You are Granite, developed by IBM. You are a helpful AI assistant with access to the following tools. When a tool is required to answer the user's query, respond with <|tool_call|> followed by a JSON list of tools used. If a tool does not exist in the provided list of tools, notify the user that you do not have the ability to fulfill the request. @@ -77,19 +79,17 @@ text: - "\nObservation: " - match: ${ action[0].name } with: - - case: 'Search' + - case: Search then: - lang: python - code: | - import warnings, wikipedia - warnings.simplefilter("ignore") - try: - result = wikipedia.summary("${ action[0].arguments.topic }") - except wikipedia.WikipediaException as e: - result = str(e) - - case: 'Calc' + call: ${ Search } + args: + topic: ${ action[0].arguments.topic } + - case: Calc then: - lang: python - code: result = ${ action[0].arguments.expr } + call: ${ Calc } + args: + expr: ${ action[0].arguments.expr } + - case: Finish + then: ${ action[0].arguments.topic } - "\n" - until: ${ action[0].name == "Finish" } \ No newline at end of file + until: ${ action[0].name == "Finish" } diff --git a/examples/demos/react.pdl b/examples/demos/react.pdl index 43b2e2552..4225ed076 100644 --- a/examples/demos/react.pdl +++ b/examples/demos/react.pdl @@ -1,30 +1,33 @@ +description: Demonstrating a React program defs: + Calc: + description: Calculator function + function: + expr: + type: string + description: Arithmetic expression to calculate + return: + lang: python + code: result = ${ expr } + Search: + description: Wikipedia search + function: + topic: + type: string + description: Topic to search + return: + lang: python + code: | + import warnings, wikipedia + warnings.simplefilter("ignore") + try: + result = wikipedia.summary("${ topic }") + except wikipedia.WikipediaException as e: + result = str(e) tools: data: - - type: function - function: - name: Calc - description: Calculator function - parameters: - type: object - properties: - expr: - type: string - description: Arithmetic expression to calculate - required: - - expr - - type: function - function: - name: Search - description: Wikipedia search - parameters: - type: object - properties: - topic: - type: string - description: Topic to search - required: - - topic + - ${ Calc.signature } + - ${ Search.signature } text: - role: system text: You are Granite, developed by IBM. You are a helpful AI assistant with access to the following tools. When a tool is required to answer the user's query, respond with <|tool_call|> followed by a JSON list of tools used. If a tool does not exist in the provided list of tools, notify the user that you do not have the ability to fulfill the request. @@ -76,19 +79,17 @@ text: - "\nObservation: " - match: ${ action[0].name } with: - - case: 'Search' + - case: Search then: - lang: python - code: | - import warnings, wikipedia - warnings.simplefilter("ignore") - try: - result = wikipedia.summary("${ action[0].arguments.topic }") - except wikipedia.WikipediaException as e: - result = str(e) - - case: 'Calc' + call: ${ Search } + args: + topic: ${ action[0].arguments.topic } + - case: Calc then: - lang: python - code: result = ${ action[0].arguments.expr } + call: ${ Calc } + args: + expr: ${ action[0].arguments.expr } + - case: Finish + then: ${ action[0].arguments.topic } - "\n" - until: ${ action[0].name == "Finish" } \ No newline at end of file + until: ${ action[0].name == "Finish" } diff --git a/examples/gsm8k/gsm8.pdl b/examples/gsm8k/gsm8k-loop-fission.pdl similarity index 95% rename from examples/gsm8k/gsm8.pdl rename to examples/gsm8k/gsm8k-loop-fission.pdl index 5f43320f3..ce70d580f 100644 --- a/examples/gsm8k/gsm8.pdl +++ b/examples/gsm8k/gsm8k-loop-fission.pdl @@ -18,6 +18,10 @@ defs: # How many problems to evaluate. The entire dataset is 1319 problems. # MAX_ITERATIONS: 1319 MAX_ITERATIONS: 50 + # Which model to use + # MODEL: ollama/granite-code:8b + # MODEL: ollama/granite3.2:8b + MODEL: watsonx/ibm/granite-3-2-8b-instruct # PDL variables that hold statistics SUCCESSES: 0 @@ -29,8 +33,7 @@ text: TEST: ${ TESTS } repeat: # Ask the LLM for the answer - # - model: ollama/granite-code:8b - model: ollama/granite3.2:8b + model: ${ MODEL } # First, get LLM to answer the question input: | Question: ${ TEST.question } @@ -51,8 +54,7 @@ text: LLM_FULL_ANSWER: ${ ALL_LLM_FULL_A } repeat: # Next, get LLM to convert its answer into a single JSON key/value - # - model: ollama/granite-code:8b - model: ollama/granite3.2:8b + model: ${ MODEL } input: | # 'input' is the prompt Generate the final answer from the conclusion of this text as JSON with a single key named answer. ${ LLM_FULL_ANSWER } diff --git a/examples/gsm8k/gsm8k.pdl b/examples/gsm8k/gsm8k.pdl new file mode 100644 index 000000000..be8c1ef5b --- /dev/null +++ b/examples/gsm8k/gsm8k.pdl @@ -0,0 +1,105 @@ +#!/usr/bin/env pdl + +# Grade School Math https://github.com/openai/grade-school-math is an +# open source AI dataset from 2021. +# +# https://github.com/openai/grade-school-math/blob/master/grade_school_math/data/test.jsonl +# is a file with 1319 questions and answers. +# +# + +description: Grade School Math +defs: + # The Grade School Math Dataset + ALL_TESTS: + read: ./test.jsonl + parser: jsonl + + # How many problems to evaluate. The entire dataset is 1319 problems. + # MAX_ITERATIONS: 1319 + MAX_ITERATIONS: 10 + # Which model to use + # MODEL: ollama/granite-code:8b + # MODEL: ollama/granite3.2:8b + MODEL: watsonx/ibm/granite-3-2-8b-instruct + + # PDL variables that hold statistics + SUCCESSES: 0 + FAILURES: 0 + TESTS: ${ ALL_TESTS[:MAX_ITERATIONS] } + SOLUTIONS: + defs: + stats: + function: + r1: { success: integer, text: string} + r2: { success: integer, text: string} + return: + data: + success: ${ r1.success + r2.success } + text: ${ r1.text + "\n\n" + r2.text } + for: + TEST: ${ TESTS } + # maxWorkers: 10 + map: + defs: + # First phase: ask LLM the Grade School Math questions + LLM_FULL_ANSWER: + model: ${ MODEL } + # First, get LLM to answer the question + input: | + Question: ${ TEST.question } + Answer: + # Next, get LLM to convert its answer into a single JSON key/value + SIMPLIFIED_LLM_ANSWER: + model: ${ MODEL } + input: | + Generate the final answer from the conclusion of this text as JSON with a single key named answer. + ${ LLM_FULL_ANSWER } + # Third phase: Compare with Grade School Math ground truth + lastOf: + # Convert the JSON string to JSON. (We do this in a separate step so + # we have access to the original for debugging.) + - data: ${ SIMPLIFIED_LLM_ANSWER } + parser: json + def: JSON_SIMPLIFIED_LLM_ANSWER + + # Strip off any prefix or suffix off the number (dollar signs, units, etc) + # and place it in of the JSON format { "answer": ... } + - data: ${ JSON_SIMPLIFIED_LLM_ANSWER.answer|string if 'answer' in JSON_SIMPLIFIED_LLM_ANSWER else ("MISSING 'answer' in " + LLM_FULL_ANSWER) } + parser: + regex: "[^0-9]*(?P[0-9]+).*$" + spec: + answer: string + def: EXTRACTED_SIMPLIFIED_LLM_ANSWER + # (In case the simplified answer did not contain digits.) + - if: ${ EXTRACTED_SIMPLIFIED_LLM_ANSWER == None } + then: + def: EXTRACTED_SIMPLIFIED_LLM_ANSWER + data: + answer: "none" + + # Extract the expected answer, which in this test data always follows "#### " + # into { "answer": ... } + - data: ${ TEST.answer } + parser: + regex: "(.|\n)*#### (?P([0-9])*)\n*" + spec: + answer: string + def: EXTRACTED_GROUND_TRUTH + + # Did we get the expected answer? + - if: ${ EXTRACTED_SIMPLIFIED_LLM_ANSWER.answer == EXTRACTED_GROUND_TRUTH.answer} + then: + object: + success: 1 + text: | + LLM got right answer for '${ LLM_FULL_ANSWER }' which was simplified to '${ SIMPLIFIED_LLM_ANSWER }' which was extracted to '${ EXTRACTED_SIMPLIFIED_LLM_ANSWER.answer }' + else: + object: + success: 0 + text: | + WRONG! Wanted ${ EXTRACTED_GROUND_TRUTH.answer} } / LLM said '${ LLM_FULL_ANSWER }' which was simplified to '${ SIMPLIFIED_LLM_ANSWER }' which was extracted to '${ EXTRACTED_SIMPLIFIED_LLM_ANSWER.answer }' + join: + reduce: ${ stats } +text: + Finished, ${ SOLUTIONS.success } successes on ${ MAX_ITERATIONS } tests diff --git a/examples/map-reduce/context_fork.pdl b/examples/map-reduce/context_fork.pdl new file mode 100644 index 000000000..e059a47ef --- /dev/null +++ b/examples/map-reduce/context_fork.pdl @@ -0,0 +1,10 @@ +lastOf: +- "Hello, " +- for: + name: [Alice, Bob, Charlie] + map: + lastOf: + - my name is ${ name } + - model: ollama/granite3.2:2b + join: + as: array \ No newline at end of file diff --git a/examples/map-reduce/python-reduce.pdl b/examples/map-reduce/python-reduce.pdl new file mode 100644 index 000000000..3efbdc531 --- /dev/null +++ b/examples/map-reduce/python-reduce.pdl @@ -0,0 +1,13 @@ +defs: + plus: + lang: python + code: | + import operator + result = operator.add +for: + i: [1,2,3,4] +map: + ${i} +join: + as: reduce + reduce: ${ plus } diff --git a/examples/map-reduce/reduce.pdl b/examples/map-reduce/reduce.pdl new file mode 100644 index 000000000..2bbaaab6d --- /dev/null +++ b/examples/map-reduce/reduce.pdl @@ -0,0 +1,13 @@ +defs: + plus: + function: + x: number + y: number + return: + ${ x + y } +for: + i: [1,2,3,4] +map: + ${i} +join: + reduce: ${ plus } diff --git a/examples/optimizer/eval_levenshtein.pdl b/examples/optimizer/eval_levenshtein.pdl new file mode 100644 index 000000000..c7c0ef534 --- /dev/null +++ b/examples/optimizer/eval_levenshtein.pdl @@ -0,0 +1,11 @@ +defs: + score: + function: + document: string + ground_truth: string + return: + lang: python + fallback: 0 + code: | + import textdistance + result = textdistance.levenshtein.normalized_similarity(document, ground_truth) \ No newline at end of file diff --git a/examples/optimizer/fever_evaluator.py b/examples/optimizer/fever_evaluator.py index 7bd056dcc..d9465199f 100644 --- a/examples/optimizer/fever_evaluator.py +++ b/examples/optimizer/fever_evaluator.py @@ -82,5 +82,12 @@ def extract_answer(self, document: str) -> bool | None: return None - def answer_correct(self, document: str, answer: Any, truth: Any) -> bool: - return answer == truth or document.lower().endswith(str(truth).lower()) + def score(self, document: str, ground_truth: Any) -> float: + answer = self.extract_answer(document) + if answer is None: + return 0.0 + + return float( + answer == ground_truth + or document.lower().endswith(str(ground_truth).lower()) + ) diff --git a/examples/optimizer/grammar_correction.pdl b/examples/optimizer/grammar_correction.pdl new file mode 100644 index 000000000..9b370cc41 --- /dev/null +++ b/examples/optimizer/grammar_correction.pdl @@ -0,0 +1,28 @@ +defs: + max_tokens: 1024 +lastOf: + - "Here are examples of grammatically incorrect sentences and their corrected versions:\n\n" + - for: + example: ${ demonstrations } + repeat: + text: "${ example.input } -> ${ example.output }" + join: + with: "\n\n" + - |+ + Correct the following sentence: + + ${ input } + Here's the corrected sentence: + + - model: ${ model } + def: response + parameters: + max_tokens: ${ max_tokens } + temperature: 0 + + - if: ${ verify } + then: + lastOf: + - Do you think this was a correct answer? If not, generate a correct answer. Please only generate the corrected sentence with no other explanations. + - model: ${ model } + else: ${ response } diff --git a/examples/optimizer/grammar_correction.yaml b/examples/optimizer/grammar_correction.yaml new file mode 100644 index 000000000..c22b2f112 --- /dev/null +++ b/examples/optimizer/grammar_correction.yaml @@ -0,0 +1,41 @@ +pdl_path: grammar_correction.pdl # Path to the PDL file to optimize +dataset: + train: grammar_correction_jsonl/train.jsonl # Path to the training split in JSONL format + test: grammar_correction_jsonl/test.jsonl # Path to the test split in JSONL format + validation: grammar_correction_jsonl/validation.jsonl # Path to the validation split in JSONL format + +demonstrations_variable_name: demonstrations # variable name to insert demonstrations into +demonstration_columns: + - input # column name for the question in the dataset + - output # column name for the answer in the dataset + +instance_columns: + - input # column name for the question in the dataset + +groundtruth_column: output # column name for the ground truth in the dataset + +eval_pdl: eval_levenshtein.pdl # Path to the PDL file for evaluation + +#budget: 2h # Set a budget, can be number of iterations, or a duration string e.g. "2h" +#budget_growth: double # double validation set size each iteration. ## +# or to_max: reach max_test_set_size by final iteration +initial_validation_set_size: 2 # size of test set in first iteration +max_validation_set_size: 10 # maximum test set size. +max_test_set_size: 10 +num_candidates: 10 # how many candidates to evaluate +parallelism: 5 # how many threads to run evaluations across +#shuffle_test: false # shuffling of test set +#test_set_name: test # name of test set +#train_set_name: train # name of train set +#validation_set_name: validation # name of validation set +variables: # define discrete options to sample from + model: # set ${ model } variable + - ollama_chat/granite3.3:8b + - ollama_chat/gpt-oss:20b + num_demonstrations: # overrides num demonstrations above + - 0 + - 3 + - 5 + verify: + - true + - false \ No newline at end of file diff --git a/examples/optimizer/gsm8k_evaluator.py b/examples/optimizer/gsm8k_evaluator.py index d6c7c1858..8288895b9 100644 --- a/examples/optimizer/gsm8k_evaluator.py +++ b/examples/optimizer/gsm8k_evaluator.py @@ -64,8 +64,6 @@ def get_scope(self) -> ScopeType: scope["reasoning"] = self.example["reasoning"] return empty_scope | scope - def extract_answer(self, document: str) -> Any: - return extract_math_answer(document) - - def answer_correct(self, document: str, answer: Any, truth: Any) -> bool: - return answer == truth or document.endswith(f" {truth}") + def score(self, document: str, ground_truth: Any) -> float: + answer = extract_math_answer(document) + return float(answer == ground_truth or document.endswith(f" {ground_truth}")) diff --git a/examples/optimizer/gsm8k_optimizer_config.yml b/examples/optimizer/gsm8k_optimizer_config.yml new file mode 100644 index 000000000..822b43217 --- /dev/null +++ b/examples/optimizer/gsm8k_optimizer_config.yml @@ -0,0 +1,41 @@ +pdl_path: gsm8k.pdl # Path to the PDL file to optimize +dataset: gsm8k # Name our benchmark +budget: null # Set a budget, can be number of iterations, or a duration string e.g. "2h" +budget_growth: double # double validation set size each iteration +# or to_max: reach max_test_set_size by final iteration +initial_test_set_size: 2 # size of test set in first iteration +max_test_set_size: 10 # maximum test set size +num_candidates: 100 # how many candidates to evaluate +num_demonstrations: 5 # how many demonstrations to include per candidate +parallelism: 1 # how many threads to run evaluations across +shuffle_test: false # shuffling of test set +test_set_name: test # name of test set +train_set_name: train # name of train set +validation_set_name: validation # name of validation set +demonstrations_variable_name: demonstrations # variable name to insert demonstrations into +demonstration_columns: + - question # column name for the question in the dataset + - reasoning + - answer + - traj_keys + - traj_values + - rewoo_traj_keys + - rewoo_traj_values + +instance_columns: + - question + - reasoning + +groundtruth_column: answer # column name for the ground truth in the dataset + +variables: # define discrete options to sample from + model: # set ${ model } variable + - watsonx/meta-llama/llama-3-2-3b-instruct + prompt_pattern: # set ${ prompt_pattern } variable to one of these + - cot + - react + - rewoo + num_demonstrations: # overrides num demonstrations above + - 0 + - 3 + - 5 diff --git a/examples/optimizer/gsmhard_evaluator.py b/examples/optimizer/gsmhard_evaluator.py index a9bf5a641..18636db00 100644 --- a/examples/optimizer/gsmhard_evaluator.py +++ b/examples/optimizer/gsmhard_evaluator.py @@ -6,12 +6,12 @@ from pdl.pdl_interpreter import empty_scope -def is_float(s: str) -> str: +def is_float(s: str | float) -> str: try: f = float(s) return f"{f:.2f}" except Exception: - return s + return str(s) class GsmHardEvaluator(OptimizerEvaluator): @@ -74,10 +74,16 @@ def get_scope(self) -> ScopeType: scope["question"] = self.example["input"] return empty_scope | scope - def extract_answer(self, document: str) -> float | int | None: - return extract_math_answer(document) + def score(self, document: str, ground_truth: Any) -> float: + answer = extract_math_answer(document) + if answer is None: + return 0.0 - def answer_correct(self, document: str, answer: Any, truth: Any) -> bool: answerf = is_float(answer) - truthf = is_float(truth) - return answer == truth or answerf == truthf or document.endswith(f" {truth}") + truthf = is_float(ground_truth) + + return float( + answer == ground_truth + or answerf == truthf + or document.endswith(f" {ground_truth}") + ) diff --git a/examples/optimizer/mbpp_dataset.py b/examples/optimizer/mbpp_dataset.py index 3265a8b29..61fef67a6 100644 --- a/examples/optimizer/mbpp_dataset.py +++ b/examples/optimizer/mbpp_dataset.py @@ -3,7 +3,7 @@ from copy import deepcopy -from datasets import load_from_disk +from datasets.load import load_from_disk from evalplus.data import get_mbpp_plus, get_mbpp_plus_hash from evalplus.evaluate import MBPP_OUTPUT_NOT_NONE_TASKS, get_groundtruth diff --git a/examples/optimizer/mbpp_evaluator.py b/examples/optimizer/mbpp_evaluator.py index 4402acefd..e14151c54 100644 --- a/examples/optimizer/mbpp_evaluator.py +++ b/examples/optimizer/mbpp_evaluator.py @@ -65,9 +65,10 @@ def extract_answer(self, document: str) -> str: solution = solution.split("```")[1] return solution.strip() - def answer_correct(self, document: str, answer: Any, truth: Any) -> bool: - if answer is None or not isinstance(answer, str): - return False + def score(self, document: str, ground_truth: Any) -> float: + answer = self.extract_answer(document) + if not answer: + return 0.0 retry_parse = False try: @@ -78,16 +79,16 @@ def answer_correct(self, document: str, answer: Any, truth: Any) -> bool: if retry_parse: pattern = r"```(?:python)?\n(.*?)\n```" - match = re.search(pattern, answer, re.DOTALL) + match = re.search(pattern, document, re.DOTALL) if match: answer = match.group(1) try: ast.parse(answer) except Exception as e: print(e) - return False + return 0.0 else: - return False + return 0.0 task_id = self.example["task_id"] @@ -109,4 +110,4 @@ def answer_correct(self, document: str, answer: Any, truth: Any) -> bool: base_stat, _ = result["base"] plus_stat, _ = result["plus"] - return base_stat == "pass" and plus_stat == "pass" + return float(base_stat == "pass" and plus_stat == "pass") diff --git a/examples/optimizer/optimize.py b/examples/optimizer/optimize.py index c88b799cb..a2b5190d8 100644 --- a/examples/optimizer/optimize.py +++ b/examples/optimizer/optimize.py @@ -5,14 +5,16 @@ from typing import Any import yaml -from datasets import load_from_disk +from datasets import load_dataset, load_from_disk from fever_evaluator import FEVEREvaluator from gsm8k_evaluator import Gsm8kEvaluator from gsmhard_evaluator import GsmHardEvaluator from mbpp_dataset import MBPPDataset from mbpp_evaluator import MBPPEvaluator -from pdl.optimize.config_parser import OptimizationConfig +from pdl.optimize.config_parser import JsonlDataset, OptimizationConfig +from pdl.optimize.optimizer_evaluator import OptimizerEvaluator +from pdl.optimize.pdl_evaluator import PdlEvaluator from pdl.optimize.pdl_optimizer import PDLOptimizer if __name__ == "__main__": @@ -38,7 +40,7 @@ "--dataset-path", help="Path to the dataset directory", type=Path, - required=True, + required=False, ) common_parser.add_argument( "--experiments-path", @@ -56,11 +58,6 @@ action=argparse.BooleanOptionalAction, default=False, ) - common_parser.add_argument( - "pdl_file", - type=Path, - help="Path to a PDL file to optimize", - ) # Optimize command optimize_parser = subparsers.add_parser( @@ -82,9 +79,6 @@ ) args = parser.parse_args() - if not args.pdl_file.exists(): - print("PDL file doesn't exist:", args.pdl_file) - sys.exit(1) if not args.config.exists(): print("Config file doesn't exist:", args.config) @@ -100,35 +94,52 @@ traceback.print_last() sys.exit(1) + if not Path(config.pdl_path).exists(): + print("PDL file doesn't exist:", config.pdl_path) + sys.exit(1) + if args.dry: sys.exit(0) # Set up dataset and trial thread based on benchmark dataset: Any TrialThread: type[ - Gsm8kEvaluator | GsmHardEvaluator | FEVEREvaluator | MBPPEvaluator + Gsm8kEvaluator + | GsmHardEvaluator + | FEVEREvaluator + | MBPPEvaluator + | OptimizerEvaluator ] - if config.benchmark == "gsm8k": + if config.dataset == "gsm8k": dataset = load_from_disk(args.dataset_path) TrialThread = Gsm8kEvaluator - elif config.benchmark == "gsmhard": + elif config.dataset == "gsmhard": dataset = load_from_disk(args.dataset_path) TrialThread = GsmHardEvaluator - elif config.benchmark == "fever": + elif config.dataset == "fever": fever = load_from_disk(args.dataset_path) dataset = fever TrialThread = FEVEREvaluator - elif config.benchmark == "mbpp": + elif config.dataset == "mbpp": dataset = MBPPDataset(args.dataset_path) TrialThread = MBPPEvaluator + elif isinstance(config.dataset, (dict, JsonlDataset)): + dataset = load_dataset( + "json", + data_files={ + "train": config.dataset.train, + "validation": config.dataset.validation, + "test": config.dataset.test, + }, + ) + TrialThread = PdlEvaluator else: - print(f"Unknown benchmark: {config.benchmark}") + print(f"Unknown dataset: {config.dataset}") sys.exit(1) # Create optimizer instance optimizer = PDLOptimizer( - pdl_path=args.pdl_file, dataset=dataset, trial_thread=TrialThread, yield_output=args.yield_output, diff --git a/examples/optimizer/optimized_grammar_correction.pdl b/examples/optimizer/optimized_grammar_correction.pdl new file mode 100644 index 000000000..0034f6445 --- /dev/null +++ b/examples/optimizer/optimized_grammar_correction.pdl @@ -0,0 +1,44 @@ +defs: + max_tokens: 1024 + model: ollama_chat/gpt-oss:20b + num_demonstrations: + data: 3 + verify: + data: true + demonstrations: + data: + - input: Discibed in the media as "a witch-hunt", depsite the fact Sony setteled out of court with Hotz, the company's dogmy mentality in general brought many wrong widespread ill-feeling in the general public against it. + output: Described in the media as "a witch-hunt", despite the fact that Sony settled out of court with Hotz, the company's dogmatic mentality in general brought widespread ill-feeling from the general public against it. + - input: According to the UN office for humanitarain coordination (OCHA), most of the 3 million are currently hosted by countries in Latina America and Caribbean, accounting for about 2.4 million refugees and immigrants from Venezuela. + output: According to the UN office for humanitarian coordination (OCHA), most of the 3 million are currently hosted by countries in Latin America and the Caribbean, accounting for about 2.4 million refugees and migrants from Venezuela. + - input: To glad that you liked the looking, Kim! + output: Glad that you liked the look, Kim! +lastOf: +- |+ + Here are examples of grammatically incorrect sentences and their corrected versions: + +- for: + example: ${ demonstrations } + repeat: + text: ${ example.input } -> ${ example.output } + join: + with: |2+ + + +- |+ + Correct the following sentence: + + ${ input } + Here's the corrected sentence: + +- def: response + model: ${ model } + parameters: + temperature: 0.0 + max_tokens: ${ max_tokens } +- if: ${ verify } + then: + lastOf: + - Do you think this was a correct answer? If not, generate a correct answer. Please only generate the corrected sentence with no other explanations. + - model: ${ model } + else: ${ response } diff --git a/examples/optimizer/process_fever.py b/examples/optimizer/process_fever.py new file mode 100644 index 000000000..f3419cb7f --- /dev/null +++ b/examples/optimizer/process_fever.py @@ -0,0 +1,462 @@ +# Instructions for running this script: +# 1. Ensure you have the required libraries installed. +# `datasets` should be version 3.0 or higher. +# +# `pip install prompt-declaration-language[all] funcy` +# 2. Download the original FEVER dataset with wiki-pages, and BigBench FEVER task JSON file +# from the respective sources. +# https://fever.ai/dataset/fever.html +# https://github.com/google/BIG-bench/blob/main/bigbench/benchmark_tasks/fact_checker/fever/task.json +# +# ``` +# wget https://raw.githubusercontent.com/google/BIG-bench/refs/heads/main/bigbench/benchmark_tasks/fact_checker/fever/task.json +# wget https://fever.ai/download/fever/wiki-pages.zip +# wget https://fever.ai/download/fever/shared_task_dev.jsonl +# ``` +# Place the downloaded files in the `var/fever` directory. +# Extract the `wiki-pages.zip` file into `var/fever/wiki-pages/`. +# 3. Run this script to process the FEVER dataset. +# `python examples/optimizer/process_fever.py` +# +import json +import operator +import re +import unicodedata +import warnings +from functools import cache +from itertools import groupby +from pathlib import Path +from typing import Any + +import pandas as pd +import wikipedia +from datasets.arrow_dataset import Dataset +from datasets.dataset_dict import DatasetDict +from datasets.load import load_dataset, load_from_disk +from funcy import flatten +from tqdm.autonotebook import tqdm + +tqdm.pandas() +warnings.simplefilter("ignore") + +var_dir = Path("var") +var_dir.mkdir(parents=True, exist_ok=True) + + +def clean_fever(text: str) -> str: + mapping = { + "_": " ", + "-LRB- ": "(", + " -RRB-": ")", + "-LSB- ": "[", + " -RSB-": "]", + "-LRB-": "(", + "-RRB-": ")", + "-LSB-": "[", + "-RSB-": "]", + "-COLON-": ":", + } + + for k, v in mapping.items(): + text = text.replace(k, v) + + return text.strip() + + +@cache +def search_new( + subject: str, auto_suggest: bool = False, redirect: bool = False +) -> tuple[str, str]: + try: + result = ( + wikipedia.summary( + subject, auto_suggest=auto_suggest, redirect=redirect + ).strip(), + "success", + ) + except wikipedia.DisambiguationError as d: + result = ( + f'"{subject}" may refer to one of {d.args[1]}. Please retry the search with one of the subjects using Search[].', + "disambg", + ) + except wikipedia.PageError as e: + result = f"{e} Please retry the search using Search[].", "pageerror" + except wikipedia.WikipediaException as e: + print(e, type(e)) + result = str(e), f"other:{type(e)}" + except Exception as e: + print(e, type(e)) + result = str(e), f"other:{type(e)}" + return result + + +def searcher(row: dict[str, Any], auto_suggest: bool): + cleaned = clean_fever(row["article"]) + if "msg" in row: + if row["msg"] != "success": + wiki, msg = search_new(cleaned, auto_suggest=auto_suggest, redirect=True) + else: + wiki = row["wiki"] + msg = row["msg"] + else: + wiki, msg = search_new(cleaned, auto_suggest=auto_suggest, redirect=True) + return {"wiki": wiki, "msg": msg, "cleaned": cleaned} + + +def remove_accents(x: str) -> str: + return unicodedata.normalize("NFD", x) + + +fever = load_dataset("fever/fever", "v1.0") +if not isinstance(fever, DatasetDict): + raise TypeError(f"Expected fever to be a DatasetDict, but got: {type(fever)}") + +bigbench_fever = json.loads(Path("var/fever/task.json").read_text(encoding="utf-8")) + +fever.save_to_disk("var/fever/fever_original") +print(fever) + +wikipages = load_dataset( + "json", + data_files="var/fever/wiki-pages/wiki-pages/wiki-*.jsonl", + encoding="utf-8", +) +if not isinstance(wikipages, DatasetDict): + raise TypeError( + f"Expected wikipages to be a DatasetDict, but got: {type(wikipages)}" + ) + +print("Loaded wikipages:", wikipages) +print("Mapping wikipages...") +wikipages["train"] = wikipages["train"].map( + lambda x: { + "lines_split": [x for x in re.split(r"\d+\t", x["lines"]) if x], + }, + num_proc=32, +) +print("Mapping wikipages done.") + +print("Converting wikipages to DataFrame...") +wiki_pages_df = wikipages["train"].to_pandas() +if not isinstance(wiki_pages_df, pd.DataFrame): + raise TypeError( + f"Expected wiki_pages_df to be a DataFrame, but got: {type(wiki_pages_df)}" + ) +wiki_pages_df = wiki_pages_df.set_index("id") +wiki_pages_df.index = wiki_pages_df.index.map(remove_accents) +print("Wikipages converted to DataFrame.") + + +if isinstance(wiki_pages_df, pd.DataFrame): + wiki_pages_df.to_parquet( + path="var/fever/wiki_pages.parquet", + index=True, + engine="pyarrow", + compression="zstd", + compression_level=10, + ) +else: + raise TypeError( + f"Expected wiki_pages_df to be a DataFrame, but got: {type(wiki_pages_df)}" + ) + + +df = pd.read_json( + "var/fever/shared_task_dev.jsonl", lines=True, encoding="utf-8" +).set_index("id") +print("Loaded original FEVER", len(df)) +df = df[df.label.isin(["SUPPORTS", "REFUTES"])].copy() +print("Filtered original FEVER", len(df)) + + +def evidence_mapper(evidence: list[tuple]): + evidences = {(x[2], x[3]) for x in evidence[0] if x[2] is not None} + return list(evidences) + + +df["unique_evidence"] = df[ + "evidence" +].progress_apply( # pyright: ignore[reportAttributeAccessIssue] + evidence_mapper +) + + +def evidence_mapper_sentence(evidences: list[tuple[str, int]]): + if not isinstance(wiki_pages_df, pd.DataFrame): + raise TypeError( + f"Expected wiki_pages_df to be a DataFrame, but got: {type(wiki_pages_df)}" + ) + + lines = [] + for title, line in evidences: + if title is None or line is None: + continue + title_no_acc = remove_accents(title) + + if title_no_acc not in wiki_pages_df.index: + print(title_no_acc) + continue + + sentence = wiki_pages_df.loc[title_no_acc] + if sentence["lines_split"] is not None and len(sentence["lines_split"]) > line: + sentence = sentence["lines_split"][line] + lines.append((title_no_acc, line, sentence)) + else: + print(sentence) + return list(lines) + + +df["evidence_sentences"] = df[ + "unique_evidence" +].progress_apply( # pyright: ignore[reportAttributeAccessIssue] + evidence_mapper_sentence +) + +bigbench = pd.DataFrame.from_records(bigbench_fever["examples"]).set_index("id") + +tqdm.pandas(desc="Mapping claims to (in) bigbench") +df["claim_in_bigbench"] = df[ + "claim" +].progress_apply( # pyright: ignore[reportAttributeAccessIssue] + lambda x: bigbench.input.str.contains(x).any() +) +tqdm.pandas() + +df["evidence_sentence_count"] = df[ + "evidence_sentences" +].map( # pyright: ignore[reportAttributeAccessIssue] + len +) +print("Mapped bigbench") + +train_df = df[(~df.index.isin(bigbench.index)) & (df["evidence_sentence_count"] > 0)] + +test_df = df[ + (df.index.isin(bigbench.index)) & (df["evidence_sentence_count"] > 0) +].drop( # pyright: ignore[reportAttributeAccessIssue] + columns=["verifiable", "claim_in_bigbench", "evidence"] +) +test_df["unique_evidence"] = test_df[ + "unique_evidence" +].map( # pyright: ignore[reportAttributeAccessIssue] + lambda x: [[str(title), str(sent_id)] for title, sent_id in x] +) +test_df["evidence_sentences"] = test_df[ + "evidence_sentences" +].map( # pyright: ignore[reportAttributeAccessIssue] + lambda x: [[str(title), str(sent_id), str(sent)] for title, sent_id, sent in x] +) +test_df["label"] = test_df["label"] == "SUPPORTS" +test_df.index = test_df.index.astype(pd.StringDtype()) +test_df.claim = test_df.claim.astype(pd.StringDtype()) +test_df["id"] = test_df.index +print("Saving fever test df") +test_df.to_json("fever_test_df.json", orient="records", lines=True) +print("Saved fever test df") + +train_df = df[ + (~df.index.isin(bigbench.index)) & (df["evidence_sentence_count"] > 0) +].drop( # pyright: ignore[reportAttributeAccessIssue] + columns=["verifiable", "claim_in_bigbench", "evidence"] +) +train_df["unique_evidence"] = train_df[ + "unique_evidence" +].map( # pyright: ignore[reportAttributeAccessIssue] + lambda x: [[str(title), str(sent_id)] for title, sent_id in x] +) +train_df["evidence_sentences"] = train_df[ + "evidence_sentences" +].map( # pyright: ignore[reportAttributeAccessIssue] + lambda x: [[str(title), str(sent_id), str(sent)] for title, sent_id, sent in x] +) +train_df["label"] = train_df["label"] == "SUPPORTS" +train_df.index = train_df.index.astype(pd.StringDtype()) +train_df.claim = train_df.claim.astype(pd.StringDtype()) +train_df["id"] = train_df.index +print("Saving fever train df") +train_df.to_json("fever_train_df.json", orient="records", lines=True) +print("Saved fever train df") + +fever_ds = load_dataset( + "json", data_files={"train": "fever_train_df.json", "test": "fever_test_df.json"} +) +if not isinstance(fever_ds, DatasetDict): + raise TypeError(f"Expected fever_ds to be a DatasetDict, but got: {type(fever_ds)}") +fever_ds.save_to_disk("var/fever/fever_reprocessed") +print(fever_ds) + + +articles = list( + set(flatten([[y[0] for y in x] for x in fever_ds["train"]["unique_evidence"]])) +) +article_ds = Dataset.from_dict({"article": articles}) +print(article_ds) + + +article_ds = article_ds.map(lambda x: searcher(x, True), num_proc=4) +article_ds = article_ds.map(lambda x: searcher(x, False), num_proc=1) +article_df = article_ds.to_pandas() +if not isinstance(article_df, pd.DataFrame): + raise TypeError( + f"Expected article_df to be a DataFrame, but got: {type(article_df)}" + ) +article_df = article_df.set_index("article") +print("Articles that did not return a successful response:") +print(article_df[article_df.msg != "success"]) +article_ds.save_to_disk("var/fever/fever_articles") +article_df.to_parquet( + "var/fever/fever_articles.parquet", + index=True, + engine="pyarrow", + compression="zstd", + compression_level=10, +) + + +def search(query: str) -> tuple: + if not isinstance(article_df, pd.DataFrame): + raise TypeError( + f"Expected article_df to be a DataFrame, but got: {type(article_df)}" + ) + row = article_df.loc[query] + return row["wiki"], row["msg"] + + +def trajectorize(row: dict[str, Any]) -> dict[str, Any]: + evidence_sentences = row["evidence_sentences"] + + claim = row["claim"].strip() + task = f"On June 2017, the following claim was made: {claim}\nQ: Was this claim true or false?" + answer = str(row["label"]).lower() + + article_sentence_group = { + k: list(v) for k, v in groupby(evidence_sentences, operator.itemgetter(0)) + } + + sample_articles = {} + statuses = [] + wiki_worked = True + for article in article_sentence_group: + cleaned_article = clean_fever(article) + wiki, worked = search(article) + wiki = wiki.strip() + if worked != "success": + wiki_worked = False + + sample_articles[cleaned_article] = wiki + statuses.append(worked) + all_wiki_success = all(x in {"success", "fallback"} for x in statuses) + + trajectory = [{"task": task}] + + for article, evidences in article_sentence_group.items(): + cleaned_article = clean_fever(article) + trajectory.extend( + [ + {"thought": f"I need to search {cleaned_article}."}, + { + "action": '{"name": "Search", "arguments": {"topic": "' + + cleaned_article + + '"}}' + }, + { + "observation": f"[Document]\n{sample_articles[cleaned_article]}\n[End]" + }, + ] + ) + + for _title, _line, sent in evidences: + trajectory.append({"observation": clean_fever(sent.split("\t")[0])}) + + trajectory.extend( + [ + {"thought": f"The claim is {answer}."}, + {"action": '{"name": "Finish", "arguments": {"topic": "' + answer + '"}}'}, + ] + ) + + traj_keys = [next(iter(t.keys())) for t in trajectory] + traj_values = [next(iter(t.values())) for t in trajectory] + + rewoo_trajectory = [{"task": task}] + + for article, evidences in article_sentence_group.items(): + cleaned_article = clean_fever(article) + rewoo_trajectory.extend( + [ + {"thought": f"Search for more information about {cleaned_article}."}, + { + "action": '{"name": "Search", "arguments": {"topic": "' + + cleaned_article + + '"}}' + }, + { + "observation": f"[Document]\n{sample_articles[cleaned_article]}\n[End]" + }, + ] + ) + + for _title, _line, sent in evidences: + rewoo_trajectory.append({"observation": clean_fever(sent.split("\t")[0])}) + + rewoo_traj_keys = [next(iter(t.keys())) for t in rewoo_trajectory] + rewoo_traj_values = [next(iter(t.values())) for t in rewoo_trajectory] + + return { + "traj_keys": traj_keys, + "traj_values": traj_values, + "rewoo_traj_keys": rewoo_traj_keys, + "rewoo_traj_values": rewoo_traj_values, + "all_wiki_success": all_wiki_success, + "wiki_worked": wiki_worked, + "articles": list(sample_articles.values()), + "statuses": statuses, + } + + +def sentencify(row: dict[str, Any]) -> dict[str, str]: + evidence_sentences = row["evidence_sentences"] + + article_sentence_group = { + clean_fever(k): list(v) + for k, v in groupby(evidence_sentences, operator.itemgetter(0)) + } + + sentences = [] + for evidences in article_sentence_group.values(): + for _title, _line, sent in evidences: + sentences.append(clean_fever(sent.split("\t")[0])) + + return {"cot": " ".join(sentences).strip().replace("\n", " ").strip()} + + +fever_ds = fever_ds.map( + lambda x: {"label": str(x["label"]).lower()}, + num_proc=4, +) + +fever_ds["train"] = ( + fever_ds["train"].map(trajectorize, num_proc=4).map(sentencify, num_proc=4) +) + + +print( + "Wiki lookup failures:", + fever_ds["train"].filter(lambda x: x["all_wiki_success"] is False), +) + + +fever_ds["train"] = fever_ds["train"].filter(lambda x: x["wiki_worked"] is True) +fever_ds["train"] = fever_ds["train"].remove_columns( + column_names=["wiki_worked", "all_wiki_success", "statuses"] +) +print(fever_ds) + +new_split = fever_ds["train"].train_test_split(test_size=1024) +fever_ds["train"] = new_split["train"] +fever_ds["validation"] = new_split["test"] +fever_ds.save_to_disk("var/fever_trajectified") + +# Make sure the saved dataset is loaded correctly +ds = load_from_disk("var/fever_trajectified") +print(ds) diff --git a/examples/optimizer/process_grammar_correction.py b/examples/optimizer/process_grammar_correction.py new file mode 100644 index 000000000..ae14961cf --- /dev/null +++ b/examples/optimizer/process_grammar_correction.py @@ -0,0 +1,35 @@ +import json +from pathlib import Path + +from datasets.dataset_dict import DatasetDict +from datasets.load import load_dataset + +# Load dataset +grammar_correction = load_dataset("agentlans/grammar-correction") +if not isinstance(grammar_correction, DatasetDict): + raise TypeError( + f"Expected grammar_correction to be a DatasetDict, but got: {type(grammar_correction)}" + ) + +# Create validation split from train (1024 examples) +new_split = grammar_correction["train"].train_test_split(test_size=1024) +grammar_correction["test"] = new_split["test"] + +val_split = new_split["train"].train_test_split() +grammar_correction["train"] = val_split["train"] +grammar_correction["validation"] = val_split["test"] + +# Output dir +out_dir = Path("grammar_correction_jsonl") +out_dir.mkdir(parents=True, exist_ok=True) + + +# Save to JSONL +def save_jsonl(dataset, path: Path) -> None: + with path.open("w") as f: + for item in dataset: + f.write(json.dumps(item) + "\n") + + +for split in ["train", "validation", "test"]: + save_jsonl(grammar_correction[split], out_dir / f"{split}.jsonl") diff --git a/examples/optimizer/process_gsm8k.py b/examples/optimizer/process_gsm8k.py new file mode 100644 index 000000000..57911a0c7 --- /dev/null +++ b/examples/optimizer/process_gsm8k.py @@ -0,0 +1,166 @@ +import re +from pathlib import Path +from typing import Any + +from datasets.dataset_dict import DatasetDict +from datasets.load import load_dataset, load_from_disk + +from pdl.optimize.parse_number import parse_number + +# Load original GSM8K dataset and split it into train and validation sets + +var_dir = Path("var") +var_dir.mkdir(parents=True, exist_ok=True) + +gsm8k_orig = load_dataset("openai/gsm8k", "main") +if not isinstance(gsm8k_orig, DatasetDict): + raise TypeError( + f"Expected gsm8k_orig to be a DatasetDict, but got: {type(gsm8k_orig)}" + ) +new_split = gsm8k_orig["train"].train_test_split(test_size=1024) +gsm8k_orig["validation"] = new_split["test"] +gsm8k_orig["train"] = new_split["train"] +gsm8k_orig.save_to_disk("var/gsm8k_split") + +# Make sure the saved dataset is loaded correctly +gsm8k = load_from_disk("var/gsm8k_split") +if not isinstance(gsm8k, DatasetDict): + raise TypeError(f"Expected gsm8k to be a DatasetDict, but got: {type(gsm8k)}") + + +def parse_answers(row: dict[str, Any]) -> dict[str, Any]: + question = row["question"].strip().replace("’", "'").replace(" ", " ") + parts = row["answer"].split("####") + answer = parse_number(parts[-1]) + reasoning = "####".join(parts[:-1]).strip().replace("’", "'").replace(" ", " ") + return { + "question": question, + "answer": answer, + "reasoning": reasoning, + "raw_answer": row["answer"], + "answer_part": parts[-1], + } + + +gsm8k = gsm8k.map(parse_answers) + + +def react_trajectory(row: dict[str, Any]) -> dict[str, list[str]]: + question = row["question"] + answer = row["answer"] + reasoning = row["reasoning"].splitlines() + trajectory = [{"question": question.strip()}] + res = answer + + for line in reasoning: + pattern = ( + r"(?P
(=(\ )?|equals(\ )?)?(\$)?)<<(?P.*?)=(?P.*?)>>([^\s]*)"
+        )
+        expressions = re.search(pattern, line)
+
+        if expressions is None:
+            trajectory += [
+                {"thought": line.strip().replace("  ", " ")},
+            ]
+        else:
+            thought = re.sub(pattern, "", line)
+            thought = thought.rstrip(".").rstrip(",")
+            exp = expressions.group("exp").strip()
+            res = expressions.group("res").strip()
+
+            trajectory += [
+                {
+                    "thought": f"{thought.strip().replace('  ', ' ')}. I need to calculate {exp}"
+                },
+                {
+                    "action": '{"name": "Calculator", "arguments": {"expr": "'
+                    f"{exp}"
+                    '"}}'
+                },
+                {"observation": res},
+            ]
+    if next(iter(trajectory[-1].keys())) == "observation":
+        trajectory.append({"thought": f"The answer is {answer}"})
+
+    trajectory.append(
+        {"action": '{"name": "Finish", "arguments": {"answer": "' + f"{answer}" + '"}}'}
+    )
+
+    traj_keys = [next(iter(t.keys())) for t in trajectory]
+    traj_values = [next(iter(t.values())) for t in trajectory]
+
+    return {
+        "traj_keys": traj_keys,
+        "traj_values": traj_values,
+    }
+
+
+gsm8k["train"] = gsm8k["train"].map(react_trajectory)
+
+
+def rewoo_trajectory(row: dict[str, Any]) -> dict[str, list[str]]:
+    question = row["question"]
+    answer = row["answer"]
+    reasoning = row["reasoning"].splitlines()
+    trajectory = [{"question": question.strip().replace("  ", " ")}]
+    res = answer
+
+    for line in reasoning:
+        pattern = (
+            r"(?P
(=(\ )?|equals(\ )?)?(\$)?)<<(?P.*?)=(?P.*?)>>([^\s]*)"
+        )
+        expressions = re.search(pattern, line)
+
+        if expressions is None:
+            trajectory += [
+                {"thought": line.strip().replace("  ", " ")},
+            ]
+        else:
+            thought = re.sub(pattern, "", line)
+            thought = thought.rstrip(".").rstrip(",")
+            exp = expressions.group("exp").strip()
+            res = expressions.group("res").strip()
+
+            trajectory += [
+                {"thought": f"{thought.strip().replace('  ', ' ')}. Calculate {exp}"},
+                {
+                    "action": '{"name": "Calculator", "arguments": {"expr": "'
+                    f"{exp}"
+                    '"}}'
+                },
+                {"observation": res},
+            ]
+
+    evidence_counter = 0
+    for i, outer in enumerate(trajectory):
+        type_event = next(iter(outer.keys()))
+        value = next(iter(outer.values()))
+
+        if type_event == "action":
+            evidence_counter += 1
+        if type_event == "observation":
+            for j in range(i + 1, len(trajectory)):
+                inner = trajectory[j]
+                inner_type_event = next(iter(inner.keys()))
+                if inner_type_event == "action":
+                    trajectory[j]["action"] = trajectory[j]["action"].replace(
+                        value, f"#E{evidence_counter}"
+                    )
+                elif inner_type_event == "thought":
+                    trajectory[j]["thought"] = trajectory[j]["thought"].replace(
+                        value, f"#E{evidence_counter}"
+                    )
+    traj_keys = [next(iter(t.keys())) for t in trajectory]
+    traj_values = [next(iter(t.values())) for t in trajectory]
+
+    return {"rewoo_traj_keys": traj_keys, "rewoo_traj_values": traj_values}
+
+
+gsm8k["train"] = gsm8k["train"].map(rewoo_trajectory)
+
+# Save the processed dataset
+gsm8k.save_to_disk("var/gsm8k_trajectified")
+
+# Make sure the saved dataset is loaded correctly
+ds = load_from_disk("var/gsm8k_trajectified")
+print(ds)
diff --git a/examples/optimizer/process_mbpp.py b/examples/optimizer/process_mbpp.py
new file mode 100644
index 000000000..c995b9d44
--- /dev/null
+++ b/examples/optimizer/process_mbpp.py
@@ -0,0 +1,79 @@
+# Instructions:
+# 1. Install EvalPlus e.g. `pip install evalplus`
+# 2. Run this script to process the MBPP dataset into a format suitable for evaluation.
+import re
+from pathlib import Path
+from typing import Any
+
+from datasets.dataset_dict import DatasetDict
+from datasets.load import load_dataset, load_from_disk
+from evalplus.data import get_mbpp_plus
+
+var_dir = Path("var")
+var_dir.mkdir(parents=True, exist_ok=True)
+
+mbpp_plus = get_mbpp_plus()
+
+mbpp = load_dataset("google-research-datasets/mbpp", name="full")
+if not isinstance(mbpp, DatasetDict):
+    raise TypeError(f"Expected mbpp to be a DatasetDict, but got: {type(mbpp)}")
+
+mbpp["test"] = mbpp["test"].filter(
+    lambda x: f"Mbpp/{x['task_id']}" in mbpp_plus,
+)
+
+mbpp["validation"] = mbpp["validation"].filter(
+    lambda x: f"Mbpp/{x['task_id']}" in mbpp_plus,
+)
+
+
+def trajectify(row: dict[str, Any]) -> dict[str, list[str]]:
+    code = row["code"].replace("\r\n", "\n").replace("\r", "\n").strip()
+    first_test = row["test_list"][0].strip().lstrip()
+    pattern = r"assert\s+(\w+\(.*?\))\s*==\s*(.+)"
+
+    # Replacement format
+    replacement = r"res = \1\nassert res == \2, \"Expected \2 but got {}\".format(res)"
+
+    # Perform the substitution
+    converted_string = (
+        re.sub(pattern, replacement, first_test)
+        .replace('\\"Expected ', '"Expected ')
+        .replace('{}\\"', '{}"')
+    )
+    code_w_assert = code + "\n" + converted_string.strip()
+    prompt = row["text"].strip() + "\n" + first_test
+
+    trajectory = [
+        {"task": prompt},
+        {
+            "thought": "I should run a solution on the test case before proposing a solution."
+        },
+        {"action": code_w_assert},
+        {"observation": "[Executed Successfully with No Output]"},
+        {"thought": "There is no AssertionError. I can now submit the solution."},
+        {"solution": code},
+    ]
+
+    traj_keys = [next(iter(t.keys())) for t in trajectory]
+    traj_values = [next(iter(t.values())) for t in trajectory]
+
+    return {
+        "react_prompt": prompt,
+        "code": code,
+        "traj_keys": traj_keys,
+        "traj_values": traj_values,
+    }
+
+
+mbpp_trajectified = mbpp.map(trajectify)
+assert len(mbpp_trajectified["train"]) == 374
+assert len(mbpp_trajectified["test"]) == 224
+assert len(mbpp_trajectified["validation"]) == 39
+
+# Save the processed dataset
+mbpp_trajectified.save_to_disk("var/mbpp_trajectified")
+
+# Make sure the saved dataset is loaded correctly
+ds = load_from_disk("var/mbpp_trajectified")
+print(ds)
diff --git a/examples/requirements/email.pdl b/examples/requirements/email.pdl
new file mode 100644
index 000000000..0c6b26f3e
--- /dev/null
+++ b/examples/requirements/email.pdl
@@ -0,0 +1,44 @@
+description: Hello world calling a model
+defs:
+  eval: 
+    function:
+      requirement: string
+      response: string
+    return:
+      lastOf:
+      - model: ollama_chat/mistral-small:latest 
+        def: result
+        input: |
+          Does the following email end with Kind regards. Answer with a JSON object and a result field with value True or False only.
+          Email: ${ response }
+        parser: json
+      - if: ${ result.result }
+        then: 0
+        else: -1000000
+      
+  fix:
+    function:
+      requirement: string
+      response: string
+    return: 
+      lastOf:
+      - model: ollama_chat/mistral-small:latest 
+        def: instruction
+        input: |
+          A model responded with the following response: ${ response }
+          In order to satisfy the following requirement: ${ requirement }
+          what should be added to the prompt as an instruction?
+
+          Respond with only with the instruction.
+      - ${ pdl_context }
+
+  notes: Olivia helped the lab over the last few weeks by organizing intern events, advertising the speaker series, and handling issues with snack delivery.
+  name: Olivia
+text:
+- "Write an email to ${ name } using the notes following: ${ notes }"
+- model: ollama_chat/granite3.2:2b
+  requirements:
+  - expect: The email should end with Kind regards
+    evaluate:  ${ eval }
+    transformContext: ${ fix }
+  retry: 5
diff --git a/examples/requirements/gsm8k.pdl b/examples/requirements/gsm8k.pdl
new file mode 100644
index 000000000..4a1dd5b14
--- /dev/null
+++ b/examples/requirements/gsm8k.pdl
@@ -0,0 +1,52 @@
+defs:
+  model: ollama_chat/granite3.3:8b
+  llm_as_judge: ollama_chat/gpt-oss:20b
+
+  problem: |
+    Carla is downloading a 200 GB file. Normally she can download 2 GB/minute, 
+    but 40% of the way through the download, Windows forces a restart to install updates, 
+    which takes 20 minutes. Then Carla has to restart the download from the beginning. 
+    How load does it take to download the file?
+
+  extract_answer:
+    function:
+      solution: string
+    return:
+      lastOf:
+      - ${ solution }
+      - Extract the result from the above solution into a JSON object with field "answer" and a float as value. Remove any dollar signs or other symbols.
+      - model: ${ model }
+        parser: json
+        spec: { "answer": number }
+
+  solve:
+    function:
+      problem: string
+    return:
+      defs:
+        solution:
+          text:
+          - ${ problem }
+          - "\n\n"
+          - model: ${ model }
+            parameters:
+              temperature: 0.1
+            requirements:
+            - expect: "The solution to this problem should be correct. Problem: ${ problem }"
+            retry: 1
+        answer_obj:
+          call: ${ extract_answer }
+          args:
+            solution: ${ solution }
+            pdl_context: []
+        debug:
+          lang: python
+          code: |
+            print(answer_obj)    
+            result = ""
+      data: ${ answer_obj.answer }
+
+call: ${ solve }
+args:
+  problem: ${ problem }
+  pdl_context: []
diff --git a/examples/requirements/gsm8k_short.pdl b/examples/requirements/gsm8k_short.pdl
new file mode 100644
index 000000000..c4bebc874
--- /dev/null
+++ b/examples/requirements/gsm8k_short.pdl
@@ -0,0 +1,21 @@
+defs:
+  problem: |+
+    Carla is downloading a 200 GB file. Normally she can download 2 GB/minute, 
+    but 40% of the way through the download, Windows forces a restart to install updates, 
+    which takes 20 minutes. Then Carla has to restart the download from the beginning. 
+    How load does it take to download the file?
+
+
+lastOf:
+- ${ problem }
+- model: ollama_chat/granite3.3:8b
+  parameters:
+    temperature: 0.2
+- Extract the result from the above solution into a JSON object with field "answer" and a float as value. Remove any dollar signs or other symbols.
+- model: ollama_chat/granite3.3:8b
+  def: result
+  parser: json
+  spec: { "answer": number }
+  requirements:
+    - expect: "This solution to the following math problem is correct: ${ problem }"
+- ${ result.answer }
\ No newline at end of file
diff --git a/examples/sdk/hello_dict.py b/examples/sdk/hello_dict.py
deleted file mode 100644
index 4313898ce..000000000
--- a/examples/sdk/hello_dict.py
+++ /dev/null
@@ -1,22 +0,0 @@
-from pdl.pdl import exec_dict
-
-hello = {
-    "text": [
-        "Hello\n",
-        {
-            "model": "ollama_chat/granite3.2:2b",
-            "parameters": {
-                "stop": ["!"],
-            },
-        },
-    ]
-}
-
-
-def main():
-    result = exec_dict(hello)
-    print(result)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/examples/sdk/hello_prog.py b/examples/sdk/hello_prog.py
deleted file mode 100644
index de0c8b8e8..000000000
--- a/examples/sdk/hello_prog.py
+++ /dev/null
@@ -1,23 +0,0 @@
-from pdl.pdl import exec_program
-from pdl.pdl_ast import LitellmModelBlock, LitellmParameters, Program, TextBlock
-
-hello = Program(
-    TextBlock(
-        text=[
-            "Hello\n",
-            LitellmModelBlock(
-                model="ollama_chat/granite3.2:2b",
-                parameters=LitellmParameters(stop=["!"]),  # pyright: ignore
-            ),
-        ]
-    )
-)
-
-
-def main():
-    result = exec_program(hello)
-    print(result)
-
-
-if __name__ == "__main__":
-    main()
diff --git a/examples/skeleton-of-thought/tips.pdl b/examples/skeleton-of-thought/tips.pdl
index d41cba2da..7bc78cf21 100644
--- a/examples/skeleton-of-thought/tips.pdl
+++ b/examples/skeleton-of-thought/tips.pdl
@@ -1,6 +1,6 @@
 description: Tip suggestion program illustration skeleton-of-thought
 defs:
-  MAX_ITERATIONS: 50
+  MAX_ITERATIONS: 5
   topics:
     read: topic.jsonl
     parser: jsonl 
diff --git a/examples/tools/calc.pdl b/examples/tools/calc.pdl
index 2405f3c40..38094f3dc 100644
--- a/examples/tools/calc.pdl
+++ b/examples/tools/calc.pdl
@@ -1,16 +1,20 @@
 description: tool use
 defs:
+  calc:
+    description: Calculator function
+    function:
+      expr:
+        type: string
+        description: Arithmetic expression to calculate
+    return:
+      lang: python
+      code: result = ${ expr }
   tools:
-    data:
-    - name: calc
-      description: Calculator function
-      arguments:
-        expr:
-          type: string
-          description: Arithmetic expression to calculate
+    array:
+      - ${ calc.signature }
 text:
 - role: system
-  text: You are Granite, developed by IBM. You are a helpful AI assistant with access to the following tools. When a tool is required to answer the user's query, respond with <|tool_call|> followed by a JSON list of tools used. If a tool does not exist in the provided list of tools, notify the user that you do not have the ability to fulfill the request.
+  text: You are Granite, developed by IBM. You are a helpful AI assistant with access to the following tools.
   contribute: [context]
 - role: tools
   content:
@@ -21,11 +25,11 @@ text:
   model: ollama_chat/granite3.2:8b
   parser: json
   spec: [{ name: string, arguments: { expr: string }}]
-  parameters:
-    drop_params: true  # This is needed because the model does not support structured decoding. It directs LiteLLM to ignore parameters sent for structured decoding.
 - "\n"
-- if: ${ actions[0].name == "calc" }
-  then:
-    text:
-    - lang: python
-      code: result = ${ actions[0].arguments.expr }
\ No newline at end of file
+- match: ${ actions[0].name }
+  with:
+  - case: calc
+    then:
+      call: ${ calc }
+      args: 
+        expr: ${ actions[0].arguments.expr }
\ No newline at end of file
diff --git a/examples/tutorial/calling_llm.pdl b/examples/tutorial/calling_llm.pdl
index 00d09ccdd..49209043b 100644
--- a/examples/tutorial/calling_llm.pdl
+++ b/examples/tutorial/calling_llm.pdl
@@ -1,6 +1,6 @@
-description: Hello world calling a model
+description: Calling a model on the implicit background context
 text:
 - "Hello\n"
 - model: ollama_chat/granite3.2:2b
   parameters:
-    stop: ['!']
\ No newline at end of file
+    stop: ['!']
diff --git a/examples/tutorial/calling_llm_with_input.pdl b/examples/tutorial/calling_llm_with_input.pdl
index f16648849..33064cf68 100644
--- a/examples/tutorial/calling_llm_with_input.pdl
+++ b/examples/tutorial/calling_llm_with_input.pdl
@@ -1,4 +1,4 @@
-description: Hello world calling a model
+description: Calling a model with an input text
 text:
 - "Hello\n"
 - model: ollama_chat/granite3.2:2b
diff --git a/examples/tutorial/calling_llm_with_input_messages.pdl b/examples/tutorial/calling_llm_with_input_messages.pdl
index c994d7788..146a9e28f 100644
--- a/examples/tutorial/calling_llm_with_input_messages.pdl
+++ b/examples/tutorial/calling_llm_with_input_messages.pdl
@@ -1,4 +1,4 @@
-description: Hello world calling a model
+description: Calling a model with an explicit list of messages
 text:
 - "Hello\n"
 - model: ollama_chat/granite3.2:2b
diff --git a/examples/tutorial/calling_llm_with_input_messages_var.pdl b/examples/tutorial/calling_llm_with_input_messages_var.pdl
index 831467442..774950391 100644
--- a/examples/tutorial/calling_llm_with_input_messages_var.pdl
+++ b/examples/tutorial/calling_llm_with_input_messages_var.pdl
@@ -3,8 +3,10 @@ defs:
   prompt:
     array:
     - role: system
-      content: You are a helpful software engineer. You write clear, concise, well-commented code.
+      content: You are a helpful assistant that is fluent in French.
     - role: user
-      content: Write a Python function that implement merge sort.
-model: ollama_chat/granite3.2:2b
-input: ${ prompt }
+      content: Translate the word 'Hello' to French
+text:
+- "Hello\n"
+- model: ollama_chat/granite3.2:2b
+  input: ${ prompt }
diff --git a/examples/tutorial/defs-hello.pdl b/examples/tutorial/defs-hello.pdl
deleted file mode 100644
index 477d58822..000000000
--- a/examples/tutorial/defs-hello.pdl
+++ /dev/null
@@ -1,14 +0,0 @@
-description: Hello world with defs
-defs:
-  hello:
-    function:
-      name: string
-    return: Hello ${ name }!
-  bye:
-    "Good bye"
-text:
-- call: ${ hello }
-  args:
-    name: World
-- "\n"
-- ${ bye }
diff --git a/examples/tutorial/defs.pdl b/examples/tutorial/defs.pdl
index e2e49afd0..2bed2a974 100644
--- a/examples/tutorial/defs.pdl
+++ b/examples/tutorial/defs.pdl
@@ -1,22 +1,16 @@
-description: Function def and call
-defs:
-  translate:
-    function:
-      sentence: string
-      language: string
-    return:
+text:
+- "Hello\n"
+- defs:
+    fr:
       lastOf:
-      - "\nTranslate the sentence '${ sentence }' to ${ language }.\n"
+      - "\nTranslate to French\n"
       - model: ollama_chat/granite3.2:2b
-        parameters:
-          stop: ["\n"]
-text:
-- call: ${ translate }
-  args:
-    sentence: I love Paris!
-    language: French
-- "\n"
-- call: ${ translate }
-  args:
-    sentence: I love Madrid!
-    language: Spanish
\ No newline at end of file
+    es:
+      lastOf:
+      - "\nTranslate to Spanish\n"
+      - model: ollama_chat/granite3.2:2b
+  text: |
+  
+    In Fench: ${ fr }
+
+    In Spanish: ${ es }
diff --git a/examples/tutorial/function_alias.pdl b/examples/tutorial/function_alias.pdl
index 23bf7c115..62883c787 100644
--- a/examples/tutorial/function_alias.pdl
+++ b/examples/tutorial/function_alias.pdl
@@ -1,4 +1,4 @@
-description: Hello function
+description: Use a function as a value
 defs:
   hello:
     function:
diff --git a/examples/tutorial/function_call_in_jinja.pdl b/examples/tutorial/function_call_in_jinja.pdl
new file mode 100644
index 000000000..32a74aee8
--- /dev/null
+++ b/examples/tutorial/function_call_in_jinja.pdl
@@ -0,0 +1,14 @@
+description: Calling a PDL function from Jinja
+defs:
+  translate:
+    function:
+      sentence: string
+      language: string
+    return:
+      lastOf:
+      - |
+        Translate the sentence '${ sentence }' to ${ language }.
+        Only give the result of the translation.
+      - model: ollama_chat/granite3.2:2b
+text: |
+  The way to say hello in French is ${ translate("Hello", language="French") }.
diff --git a/examples/tutorial/function_definition.pdl b/examples/tutorial/function_definition.pdl
index dac318dc9..7124eb0c0 100644
--- a/examples/tutorial/function_definition.pdl
+++ b/examples/tutorial/function_definition.pdl
@@ -1,16 +1,16 @@
-description: Function def and call
+description: Function definition and call
+defs:
+  translate:
+    function:
+      sentence: string
+      language: string
+    return:
+      lastOf:
+      - |
+        Translate the sentence '${ sentence }' to ${ language }.
+        Only give the result of the translation.
+      - model: ollama_chat/granite3.2:2b
 text:
-- def: translate
-  function:
-    sentence: string
-    language: string
-  return:
-    lastOf:
-    - "\nTranslate the sentence '${ sentence }' to ${ language }.\n"
-    - model: ollama_chat/granite3.2:2b
-      parameters:
-        stop: ["\n"]
-        temperature: 0
 - call: ${ translate }
   args:
     sentence: I love Paris!
diff --git a/examples/tutorial/function_empty_context.pdl b/examples/tutorial/function_empty_context.pdl
index 54e3c6858..2f2d5dbf2 100644
--- a/examples/tutorial/function_empty_context.pdl
+++ b/examples/tutorial/function_empty_context.pdl
@@ -1,13 +1,24 @@
-description: Hello world with function definition and call
+description: Function call with an empty context
+defs:
+  translate:
+    function:
+      sentence: string
+      language: string
+    return:
+      lastOf:
+      - |
+        Translate the sentence '${ sentence }' to ${ language }.
+        Only give the result of the translation.
+      - model: ollama_chat/granite3.2:2b
 text:
-- def: hello
-  function:
-    name: string
-  return:
-    text:
-    -  Hello ${ name }!
-    - model: ollama_chat/granite3.2:8b
-- call: ${ hello }
+- call: ${ translate }
   args:
-    name: World
+    sentence: I love Paris!
+    language: French
+    pdl_context: []
+- "\n"
+- call: ${ translate }
+  args:
+    sentence: I love Madrid!
+    language: Spanish
     pdl_context: []
diff --git a/examples/tutorial/function_optional_params.pdl b/examples/tutorial/function_optional_params.pdl
index cde3af8ac..880c96632 100644
--- a/examples/tutorial/function_optional_params.pdl
+++ b/examples/tutorial/function_optional_params.pdl
@@ -1,14 +1,19 @@
-description: Hello world with function definition and call
+description: Function with optional parameter
+defs:
+  hello:
+    function:
+      name: string
+      lastName: {optional: string} # optional parameter
+    return:
+      if: ${ lastName is defined }
+      then: Hello ${ name } ${ lastName }!
+      else: Hello ${ name }!
 text:
-- def: hello
-  function:
-    name: string
-    lastName: {optional: string} # optional parameter
-  return:
-    if: ${ lastName is defined }
-    then: Hello ${ name } ${ lastName }!
-    else: Hello ${ name }!
 - call: ${ hello }
   args:
     name: World
-    lastName: Universe
+- "\n"
+- call: ${ hello }
+  args:
+    name: Earth
+    lastName: Planet
diff --git a/examples/tutorial/lastOf.pdl b/examples/tutorial/lastOf.pdl
new file mode 100644
index 000000000..9eacbd655
--- /dev/null
+++ b/examples/tutorial/lastOf.pdl
@@ -0,0 +1,8 @@
+description: Explicit use of role
+role: user
+text:
+- "Hello\n"
+- lastOf:
+  - role: system
+    text: "You are a polite assistant that likes to answer very formally."
+  - model: ollama_chat/granite3.2:2b
diff --git a/examples/tutorial/local_computation.pdl b/examples/tutorial/local_computation.pdl
new file mode 100644
index 000000000..2a22df33a
--- /dev/null
+++ b/examples/tutorial/local_computation.pdl
@@ -0,0 +1,9 @@
+description: Local computations using defs
+text:
+- "Hello\n"
+- defs:
+    GEN:
+      model: ollama_chat/granite3.2:2b
+      parameters:
+        stop: ['!']
+- "The variable GEN is equal to: ${ GEN }"
\ No newline at end of file
diff --git a/examples/tutorial/muting_block_output.pdl b/examples/tutorial/muting_block_output.pdl
index c75b416a0..987617eb1 100644
--- a/examples/tutorial/muting_block_output.pdl
+++ b/examples/tutorial/muting_block_output.pdl
@@ -1,21 +1,11 @@
-description: Function def and call
-defs:
-  translate:
-    function:
-      sentence: string
-      language: string
-    return:
-      text:
-      - text: "\nTranslate the sentence '${ sentence }' to ${ language }.\n"
-        contribute: [context]
-      - model: ollama_chat/granite3.2:2b
-        parameters:
-          stop: ["\n"]
+description: Control block outputs with `contribute`
 text:
-- call: ${ translate }
+- "Hello\n"
+- text: "\nTranslate to French\n"
+  contribute: [context]
+- model: ollama_chat/granite3.2:2b
   contribute: []
-  def: FRENCH
-  args:
-    sentence: I love Paris!
-    language: French
-- "The french sentence was: ${ FRENCH }"
\ No newline at end of file
+  def: fr
+- |
+  
+  In Fench: ${ fr }
diff --git a/examples/tutorial/role.pdl b/examples/tutorial/role.pdl
new file mode 100644
index 000000000..81907fd47
--- /dev/null
+++ b/examples/tutorial/role.pdl
@@ -0,0 +1,7 @@
+description: Explicit use of role
+role: user
+text:
+- "Hello\n"
+- role: system
+  text: "You are a polite assistant that likes to answer very formally."
+- model: ollama_chat/granite3.2:2b
diff --git a/examples/sdk/hello.pdl b/examples/tutorial/sdk/hello.pdl
similarity index 100%
rename from examples/sdk/hello.pdl
rename to examples/tutorial/sdk/hello.pdl
diff --git a/examples/tutorial/sdk/hello_dict.py b/examples/tutorial/sdk/hello_dict.py
new file mode 100644
index 000000000..06a8736dd
--- /dev/null
+++ b/examples/tutorial/sdk/hello_dict.py
@@ -0,0 +1,21 @@
+from pdl.pdl import exec_dict
+
+
+def main():
+    hello = {
+        "text": [
+            "Hello\n",
+            {
+                "model": "ollama_chat/granite3.2:2b",
+                "parameters": {
+                    "stop": ["!"],
+                },
+            },
+        ]
+    }
+    result = exec_dict(hello)
+    print(result)
+
+
+if __name__ == "__main__":
+    main()
diff --git a/examples/sdk/hello_file.py b/examples/tutorial/sdk/hello_file.py
similarity index 100%
rename from examples/sdk/hello_file.py
rename to examples/tutorial/sdk/hello_file.py
diff --git a/examples/tutorial/sdk/hello_parallel.py b/examples/tutorial/sdk/hello_parallel.py
new file mode 100644
index 000000000..6dd7b334c
--- /dev/null
+++ b/examples/tutorial/sdk/hello_parallel.py
@@ -0,0 +1,37 @@
+import concurrent.futures
+
+from pdl.pdl import exec_str
+
+HELLO = """
+text:
+- >+
+  Hello, my name is ${name}
+- model: ollama_chat/granite3.2:2b
+"""
+
+
+def _run_agent(name):
+    pdl_output = exec_str(
+        HELLO,
+        scope={"name": name},
+        config={
+            "yield_result": False,
+            "yield_background": False,
+            "batch": 1,  # disable streaming
+        },
+    )
+    return pdl_output
+
+
+if __name__ == "__main__":
+    data = ["Alice", "Nicolas", "Rosa", "Remi"]
+    with concurrent.futures.ProcessPoolExecutor() as executor:
+        futures = {executor.submit(_run_agent, name) for name in data}
+        executor.map(_run_agent, data)
+        for future in concurrent.futures.as_completed(futures):
+            try:
+                result = future.result()
+            except Exception as e:
+                print(f"Task raised an exception: {e}")
+            else:
+                print(result)
diff --git a/examples/tutorial/sdk/hello_prog.py b/examples/tutorial/sdk/hello_prog.py
new file mode 100644
index 000000000..f6baa420c
--- /dev/null
+++ b/examples/tutorial/sdk/hello_prog.py
@@ -0,0 +1,22 @@
+from pdl.pdl import exec_program
+from pdl.pdl_ast import LitellmModelBlock, LitellmParameters, Program, TextBlock
+
+
+def main():
+    hello = Program(
+        TextBlock(
+            text=[
+                "Hello\n",
+                LitellmModelBlock(
+                    model="ollama_chat/granite3.2:2b",
+                    parameters=LitellmParameters(stop=["!"]),
+                ),
+            ]
+        )
+    )
+    result = exec_program(hello)
+    print(result)
+
+
+if __name__ == "__main__":
+    main()
diff --git a/examples/sdk/hello_str.py b/examples/tutorial/sdk/hello_str.py
similarity index 94%
rename from examples/sdk/hello_str.py
rename to examples/tutorial/sdk/hello_str.py
index 8a6b52c90..40f3810ea 100644
--- a/examples/sdk/hello_str.py
+++ b/examples/tutorial/sdk/hello_str.py
@@ -2,7 +2,8 @@
 
 HELLO = """
 text:
-- "Hello\n"
+- >+
+  Hello
 - model: ollama_chat/granite3.2:2b
   parameters:
     stop: ['!']
diff --git a/examples/tutorial/sdk/lib.pdl b/examples/tutorial/sdk/lib.pdl
new file mode 100644
index 000000000..32d64b70b
--- /dev/null
+++ b/examples/tutorial/sdk/lib.pdl
@@ -0,0 +1,3 @@
+defs:
+  hello: 
+    data: Hello there!
\ No newline at end of file
diff --git a/examples/tutorial/sdk/run_pdl.py b/examples/tutorial/sdk/run_pdl.py
new file mode 100644
index 000000000..2bef0f08b
--- /dev/null
+++ b/examples/tutorial/sdk/run_pdl.py
@@ -0,0 +1,34 @@
+from pdl.pdl import pdl
+
+
+@pdl
+def my_pdl_program(scope):
+    """
+    model: ${ model }
+    input: ${ input }
+    """
+    return
+
+
+@pdl
+def another(scope):
+    """
+    defs:
+        lib:
+            import: lib
+    text:
+    - ${ lib.hello }
+    """
+
+
+def main():
+    result1 = my_pdl_program(
+        scope={"model": "ollama_chat/granite3.2:2b", "input": "Hello\n"}
+    )
+    result2 = another(scope={})
+    print(result1)
+    print(result2)
+
+
+if __name__ == "__main__":
+    main()
diff --git a/examples/tutorial/variable_def_use.pdl b/examples/tutorial/variable_def_use.pdl
index fea5ac9e9..1a0a53f98 100644
--- a/examples/tutorial/variable_def_use.pdl
+++ b/examples/tutorial/variable_def_use.pdl
@@ -1,8 +1,8 @@
-description: Hello world with variable def and use
+description: Variable def and use
 text:
 - "Hello\n"
 - model: ollama_chat/granite3.2:2b
-  def: GEN
   parameters:
     stop: ['!']
-- "\nGEN is equal to: ${ GEN }"
\ No newline at end of file
+  def: GEN
+- "\nThe variable GEN is equal to: ${ GEN }"
\ No newline at end of file
diff --git a/mkdocs.yml b/mkdocs.yml
index 3d5fe3887..2831e62d5 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -47,7 +47,7 @@ nav:
   - API Reference: api_reference.md
   - Contribute: contrib.md
   - Viewer: viewer.md
-  # - AutoPDL: autopdl.md # Hide documentation for now
+  - AutoPDL: autopdl.md
 
 # Define some IBM colors
 extra_css:
diff --git a/pdl-live-react/demos/run.sh b/pdl-live-react/demos/run.sh
index b87ce21f6..6dd96ea40 100755
--- a/pdl-live-react/demos/run.sh
+++ b/pdl-live-react/demos/run.sh
@@ -5,17 +5,17 @@ UI="$SCRIPTDIR"/.. # top of react UI
 TOP="$UI"/.. # top of repo
 T="$UI"/src/demos # place to store traces
 
-pdl --trace "$T"/demo1.json "$UI"/demos/demo1.pdl
-pdl --trace "$T"/demo2.json "$UI"/demos/demo2.pdl
-pdl --trace "$T"/demo3.json "$TOP"/examples/fibonacci/fib.pdl
-pdl --trace "$T"/demo4.json "$TOP"/examples/chatbot/chatbot.pdl <=6.0.0"
-      }
-    },
     "node_modules/@apidevtools/json-schema-ref-parser": {
       "version": "11.9.3",
       "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-11.9.3.tgz",
@@ -102,9 +88,9 @@
       }
     },
     "node_modules/@babel/compat-data": {
-      "version": "7.27.1",
-      "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.27.1.tgz",
-      "integrity": "sha512-Q+E+rd/yBzNQhXkG+zQnF58e4zoZfBedaxwzPmicKsiK3nt8iJYrSrDbjwFFDGC4f+rPafqRaPH6TsDoSvMf7A==",
+      "version": "7.28.0",
+      "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.28.0.tgz",
+      "integrity": "sha512-60X7qkglvrap8mn1lh2ebxXdZYtUcpd7gsmy9kLaBJ4i/WdY8PqTSdxyA8qraikqKQK5C1KRBKXqznrVapyNaw==",
       "dev": true,
       "license": "MIT",
       "engines": {
@@ -112,22 +98,22 @@
       }
     },
     "node_modules/@babel/core": {
-      "version": "7.27.1",
-      "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.27.1.tgz",
-      "integrity": "sha512-IaaGWsQqfsQWVLqMn9OB92MNN7zukfVA4s7KKAI0KfrrDsZ0yhi5uV4baBuLuN7n3vsZpwP8asPPcVwApxvjBQ==",
+      "version": "7.28.4",
+      "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.4.tgz",
+      "integrity": "sha512-2BCOP7TN8M+gVDj7/ht3hsaO/B/n5oDbiAyyvnRlNOs+u1o+JWNYTQrmpuNp1/Wq2gcFrI01JAW+paEKDMx/CA==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "@ampproject/remapping": "^2.2.0",
         "@babel/code-frame": "^7.27.1",
-        "@babel/generator": "^7.27.1",
-        "@babel/helper-compilation-targets": "^7.27.1",
-        "@babel/helper-module-transforms": "^7.27.1",
-        "@babel/helpers": "^7.27.1",
-        "@babel/parser": "^7.27.1",
-        "@babel/template": "^7.27.1",
-        "@babel/traverse": "^7.27.1",
-        "@babel/types": "^7.27.1",
+        "@babel/generator": "^7.28.3",
+        "@babel/helper-compilation-targets": "^7.27.2",
+        "@babel/helper-module-transforms": "^7.28.3",
+        "@babel/helpers": "^7.28.4",
+        "@babel/parser": "^7.28.4",
+        "@babel/template": "^7.27.2",
+        "@babel/traverse": "^7.28.4",
+        "@babel/types": "^7.28.4",
+        "@jridgewell/remapping": "^2.3.5",
         "convert-source-map": "^2.0.0",
         "debug": "^4.1.0",
         "gensync": "^1.0.0-beta.2",
@@ -143,16 +129,16 @@
       }
     },
     "node_modules/@babel/generator": {
-      "version": "7.27.1",
-      "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.27.1.tgz",
-      "integrity": "sha512-UnJfnIpc/+JO0/+KRVQNGU+y5taA5vCbwN8+azkX6beii/ZF+enZJSOKo11ZSzGJjlNfJHfQtmQT8H+9TXPG2w==",
+      "version": "7.28.3",
+      "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.28.3.tgz",
+      "integrity": "sha512-3lSpxGgvnmZznmBkCRnVREPUFJv2wrv9iAoFDvADJc0ypmdOxdUtcLeBgBJ6zE0PMeTKnxeQzyk0xTBq4Ep7zw==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "@babel/parser": "^7.27.1",
-        "@babel/types": "^7.27.1",
-        "@jridgewell/gen-mapping": "^0.3.5",
-        "@jridgewell/trace-mapping": "^0.3.25",
+        "@babel/parser": "^7.28.3",
+        "@babel/types": "^7.28.2",
+        "@jridgewell/gen-mapping": "^0.3.12",
+        "@jridgewell/trace-mapping": "^0.3.28",
         "jsesc": "^3.0.2"
       },
       "engines": {
@@ -160,13 +146,13 @@
       }
     },
     "node_modules/@babel/helper-compilation-targets": {
-      "version": "7.27.1",
-      "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.1.tgz",
-      "integrity": "sha512-2YaDd/Rd9E598B5+WIc8wJPmWETiiJXFYVE60oX8FDohv7rAUU3CQj+A1MgeEmcsk2+dQuEjIe/GDvig0SqL4g==",
+      "version": "7.27.2",
+      "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz",
+      "integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "@babel/compat-data": "^7.27.1",
+        "@babel/compat-data": "^7.27.2",
         "@babel/helper-validator-option": "^7.27.1",
         "browserslist": "^4.24.0",
         "lru-cache": "^5.1.1",
@@ -176,6 +162,16 @@
         "node": ">=6.9.0"
       }
     },
+    "node_modules/@babel/helper-globals": {
+      "version": "7.28.0",
+      "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz",
+      "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=6.9.0"
+      }
+    },
     "node_modules/@babel/helper-module-imports": {
       "version": "7.27.1",
       "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz",
@@ -191,15 +187,15 @@
       }
     },
     "node_modules/@babel/helper-module-transforms": {
-      "version": "7.27.1",
-      "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.27.1.tgz",
-      "integrity": "sha512-9yHn519/8KvTU5BjTVEEeIM3w9/2yXNKoD82JifINImhpKkARMJKPP59kLo+BafpdN5zgNeIcS4jsGDmd3l58g==",
+      "version": "7.28.3",
+      "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.3.tgz",
+      "integrity": "sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
         "@babel/helper-module-imports": "^7.27.1",
         "@babel/helper-validator-identifier": "^7.27.1",
-        "@babel/traverse": "^7.27.1"
+        "@babel/traverse": "^7.28.3"
       },
       "engines": {
         "node": ">=6.9.0"
@@ -249,27 +245,27 @@
       }
     },
     "node_modules/@babel/helpers": {
-      "version": "7.27.1",
-      "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.1.tgz",
-      "integrity": "sha512-FCvFTm0sWV8Fxhpp2McP5/W53GPllQ9QeQ7SiqGWjMf/LVG07lFa5+pgK05IRhVwtvafT22KF+ZSnM9I545CvQ==",
+      "version": "7.28.4",
+      "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.4.tgz",
+      "integrity": "sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "@babel/template": "^7.27.1",
-        "@babel/types": "^7.27.1"
+        "@babel/template": "^7.27.2",
+        "@babel/types": "^7.28.4"
       },
       "engines": {
         "node": ">=6.9.0"
       }
     },
     "node_modules/@babel/parser": {
-      "version": "7.27.1",
-      "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.1.tgz",
-      "integrity": "sha512-I0dZ3ZpCrJ1c04OqlNsQcKiZlsrXf/kkE4FXzID9rIOYICsAbA8mMDzhW/luRNAHdCNt7os/u8wenklZDlUVUQ==",
+      "version": "7.28.4",
+      "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.4.tgz",
+      "integrity": "sha512-yZbBqeM6TkpP9du/I2pUZnJsRMGGvOuIrhjzC1AwHwW+6he4mni6Bp/m8ijn0iOuZuPI2BfkCoSRunpyjnrQKg==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "@babel/types": "^7.27.1"
+        "@babel/types": "^7.28.4"
       },
       "bin": {
         "parser": "bin/babel-parser.js"
@@ -320,14 +316,14 @@
       }
     },
     "node_modules/@babel/template": {
-      "version": "7.27.1",
-      "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.1.tgz",
-      "integrity": "sha512-Fyo3ghWMqkHHpHQCoBs2VnYjR4iWFFjguTDEqA5WgZDOrFesVjMhMM2FSqTKSoUSDO1VQtavj8NFpdRBEvJTtg==",
+      "version": "7.27.2",
+      "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz",
+      "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
         "@babel/code-frame": "^7.27.1",
-        "@babel/parser": "^7.27.1",
+        "@babel/parser": "^7.27.2",
         "@babel/types": "^7.27.1"
       },
       "engines": {
@@ -335,38 +331,28 @@
       }
     },
     "node_modules/@babel/traverse": {
-      "version": "7.27.1",
-      "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.27.1.tgz",
-      "integrity": "sha512-ZCYtZciz1IWJB4U61UPu4KEaqyfj+r5T1Q5mqPo+IBpcG9kHv30Z0aD8LXPgC1trYa6rK0orRyAhqUgk4MjmEg==",
+      "version": "7.28.4",
+      "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.28.4.tgz",
+      "integrity": "sha512-YEzuboP2qvQavAcjgQNVgsvHIDv6ZpwXvcvjmyySP2DIMuByS/6ioU5G9pYrWHM6T2YDfc7xga9iNzYOs12CFQ==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
         "@babel/code-frame": "^7.27.1",
-        "@babel/generator": "^7.27.1",
-        "@babel/parser": "^7.27.1",
-        "@babel/template": "^7.27.1",
-        "@babel/types": "^7.27.1",
-        "debug": "^4.3.1",
-        "globals": "^11.1.0"
+        "@babel/generator": "^7.28.3",
+        "@babel/helper-globals": "^7.28.0",
+        "@babel/parser": "^7.28.4",
+        "@babel/template": "^7.27.2",
+        "@babel/types": "^7.28.4",
+        "debug": "^4.3.1"
       },
       "engines": {
         "node": ">=6.9.0"
       }
     },
-    "node_modules/@babel/traverse/node_modules/globals": {
-      "version": "11.12.0",
-      "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
-      "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=4"
-      }
-    },
     "node_modules/@babel/types": {
-      "version": "7.27.1",
-      "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.1.tgz",
-      "integrity": "sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==",
+      "version": "7.28.4",
+      "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.4.tgz",
+      "integrity": "sha512-bkFqkLhh3pMBUQQkpVgWDWq/lqzc2678eUyDlTBhRqhCHFguYYGM0Efga7tYk4TogG/3x0EEl66/OQ+WGbWB/Q==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
@@ -803,9 +789,9 @@
       }
     },
     "node_modules/@eslint-community/eslint-utils": {
-      "version": "4.7.0",
-      "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz",
-      "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==",
+      "version": "4.8.0",
+      "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.8.0.tgz",
+      "integrity": "sha512-MJQFqrZgcW0UNYLGOuQpey/oTN59vyWwplvCGZztn1cKz9agZPPYpJB7h2OMmuu7VLqkvEjN8feFZJmxNF9D+Q==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
@@ -845,9 +831,9 @@
       }
     },
     "node_modules/@eslint/config-array": {
-      "version": "0.20.0",
-      "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.20.0.tgz",
-      "integrity": "sha512-fxlS1kkIjx8+vy2SjuCB94q3htSNrufYTXubwiBFeaQHbH6Ipi43gFJq2zCMt6PHhImH3Xmr0NksKDvchWlpQQ==",
+      "version": "0.21.0",
+      "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.0.tgz",
+      "integrity": "sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ==",
       "dev": true,
       "license": "Apache-2.0",
       "dependencies": {
@@ -860,9 +846,9 @@
       }
     },
     "node_modules/@eslint/config-helpers": {
-      "version": "0.2.2",
-      "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.2.2.tgz",
-      "integrity": "sha512-+GPzk8PlG0sPpzdU5ZvIRMPidzAnZDl/s9L+y13iodqvb8leL53bTannOrQ/Im7UkpsmFU5Ily5U60LWixnmLg==",
+      "version": "0.3.1",
+      "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.3.1.tgz",
+      "integrity": "sha512-xR93k9WhrDYpXHORXpxVL5oHj3Era7wo6k/Wd8/IsQNnZUTzkGS29lyn3nAT05v6ltUuTFVCCYDEGfy2Or/sPA==",
       "dev": true,
       "license": "Apache-2.0",
       "engines": {
@@ -870,9 +856,9 @@
       }
     },
     "node_modules/@eslint/core": {
-      "version": "0.13.0",
-      "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.13.0.tgz",
-      "integrity": "sha512-yfkgDw1KR66rkT5A8ci4irzDysN7FRpq3ttJolR88OqQikAWqwA8j5VZyas+vjyBNFIJ7MfybJ9plMILI2UrCw==",
+      "version": "0.15.2",
+      "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.15.2.tgz",
+      "integrity": "sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==",
       "dev": true,
       "license": "Apache-2.0",
       "dependencies": {
@@ -920,13 +906,16 @@
       }
     },
     "node_modules/@eslint/js": {
-      "version": "9.26.0",
-      "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.26.0.tgz",
-      "integrity": "sha512-I9XlJawFdSMvWjDt6wksMCrgns5ggLNfFwFvnShsleWruvXM514Qxk8V246efTw+eo9JABvVz+u3q2RiAowKxQ==",
+      "version": "9.35.0",
+      "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.35.0.tgz",
+      "integrity": "sha512-30iXE9whjlILfWobBkNerJo+TXYsgVM5ERQwMcMKCHckHflCmf7wXDAHlARoWnh0s1U72WqlbeyE7iAcCzuCPw==",
       "dev": true,
       "license": "MIT",
       "engines": {
         "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+      },
+      "funding": {
+        "url": "https://eslint.org/donate"
       }
     },
     "node_modules/@eslint/object-schema": {
@@ -940,13 +929,13 @@
       }
     },
     "node_modules/@eslint/plugin-kit": {
-      "version": "0.2.8",
-      "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.8.tgz",
-      "integrity": "sha512-ZAoA40rNMPwSm+AeHpCq8STiNAwzWLJuP8Xv4CHIc9wv/PSuExjMrmjfYNj682vW0OOiZ1HKxzvjQr9XZIisQA==",
+      "version": "0.3.5",
+      "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.5.tgz",
+      "integrity": "sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==",
       "dev": true,
       "license": "Apache-2.0",
       "dependencies": {
-        "@eslint/core": "^0.13.0",
+        "@eslint/core": "^0.15.2",
         "levn": "^0.4.1"
       },
       "engines": {
@@ -1020,34 +1009,31 @@
       }
     },
     "node_modules/@jridgewell/gen-mapping": {
-      "version": "0.3.8",
-      "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz",
-      "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==",
+      "version": "0.3.12",
+      "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.12.tgz",
+      "integrity": "sha512-OuLGC46TjB5BbN1dH8JULVVZY4WTdkF7tV9Ys6wLL1rubZnCMstOhNHueU5bLCrnRuDhKPDM4g6sw4Bel5Gzqg==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "@jridgewell/set-array": "^1.2.1",
-        "@jridgewell/sourcemap-codec": "^1.4.10",
+        "@jridgewell/sourcemap-codec": "^1.5.0",
         "@jridgewell/trace-mapping": "^0.3.24"
-      },
-      "engines": {
-        "node": ">=6.0.0"
       }
     },
-    "node_modules/@jridgewell/resolve-uri": {
-      "version": "3.1.2",
-      "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
-      "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
+    "node_modules/@jridgewell/remapping": {
+      "version": "2.3.5",
+      "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz",
+      "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==",
       "dev": true,
       "license": "MIT",
-      "engines": {
-        "node": ">=6.0.0"
+      "dependencies": {
+        "@jridgewell/gen-mapping": "^0.3.5",
+        "@jridgewell/trace-mapping": "^0.3.24"
       }
     },
-    "node_modules/@jridgewell/set-array": {
-      "version": "1.2.1",
-      "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz",
-      "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==",
+    "node_modules/@jridgewell/resolve-uri": {
+      "version": "3.1.2",
+      "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
+      "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
       "dev": true,
       "license": "MIT",
       "engines": {
@@ -1073,9 +1059,9 @@
       "license": "MIT"
     },
     "node_modules/@jridgewell/trace-mapping": {
-      "version": "0.3.25",
-      "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz",
-      "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==",
+      "version": "0.3.29",
+      "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.29.tgz",
+      "integrity": "sha512-uw6guiW/gcAGPDhLmd77/6lW8QLeiV5RUTsAX46Db6oLhGaVj4lhnPwb184s1bkc8kdVg/+h988dro8GRDpmYQ==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
@@ -1090,28 +1076,6 @@
       "dev": true,
       "license": "MIT"
     },
-    "node_modules/@modelcontextprotocol/sdk": {
-      "version": "1.11.0",
-      "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.11.0.tgz",
-      "integrity": "sha512-k/1pb70eD638anoi0e8wUGAlbMJXyvdV4p62Ko+EZ7eBe1xMx8Uhak1R5DgfoofsK5IBBnRwsYGTaLZl+6/+RQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "content-type": "^1.0.5",
-        "cors": "^2.8.5",
-        "cross-spawn": "^7.0.3",
-        "eventsource": "^3.0.2",
-        "express": "^5.0.1",
-        "express-rate-limit": "^7.5.0",
-        "pkce-challenge": "^5.0.0",
-        "raw-body": "^3.0.0",
-        "zod": "^3.23.8",
-        "zod-to-json-schema": "^3.24.1"
-      },
-      "engines": {
-        "node": ">=18"
-      }
-    },
     "node_modules/@monaco-editor/loader": {
       "version": "1.5.0",
       "resolved": "https://registry.npmjs.org/@monaco-editor/loader/-/loader-1.5.0.tgz",
@@ -1174,71 +1138,71 @@
       }
     },
     "node_modules/@patternfly/react-code-editor": {
-      "version": "6.2.2",
-      "resolved": "https://registry.npmjs.org/@patternfly/react-code-editor/-/react-code-editor-6.2.2.tgz",
-      "integrity": "sha512-KPnkNP769afD2rvoNQtgCx+SYscamM5QSRmw2FJ9QPHVMksarwTsMvrdMxvu+n6Dhs/T40vQLU5UR7X2yPrURg==",
+      "version": "6.3.1",
+      "resolved": "https://registry.npmjs.org/@patternfly/react-code-editor/-/react-code-editor-6.3.1.tgz",
+      "integrity": "sha512-lzrION96CR2G3ASjE++dX/dExH08HVcCLXbHdmiiTL4eHfbqXt4edDc+UX619XrbaccJBE+BxNNGKyO8bgpKRg==",
       "license": "MIT",
       "dependencies": {
         "@monaco-editor/react": "^4.6.0",
-        "@patternfly/react-core": "^6.2.2",
-        "@patternfly/react-icons": "^6.2.2",
-        "@patternfly/react-styles": "^6.2.2",
+        "@patternfly/react-core": "^6.3.1",
+        "@patternfly/react-icons": "^6.3.1",
+        "@patternfly/react-styles": "^6.3.1",
         "react-dropzone": "14.3.5",
         "tslib": "^2.8.1"
       },
       "peerDependencies": {
-        "react": "^17 || ^18",
-        "react-dom": "^17 || ^18"
+        "react": "^17 || ^18 || ^19",
+        "react-dom": "^17 || ^18 || ^19"
       }
     },
     "node_modules/@patternfly/react-core": {
-      "version": "6.2.2",
-      "resolved": "https://registry.npmjs.org/@patternfly/react-core/-/react-core-6.2.2.tgz",
-      "integrity": "sha512-JUrZ57JQ4bkmed1kxaciXb0ZpIVYyCHc2HjtzoKQ5UNRlx204zR2isATSHjdw2GFcWvwpkC5/fU2BR+oT3opbg==",
+      "version": "6.3.1",
+      "resolved": "https://registry.npmjs.org/@patternfly/react-core/-/react-core-6.3.1.tgz",
+      "integrity": "sha512-1qV20nU4M6PA28qnikH9fPLQlkteaZZToFlATjBNBw7aUI6zIvj7U0akkHz8raWcfHAI+tAzGV7dfKjiv035/g==",
       "license": "MIT",
       "dependencies": {
-        "@patternfly/react-icons": "^6.2.2",
-        "@patternfly/react-styles": "^6.2.2",
-        "@patternfly/react-tokens": "^6.2.2",
+        "@patternfly/react-icons": "^6.3.1",
+        "@patternfly/react-styles": "^6.3.1",
+        "@patternfly/react-tokens": "^6.3.1",
         "focus-trap": "7.6.4",
         "react-dropzone": "^14.3.5",
         "tslib": "^2.8.1"
       },
       "peerDependencies": {
-        "react": "^17 || ^18",
-        "react-dom": "^17 || ^18"
+        "react": "^17 || ^18 || ^19",
+        "react-dom": "^17 || ^18 || ^19"
       }
     },
     "node_modules/@patternfly/react-icons": {
-      "version": "6.2.2",
-      "resolved": "https://registry.npmjs.org/@patternfly/react-icons/-/react-icons-6.2.2.tgz",
-      "integrity": "sha512-XkBwzuV/uiolX+T6QgB3RIqphM1m+vAZjAe3McYtyY22j1rsOdlWDE4RtRrJ1q7EoIZwyZHj0h8T9vMfUsLn4Q==",
+      "version": "6.3.1",
+      "resolved": "https://registry.npmjs.org/@patternfly/react-icons/-/react-icons-6.3.1.tgz",
+      "integrity": "sha512-uiMounSIww1iZLM4pq+X8c3upzwl9iowXRPjR5CA8entb70lwgAXg3PqvypnuTAcilTq1Y3k5sFTqkhz7rgKcQ==",
       "license": "MIT",
       "peerDependencies": {
-        "react": "^17 || ^18",
-        "react-dom": "^17 || ^18"
+        "react": "^17 || ^18 || ^19",
+        "react-dom": "^17 || ^18 || ^19"
       }
     },
     "node_modules/@patternfly/react-styles": {
-      "version": "6.2.2",
-      "resolved": "https://registry.npmjs.org/@patternfly/react-styles/-/react-styles-6.2.2.tgz",
-      "integrity": "sha512-rncRDq66H8VnLyb9DrHHlZtPddlpNL9+W0XuQC0L7F6p78hOwSZmoGTW2Vq8/wJplDj8h/61qRpfRF9VEYPW0g==",
+      "version": "6.3.1",
+      "resolved": "https://registry.npmjs.org/@patternfly/react-styles/-/react-styles-6.3.1.tgz",
+      "integrity": "sha512-hyb+PlO8YITjKh2wBvjdeZhX6FyB3hlf4r6yG4rPOHk4SgneXHjNSdGwQ3szAxgGqtbENCYtOqwD/8ai72GrxQ==",
       "license": "MIT"
     },
     "node_modules/@patternfly/react-tokens": {
-      "version": "6.2.2",
-      "resolved": "https://registry.npmjs.org/@patternfly/react-tokens/-/react-tokens-6.2.2.tgz",
-      "integrity": "sha512-2GRWDPBTrcTlGNFc5NPJjrjEVU90RpgcGX/CIe2MplLgM32tpVIkeUtqIoJPLRk5GrbhyFuHJYRU+O93gU4o3Q==",
+      "version": "6.3.1",
+      "resolved": "https://registry.npmjs.org/@patternfly/react-tokens/-/react-tokens-6.3.1.tgz",
+      "integrity": "sha512-wt/xKU1tGCDXUueFb+8/Cwxlm4vUD/Xl26O8MxbSLm6NZAHOUPwytJ7gugloGSPvc/zcsXxEgKANL8UZNO6DTw==",
       "license": "MIT"
     },
     "node_modules/@playwright/test": {
-      "version": "1.52.0",
-      "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.52.0.tgz",
-      "integrity": "sha512-uh6W7sb55hl7D6vsAeA+V2p5JnlAqzhqFyF0VcJkKZXkgnFcVG9PziERRHQfPLfNGx1C292a4JqbWzhR8L4R1g==",
+      "version": "1.55.0",
+      "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.55.0.tgz",
+      "integrity": "sha512-04IXzPwHrW69XusN/SIdDdKZBzMfOT9UNT/YiJit/xpy2VuAoB8NHc8Aplb96zsWDddLnbkPL3TsmrS04ZU2xQ==",
       "dev": true,
       "license": "Apache-2.0",
       "dependencies": {
-        "playwright": "1.52.0"
+        "playwright": "1.55.0"
       },
       "bin": {
         "playwright": "cli.js"
@@ -1247,6 +1211,13 @@
         "node": ">=18"
       }
     },
+    "node_modules/@rolldown/pluginutils": {
+      "version": "1.0.0-beta.35",
+      "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.35.tgz",
+      "integrity": "sha512-slYrCpoxJUqzFDDNlvrOYRazQUNRvWPjXA17dAOISY3rDMxX6k8K4cj2H+hEYMHF81HO3uNd5rHVigAWRM5dSg==",
+      "dev": true,
+      "license": "MIT"
+    },
     "node_modules/@rollup/pluginutils": {
       "version": "4.2.1",
       "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz",
@@ -1275,9 +1246,9 @@
       }
     },
     "node_modules/@rollup/rollup-android-arm-eabi": {
-      "version": "4.40.1",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.40.1.tgz",
-      "integrity": "sha512-kxz0YeeCrRUHz3zyqvd7n+TVRlNyTifBsmnmNPtk3hQURUyG9eAB+usz6DAwagMusjx/zb3AjvDUvhFGDAexGw==",
+      "version": "4.46.2",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.46.2.tgz",
+      "integrity": "sha512-Zj3Hl6sN34xJtMv7Anwb5Gu01yujyE/cLBDB2gnHTAHaWS1Z38L7kuSG+oAh0giZMqG060f/YBStXtMH6FvPMA==",
       "cpu": [
         "arm"
       ],
@@ -1289,9 +1260,9 @@
       ]
     },
     "node_modules/@rollup/rollup-android-arm64": {
-      "version": "4.40.1",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.40.1.tgz",
-      "integrity": "sha512-PPkxTOisoNC6TpnDKatjKkjRMsdaWIhyuMkA4UsBXT9WEZY4uHezBTjs6Vl4PbqQQeu6oION1w2voYZv9yquCw==",
+      "version": "4.46.2",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.46.2.tgz",
+      "integrity": "sha512-nTeCWY83kN64oQ5MGz3CgtPx8NSOhC5lWtsjTs+8JAJNLcP3QbLCtDDgUKQc/Ro/frpMq4SHUaHN6AMltcEoLQ==",
       "cpu": [
         "arm64"
       ],
@@ -1303,9 +1274,9 @@
       ]
     },
     "node_modules/@rollup/rollup-darwin-arm64": {
-      "version": "4.40.1",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.40.1.tgz",
-      "integrity": "sha512-VWXGISWFY18v/0JyNUy4A46KCFCb9NVsH+1100XP31lud+TzlezBbz24CYzbnA4x6w4hx+NYCXDfnvDVO6lcAA==",
+      "version": "4.46.2",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.46.2.tgz",
+      "integrity": "sha512-HV7bW2Fb/F5KPdM/9bApunQh68YVDU8sO8BvcW9OngQVN3HHHkw99wFupuUJfGR9pYLLAjcAOA6iO+evsbBaPQ==",
       "cpu": [
         "arm64"
       ],
@@ -1317,9 +1288,9 @@
       ]
     },
     "node_modules/@rollup/rollup-darwin-x64": {
-      "version": "4.40.1",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.40.1.tgz",
-      "integrity": "sha512-nIwkXafAI1/QCS7pxSpv/ZtFW6TXcNUEHAIA9EIyw5OzxJZQ1YDrX+CL6JAIQgZ33CInl1R6mHet9Y/UZTg2Bw==",
+      "version": "4.46.2",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.46.2.tgz",
+      "integrity": "sha512-SSj8TlYV5nJixSsm/y3QXfhspSiLYP11zpfwp6G/YDXctf3Xkdnk4woJIF5VQe0of2OjzTt8EsxnJDCdHd2xMA==",
       "cpu": [
         "x64"
       ],
@@ -1331,9 +1302,9 @@
       ]
     },
     "node_modules/@rollup/rollup-freebsd-arm64": {
-      "version": "4.40.1",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.40.1.tgz",
-      "integrity": "sha512-BdrLJ2mHTrIYdaS2I99mriyJfGGenSaP+UwGi1kB9BLOCu9SR8ZpbkmmalKIALnRw24kM7qCN0IOm6L0S44iWw==",
+      "version": "4.46.2",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.46.2.tgz",
+      "integrity": "sha512-ZyrsG4TIT9xnOlLsSSi9w/X29tCbK1yegE49RYm3tu3wF1L/B6LVMqnEWyDB26d9Ecx9zrmXCiPmIabVuLmNSg==",
       "cpu": [
         "arm64"
       ],
@@ -1345,9 +1316,9 @@
       ]
     },
     "node_modules/@rollup/rollup-freebsd-x64": {
-      "version": "4.40.1",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.40.1.tgz",
-      "integrity": "sha512-VXeo/puqvCG8JBPNZXZf5Dqq7BzElNJzHRRw3vjBE27WujdzuOPecDPc/+1DcdcTptNBep3861jNq0mYkT8Z6Q==",
+      "version": "4.46.2",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.46.2.tgz",
+      "integrity": "sha512-pCgHFoOECwVCJ5GFq8+gR8SBKnMO+xe5UEqbemxBpCKYQddRQMgomv1104RnLSg7nNvgKy05sLsY51+OVRyiVw==",
       "cpu": [
         "x64"
       ],
@@ -1359,9 +1330,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
-      "version": "4.40.1",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.40.1.tgz",
-      "integrity": "sha512-ehSKrewwsESPt1TgSE/na9nIhWCosfGSFqv7vwEtjyAqZcvbGIg4JAcV7ZEh2tfj/IlfBeZjgOXm35iOOjadcg==",
+      "version": "4.46.2",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.46.2.tgz",
+      "integrity": "sha512-EtP8aquZ0xQg0ETFcxUbU71MZlHaw9MChwrQzatiE8U/bvi5uv/oChExXC4mWhjiqK7azGJBqU0tt5H123SzVA==",
       "cpu": [
         "arm"
       ],
@@ -1373,9 +1344,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-arm-musleabihf": {
-      "version": "4.40.1",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.40.1.tgz",
-      "integrity": "sha512-m39iO/aaurh5FVIu/F4/Zsl8xppd76S4qoID8E+dSRQvTyZTOI2gVk3T4oqzfq1PtcvOfAVlwLMK3KRQMaR8lg==",
+      "version": "4.46.2",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.46.2.tgz",
+      "integrity": "sha512-qO7F7U3u1nfxYRPM8HqFtLd+raev2K137dsV08q/LRKRLEc7RsiDWihUnrINdsWQxPR9jqZ8DIIZ1zJJAm5PjQ==",
       "cpu": [
         "arm"
       ],
@@ -1387,9 +1358,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-arm64-gnu": {
-      "version": "4.40.1",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.40.1.tgz",
-      "integrity": "sha512-Y+GHnGaku4aVLSgrT0uWe2o2Rq8te9hi+MwqGF9r9ORgXhmHK5Q71N757u0F8yU1OIwUIFy6YiJtKjtyktk5hg==",
+      "version": "4.46.2",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.46.2.tgz",
+      "integrity": "sha512-3dRaqLfcOXYsfvw5xMrxAk9Lb1f395gkoBYzSFcc/scgRFptRXL9DOaDpMiehf9CO8ZDRJW2z45b6fpU5nwjng==",
       "cpu": [
         "arm64"
       ],
@@ -1401,9 +1372,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-arm64-musl": {
-      "version": "4.40.1",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.40.1.tgz",
-      "integrity": "sha512-jEwjn3jCA+tQGswK3aEWcD09/7M5wGwc6+flhva7dsQNRZZTe30vkalgIzV4tjkopsTS9Jd7Y1Bsj6a4lzz8gQ==",
+      "version": "4.46.2",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.46.2.tgz",
+      "integrity": "sha512-fhHFTutA7SM+IrR6lIfiHskxmpmPTJUXpWIsBXpeEwNgZzZZSg/q4i6FU4J8qOGyJ0TR+wXBwx/L7Ho9z0+uDg==",
       "cpu": [
         "arm64"
       ],
@@ -1415,9 +1386,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-loongarch64-gnu": {
-      "version": "4.40.1",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.40.1.tgz",
-      "integrity": "sha512-ySyWikVhNzv+BV/IDCsrraOAZ3UaC8SZB67FZlqVwXwnFhPihOso9rPOxzZbjp81suB1O2Topw+6Ug3JNegejQ==",
+      "version": "4.46.2",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.46.2.tgz",
+      "integrity": "sha512-i7wfGFXu8x4+FRqPymzjD+Hyav8l95UIZ773j7J7zRYc3Xsxy2wIn4x+llpunexXe6laaO72iEjeeGyUFmjKeA==",
       "cpu": [
         "loong64"
       ],
@@ -1428,10 +1399,10 @@
         "linux"
       ]
     },
-    "node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
-      "version": "4.40.1",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.40.1.tgz",
-      "integrity": "sha512-BvvA64QxZlh7WZWqDPPdt0GH4bznuL6uOO1pmgPnnv86rpUpc8ZxgZwcEgXvo02GRIZX1hQ0j0pAnhwkhwPqWg==",
+    "node_modules/@rollup/rollup-linux-ppc64-gnu": {
+      "version": "4.46.2",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.46.2.tgz",
+      "integrity": "sha512-B/l0dFcHVUnqcGZWKcWBSV2PF01YUt0Rvlurci5P+neqY/yMKchGU8ullZvIv5e8Y1C6wOn+U03mrDylP5q9Yw==",
       "cpu": [
         "ppc64"
       ],
@@ -1443,9 +1414,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-riscv64-gnu": {
-      "version": "4.40.1",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.40.1.tgz",
-      "integrity": "sha512-EQSP+8+1VuSulm9RKSMKitTav89fKbHymTf25n5+Yr6gAPZxYWpj3DzAsQqoaHAk9YX2lwEyAf9S4W8F4l3VBQ==",
+      "version": "4.46.2",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.46.2.tgz",
+      "integrity": "sha512-32k4ENb5ygtkMwPMucAb8MtV8olkPT03oiTxJbgkJa7lJ7dZMr0GCFJlyvy+K8iq7F/iuOr41ZdUHaOiqyR3iQ==",
       "cpu": [
         "riscv64"
       ],
@@ -1457,9 +1428,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-riscv64-musl": {
-      "version": "4.40.1",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.40.1.tgz",
-      "integrity": "sha512-n/vQ4xRZXKuIpqukkMXZt9RWdl+2zgGNx7Uda8NtmLJ06NL8jiHxUawbwC+hdSq1rrw/9CghCpEONor+l1e2gA==",
+      "version": "4.46.2",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.46.2.tgz",
+      "integrity": "sha512-t5B2loThlFEauloaQkZg9gxV05BYeITLvLkWOkRXogP4qHXLkWSbSHKM9S6H1schf/0YGP/qNKtiISlxvfmmZw==",
       "cpu": [
         "riscv64"
       ],
@@ -1471,9 +1442,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-s390x-gnu": {
-      "version": "4.40.1",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.40.1.tgz",
-      "integrity": "sha512-h8d28xzYb98fMQKUz0w2fMc1XuGzLLjdyxVIbhbil4ELfk5/orZlSTpF/xdI9C8K0I8lCkq+1En2RJsawZekkg==",
+      "version": "4.46.2",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.46.2.tgz",
+      "integrity": "sha512-YKjekwTEKgbB7n17gmODSmJVUIvj8CX7q5442/CK80L8nqOUbMtf8b01QkG3jOqyr1rotrAnW6B/qiHwfcuWQA==",
       "cpu": [
         "s390x"
       ],
@@ -1485,9 +1456,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-x64-gnu": {
-      "version": "4.40.1",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.40.1.tgz",
-      "integrity": "sha512-XiK5z70PEFEFqcNj3/zRSz/qX4bp4QIraTy9QjwJAb/Z8GM7kVUsD0Uk8maIPeTyPCP03ChdI+VVmJriKYbRHQ==",
+      "version": "4.46.2",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.46.2.tgz",
+      "integrity": "sha512-Jj5a9RUoe5ra+MEyERkDKLwTXVu6s3aACP51nkfnK9wJTraCC8IMe3snOfALkrjTYd2G1ViE1hICj0fZ7ALBPA==",
       "cpu": [
         "x64"
       ],
@@ -1499,9 +1470,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-x64-musl": {
-      "version": "4.40.1",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.40.1.tgz",
-      "integrity": "sha512-2BRORitq5rQ4Da9blVovzNCMaUlyKrzMSvkVR0D4qPuOy/+pMCrh1d7o01RATwVy+6Fa1WBw+da7QPeLWU/1mQ==",
+      "version": "4.46.2",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.46.2.tgz",
+      "integrity": "sha512-7kX69DIrBeD7yNp4A5b81izs8BqoZkCIaxQaOpumcJ1S/kmqNFjPhDu1LHeVXv0SexfHQv5cqHsxLOjETuqDuA==",
       "cpu": [
         "x64"
       ],
@@ -1513,9 +1484,9 @@
       ]
     },
     "node_modules/@rollup/rollup-win32-arm64-msvc": {
-      "version": "4.40.1",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.40.1.tgz",
-      "integrity": "sha512-b2bcNm9Kbde03H+q+Jjw9tSfhYkzrDUf2d5MAd1bOJuVplXvFhWz7tRtWvD8/ORZi7qSCy0idW6tf2HgxSXQSg==",
+      "version": "4.46.2",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.46.2.tgz",
+      "integrity": "sha512-wiJWMIpeaak/jsbaq2HMh/rzZxHVW1rU6coyeNNpMwk5isiPjSTx0a4YLSlYDwBH/WBvLz+EtsNqQScZTLJy3g==",
       "cpu": [
         "arm64"
       ],
@@ -1527,9 +1498,9 @@
       ]
     },
     "node_modules/@rollup/rollup-win32-ia32-msvc": {
-      "version": "4.40.1",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.40.1.tgz",
-      "integrity": "sha512-DfcogW8N7Zg7llVEfpqWMZcaErKfsj9VvmfSyRjCyo4BI3wPEfrzTtJkZG6gKP/Z92wFm6rz2aDO7/JfiR/whA==",
+      "version": "4.46.2",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.46.2.tgz",
+      "integrity": "sha512-gBgaUDESVzMgWZhcyjfs9QFK16D8K6QZpwAaVNJxYDLHWayOta4ZMjGm/vsAEy3hvlS2GosVFlBlP9/Wb85DqQ==",
       "cpu": [
         "ia32"
       ],
@@ -1541,9 +1512,9 @@
       ]
     },
     "node_modules/@rollup/rollup-win32-x64-msvc": {
-      "version": "4.40.1",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.40.1.tgz",
-      "integrity": "sha512-ECyOuDeH3C1I8jH2MK1RtBJW+YPMvSfT0a5NN0nHfQYnDSJ6tUiZH3gzwVP5/Kfh/+Tt7tpWVF9LXNTnhTJ3kA==",
+      "version": "4.46.2",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.46.2.tgz",
+      "integrity": "sha512-CvUo2ixeIQGtF6WvuB87XWqPQkoFAFqW+HUo/WzHwuHDvIwZCtjdWXoYCcr06iKGydiqTclC4jU/TNObC/xKZg==",
       "cpu": [
         "x64"
       ],
@@ -1555,9 +1526,9 @@
       ]
     },
     "node_modules/@tauri-apps/api": {
-      "version": "2.5.0",
-      "resolved": "https://registry.npmjs.org/@tauri-apps/api/-/api-2.5.0.tgz",
-      "integrity": "sha512-Ldux4ip+HGAcPUmuLT8EIkk6yafl5vK0P0c0byzAKzxJh7vxelVtdPONjfgTm96PbN24yjZNESY8CKo8qniluA==",
+      "version": "2.8.0",
+      "resolved": "https://registry.npmjs.org/@tauri-apps/api/-/api-2.8.0.tgz",
+      "integrity": "sha512-ga7zdhbS2GXOMTIZRT0mYjKJtR9fivsXzsyq5U3vjDL0s6DTMwYRm0UHNjzTY5dh4+LSC68Sm/7WEiimbQNYlw==",
       "license": "Apache-2.0 OR MIT",
       "funding": {
         "type": "opencollective",
@@ -1565,9 +1536,9 @@
       }
     },
     "node_modules/@tauri-apps/cli": {
-      "version": "2.5.0",
-      "resolved": "https://registry.npmjs.org/@tauri-apps/cli/-/cli-2.5.0.tgz",
-      "integrity": "sha512-rAtHqG0Gh/IWLjN2zTf3nZqYqbo81oMbqop56rGTjrlWk9pTTAjkqOjSL9XQLIMZ3RbeVjveCqqCA0s8RnLdMg==",
+      "version": "2.8.4",
+      "resolved": "https://registry.npmjs.org/@tauri-apps/cli/-/cli-2.8.4.tgz",
+      "integrity": "sha512-ejUZBzuQRcjFV+v/gdj/DcbyX/6T4unZQjMSBZwLzP/CymEjKcc2+Fc8xTORThebHDUvqoXMdsCZt8r+hyN15g==",
       "dev": true,
       "license": "Apache-2.0 OR MIT",
       "bin": {
@@ -1581,23 +1552,23 @@
         "url": "https://opencollective.com/tauri"
       },
       "optionalDependencies": {
-        "@tauri-apps/cli-darwin-arm64": "2.5.0",
-        "@tauri-apps/cli-darwin-x64": "2.5.0",
-        "@tauri-apps/cli-linux-arm-gnueabihf": "2.5.0",
-        "@tauri-apps/cli-linux-arm64-gnu": "2.5.0",
-        "@tauri-apps/cli-linux-arm64-musl": "2.5.0",
-        "@tauri-apps/cli-linux-riscv64-gnu": "2.5.0",
-        "@tauri-apps/cli-linux-x64-gnu": "2.5.0",
-        "@tauri-apps/cli-linux-x64-musl": "2.5.0",
-        "@tauri-apps/cli-win32-arm64-msvc": "2.5.0",
-        "@tauri-apps/cli-win32-ia32-msvc": "2.5.0",
-        "@tauri-apps/cli-win32-x64-msvc": "2.5.0"
+        "@tauri-apps/cli-darwin-arm64": "2.8.4",
+        "@tauri-apps/cli-darwin-x64": "2.8.4",
+        "@tauri-apps/cli-linux-arm-gnueabihf": "2.8.4",
+        "@tauri-apps/cli-linux-arm64-gnu": "2.8.4",
+        "@tauri-apps/cli-linux-arm64-musl": "2.8.4",
+        "@tauri-apps/cli-linux-riscv64-gnu": "2.8.4",
+        "@tauri-apps/cli-linux-x64-gnu": "2.8.4",
+        "@tauri-apps/cli-linux-x64-musl": "2.8.4",
+        "@tauri-apps/cli-win32-arm64-msvc": "2.8.4",
+        "@tauri-apps/cli-win32-ia32-msvc": "2.8.4",
+        "@tauri-apps/cli-win32-x64-msvc": "2.8.4"
       }
     },
     "node_modules/@tauri-apps/cli-darwin-arm64": {
-      "version": "2.5.0",
-      "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-2.5.0.tgz",
-      "integrity": "sha512-VuVAeTFq86dfpoBDNYAdtQVLbP0+2EKCHIIhkaxjeoPARR0sLpFHz2zs0PcFU76e+KAaxtEtAJAXGNUc8E1PzQ==",
+      "version": "2.8.4",
+      "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-2.8.4.tgz",
+      "integrity": "sha512-BKu8HRkYV01SMTa7r4fLx+wjgtRK8Vep7lmBdHDioP6b8XH3q2KgsAyPWfEZaZIkZ2LY4SqqGARaE9oilNe0oA==",
       "cpu": [
         "arm64"
       ],
@@ -1612,9 +1583,9 @@
       }
     },
     "node_modules/@tauri-apps/cli-darwin-x64": {
-      "version": "2.5.0",
-      "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-2.5.0.tgz",
-      "integrity": "sha512-hUF01sC06cZVa8+I0/VtsHOk9BbO75rd+YdtHJ48xTdcYaQ5QIwL4yZz9OR1AKBTaUYhBam8UX9Pvd5V2/4Dpw==",
+      "version": "2.8.4",
+      "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-2.8.4.tgz",
+      "integrity": "sha512-imb9PfSd/7G6VAO7v1bQ2A3ZH4NOCbhGJFLchxzepGcXf9NKkfun157JH9mko29K6sqAwuJ88qtzbKCbWJTH9g==",
       "cpu": [
         "x64"
       ],
@@ -1629,9 +1600,9 @@
       }
     },
     "node_modules/@tauri-apps/cli-linux-arm-gnueabihf": {
-      "version": "2.5.0",
-      "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-2.5.0.tgz",
-      "integrity": "sha512-LQKqttsK252LlqYyX8R02MinUsfFcy3+NZiJwHFgi5Y3+ZUIAED9cSxJkyNtuY5KMnR4RlpgWyLv4P6akN1xhg==",
+      "version": "2.8.4",
+      "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-2.8.4.tgz",
+      "integrity": "sha512-Ml215UnDdl7/fpOrF1CNovym/KjtUbCuPgrcZ4IhqUCnhZdXuphud/JT3E8X97Y03TZ40Sjz8raXYI2ET0exzw==",
       "cpu": [
         "arm"
       ],
@@ -1646,9 +1617,9 @@
       }
     },
     "node_modules/@tauri-apps/cli-linux-arm64-gnu": {
-      "version": "2.5.0",
-      "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-2.5.0.tgz",
-      "integrity": "sha512-mTQufsPcpdHg5RW0zypazMo4L55EfeE5snTzrPqbLX4yCK2qalN7+rnP8O8GT06xhp6ElSP/Ku1M2MR297SByQ==",
+      "version": "2.8.4",
+      "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-2.8.4.tgz",
+      "integrity": "sha512-pbcgBpMyI90C83CxE5REZ9ODyIlmmAPkkJXtV398X3SgZEIYy5TACYqlyyv2z5yKgD8F8WH4/2fek7+jH+ZXAw==",
       "cpu": [
         "arm64"
       ],
@@ -1663,9 +1634,9 @@
       }
     },
     "node_modules/@tauri-apps/cli-linux-arm64-musl": {
-      "version": "2.5.0",
-      "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.5.0.tgz",
-      "integrity": "sha512-rQO1HhRUQqyEaal5dUVOQruTRda/TD36s9kv1hTxZiFuSq3558lsTjAcUEnMAtBcBkps20sbyTJNMT0AwYIk8Q==",
+      "version": "2.8.4",
+      "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.8.4.tgz",
+      "integrity": "sha512-zumFeaU1Ws5Ay872FTyIm7z8kfzEHu8NcIn8M6TxbJs0a7GRV21KBdpW1zNj2qy7HynnpQCqjAYXTUUmm9JAOw==",
       "cpu": [
         "arm64"
       ],
@@ -1680,9 +1651,9 @@
       }
     },
     "node_modules/@tauri-apps/cli-linux-riscv64-gnu": {
-      "version": "2.5.0",
-      "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-riscv64-gnu/-/cli-linux-riscv64-gnu-2.5.0.tgz",
-      "integrity": "sha512-7oS18FN46yDxyw1zX/AxhLAd7T3GrLj3Ai6s8hZKd9qFVzrAn36ESL7d3G05s8wEtsJf26qjXnVF4qleS3dYsA==",
+      "version": "2.8.4",
+      "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-riscv64-gnu/-/cli-linux-riscv64-gnu-2.8.4.tgz",
+      "integrity": "sha512-qiqbB3Zz6IyO201f+1ojxLj65WYj8mixL5cOMo63nlg8CIzsP23cPYUrx1YaDPsCLszKZo7tVs14pc7BWf+/aQ==",
       "cpu": [
         "riscv64"
       ],
@@ -1697,9 +1668,9 @@
       }
     },
     "node_modules/@tauri-apps/cli-linux-x64-gnu": {
-      "version": "2.5.0",
-      "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-2.5.0.tgz",
-      "integrity": "sha512-SG5sFNL7VMmDBdIg3nO3EzNRT306HsiEQ0N90ILe3ZABYAVoPDO/ttpCO37ApLInTzrq/DLN+gOlC/mgZvLw1w==",
+      "version": "2.8.4",
+      "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-2.8.4.tgz",
+      "integrity": "sha512-TaqaDd9Oy6k45Hotx3pOf+pkbsxLaApv4rGd9mLuRM1k6YS/aw81YrsMryYPThrxrScEIUcmNIHaHsLiU4GMkw==",
       "cpu": [
         "x64"
       ],
@@ -1714,9 +1685,9 @@
       }
     },
     "node_modules/@tauri-apps/cli-linux-x64-musl": {
-      "version": "2.5.0",
-      "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-2.5.0.tgz",
-      "integrity": "sha512-QXDM8zp/6v05PNWju5ELsVwF0VH1n6b5pk2E6W/jFbbiwz80Vs1lACl9pv5kEHkrxBj+aWU/03JzGuIj2g3SkQ==",
+      "version": "2.8.4",
+      "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-2.8.4.tgz",
+      "integrity": "sha512-ot9STAwyezN8w+bBHZ+bqSQIJ0qPZFlz/AyscpGqB/JnJQVDFQcRDmUPFEaAtt2UUHSWzN3GoTJ5ypqLBp2WQA==",
       "cpu": [
         "x64"
       ],
@@ -1731,9 +1702,9 @@
       }
     },
     "node_modules/@tauri-apps/cli-win32-arm64-msvc": {
-      "version": "2.5.0",
-      "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-arm64-msvc/-/cli-win32-arm64-msvc-2.5.0.tgz",
-      "integrity": "sha512-pFSHFK6b+o9y4Un8w0gGLwVyFTZaC3P0kQ7umRt/BLDkzD5RnQ4vBM7CF8BCU5nkwmEBUCZd7Wt3TWZxe41o6Q==",
+      "version": "2.8.4",
+      "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-arm64-msvc/-/cli-win32-arm64-msvc-2.8.4.tgz",
+      "integrity": "sha512-+2aJ/g90dhLiOLFSD1PbElXX3SoMdpO7HFPAZB+xot3CWlAZD1tReUFy7xe0L5GAR16ZmrxpIDM9v9gn5xRy/w==",
       "cpu": [
         "arm64"
       ],
@@ -1748,9 +1719,9 @@
       }
     },
     "node_modules/@tauri-apps/cli-win32-ia32-msvc": {
-      "version": "2.5.0",
-      "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-2.5.0.tgz",
-      "integrity": "sha512-EArv1IaRlogdLAQyGlKmEqZqm5RfHCUMhJoedWu7GtdbOMUfSAz6FMX2boE1PtEmNO4An+g188flLeVErrxEKg==",
+      "version": "2.8.4",
+      "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-2.8.4.tgz",
+      "integrity": "sha512-yj7WDxkL1t9Uzr2gufQ1Hl7hrHuFKTNEOyascbc109EoiAqCp0tgZ2IykQqOZmZOHU884UAWI1pVMqBhS/BfhA==",
       "cpu": [
         "ia32"
       ],
@@ -1765,9 +1736,9 @@
       }
     },
     "node_modules/@tauri-apps/cli-win32-x64-msvc": {
-      "version": "2.5.0",
-      "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-2.5.0.tgz",
-      "integrity": "sha512-lj43EFYbnAta8pd9JnUq87o+xRUR0odz+4rixBtTUwUgdRdwQ2V9CzFtsMu6FQKpFQ6mujRK6P1IEwhL6ADRsQ==",
+      "version": "2.8.4",
+      "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-2.8.4.tgz",
+      "integrity": "sha512-XuvGB4ehBdd7QhMZ9qbj/8icGEatDuBNxyYHbLKsTYh90ggUlPa/AtaqcC1Fo69lGkTmq9BOKrs1aWSi7xDonA==",
       "cpu": [
         "x64"
       ],
@@ -1782,39 +1753,39 @@
       }
     },
     "node_modules/@tauri-apps/plugin-cli": {
-      "version": "2.2.0",
-      "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-cli/-/plugin-cli-2.2.0.tgz",
-      "integrity": "sha512-rvNhMog9rHr01Xk+trBFKJ0eZICIvPkm9GX6ogB89/0hROU/lf+a/sb4vC0wtSeR7zrJuCSxwxYuvHCZheaYFA==",
+      "version": "2.4.0",
+      "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-cli/-/plugin-cli-2.4.0.tgz",
+      "integrity": "sha512-3AUUaaqj3PkacFlErFUvzaApV6uZG5W8psM5AKWoPNkThwJJZskc9wqfot7PTY13fVublGszFWBNAL4I4iIZRg==",
       "license": "MIT OR Apache-2.0",
       "dependencies": {
-        "@tauri-apps/api": "^2.0.0"
+        "@tauri-apps/api": "^2.6.0"
       }
     },
     "node_modules/@tauri-apps/plugin-fs": {
-      "version": "2.2.1",
-      "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-fs/-/plugin-fs-2.2.1.tgz",
-      "integrity": "sha512-KdGzvvA4Eg0Dhw55MwczFbjxLxsTx0FvwwC/0StXlr6IxwPUxh5ziZQoaugkBFs8t+wfebdQrjBEzd8NmmDXNw==",
+      "version": "2.4.2",
+      "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-fs/-/plugin-fs-2.4.2.tgz",
+      "integrity": "sha512-YGhmYuTgXGsi6AjoV+5mh2NvicgWBfVJHHheuck6oHD+HC9bVWPaHvCP0/Aw4pHDejwrvT8hE3+zZAaWf+hrig==",
       "license": "MIT OR Apache-2.0",
       "dependencies": {
-        "@tauri-apps/api": "^2.0.0"
+        "@tauri-apps/api": "^2.8.0"
       }
     },
     "node_modules/@tauri-apps/plugin-opener": {
-      "version": "2.2.6",
-      "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-opener/-/plugin-opener-2.2.6.tgz",
-      "integrity": "sha512-bSdkuP71ZQRepPOn8BOEdBKYJQvl6+jb160QtJX/i2H9BF6ZySY/kYljh76N2Ne5fJMQRge7rlKoStYQY5Jq1w==",
+      "version": "2.5.0",
+      "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-opener/-/plugin-opener-2.5.0.tgz",
+      "integrity": "sha512-B0LShOYae4CZjN8leiNDbnfjSrTwoZakqKaWpfoH6nXiJwt6Rgj6RnVIffG3DoJiKsffRhMkjmBV9VeilSb4TA==",
       "license": "MIT OR Apache-2.0",
       "dependencies": {
-        "@tauri-apps/api": "^2.0.0"
+        "@tauri-apps/api": "^2.8.0"
       }
     },
     "node_modules/@tauri-apps/plugin-window-state": {
-      "version": "2.2.2",
-      "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-window-state/-/plugin-window-state-2.2.2.tgz",
-      "integrity": "sha512-7pFwmMtGhhhE/WgmM7PUrj0BSSWVAQMfDdYbRalphIqqF1tWBvxtlxclx8bTutpXHLJTQoCpIeWtBEIXsoAlGw==",
+      "version": "2.4.0",
+      "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-window-state/-/plugin-window-state-2.4.0.tgz",
+      "integrity": "sha512-hRSzPNi2NG0lPFthfVY0V5C1MyWN/gGaQtQYw7i9zZhLzrhZveHZ2omHG1rIiIsjfTGbO7fhjydSoeTTK9GqLw==",
       "license": "MIT OR Apache-2.0",
       "dependencies": {
-        "@tauri-apps/api": "^2.0.0"
+        "@tauri-apps/api": "^2.6.0"
       }
     },
     "node_modules/@types/babel__core": {
@@ -1872,9 +1843,9 @@
       }
     },
     "node_modules/@types/estree": {
-      "version": "1.0.7",
-      "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz",
-      "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==",
+      "version": "1.0.8",
+      "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz",
+      "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==",
       "license": "MIT"
     },
     "node_modules/@types/estree-jsx": {
@@ -1925,39 +1896,32 @@
       "license": "MIT"
     },
     "node_modules/@types/node": {
-      "version": "22.12.0",
-      "resolved": "https://registry.npmjs.org/@types/node/-/node-22.12.0.tgz",
-      "integrity": "sha512-Fll2FZ1riMjNmlmJOdAyY5pUbkftXslB5DgEzlIuNaiWhXd00FhWxVC/r4yV/4wBb9JfImTu+jiSvXTkJ7F/gA==",
+      "version": "22.18.6",
+      "resolved": "https://registry.npmjs.org/@types/node/-/node-22.18.6.tgz",
+      "integrity": "sha512-r8uszLPpeIWbNKtvWRt/DbVi5zbqZyj1PTmhRMqBMvDnaz1QpmSKujUtJLrqGZeoM8v72MfYggDceY4K1itzWQ==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "undici-types": "~6.20.0"
+        "undici-types": "~6.21.0"
       }
     },
-    "node_modules/@types/prop-types": {
-      "version": "15.7.14",
-      "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.14.tgz",
-      "integrity": "sha512-gNMvNH49DJ7OJYv+KAKn0Xp45p8PLl6zo2YnvDIbTd4J6MER2BmWN49TG7n9LvkyihINxeKW8+3bfS2yDC9dzQ==",
-      "license": "MIT"
-    },
     "node_modules/@types/react": {
-      "version": "18.3.20",
-      "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.20.tgz",
-      "integrity": "sha512-IPaCZN7PShZK/3t6Q87pfTkRm6oLTd4vztyoj+cbHUF1g3FfVb2tFIL79uCRKEfv16AhqDMBywP2VW3KIZUvcg==",
+      "version": "19.1.13",
+      "resolved": "https://registry.npmjs.org/@types/react/-/react-19.1.13.tgz",
+      "integrity": "sha512-hHkbU/eoO3EG5/MZkuFSKmYqPbSVk5byPFa3e7y/8TybHiLMACgI8seVYlicwk7H5K/rI2px9xrQp/C+AUDTiQ==",
       "license": "MIT",
       "dependencies": {
-        "@types/prop-types": "*",
         "csstype": "^3.0.2"
       }
     },
     "node_modules/@types/react-dom": {
-      "version": "18.3.7",
-      "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.7.tgz",
-      "integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==",
+      "version": "19.1.9",
+      "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.1.9.tgz",
+      "integrity": "sha512-qXRuZaOsAdXKFyOhRBg6Lqqc0yay13vN7KrIg4L7N4aaHN68ma9OK3NE1BoDFgFOTfM7zg+3/8+2n8rLUH3OKQ==",
       "dev": true,
       "license": "MIT",
       "peerDependencies": {
-        "@types/react": "^18.0.0"
+        "@types/react": "^19.0.0"
       }
     },
     "node_modules/@types/react-syntax-highlighter": {
@@ -1977,21 +1941,21 @@
       "license": "MIT"
     },
     "node_modules/@typescript-eslint/eslint-plugin": {
-      "version": "8.31.1",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.31.1.tgz",
-      "integrity": "sha512-oUlH4h1ABavI4F0Xnl8/fOtML/eu8nI2A1nYd+f+55XI0BLu+RIqKoCiZKNo6DtqZBEQm5aNKA20G3Z5w3R6GQ==",
+      "version": "8.44.0",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.44.0.tgz",
+      "integrity": "sha512-EGDAOGX+uwwekcS0iyxVDmRV9HX6FLSM5kzrAToLTsr9OWCIKG/y3lQheCq18yZ5Xh78rRKJiEpP0ZaCs4ryOQ==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
         "@eslint-community/regexpp": "^4.10.0",
-        "@typescript-eslint/scope-manager": "8.31.1",
-        "@typescript-eslint/type-utils": "8.31.1",
-        "@typescript-eslint/utils": "8.31.1",
-        "@typescript-eslint/visitor-keys": "8.31.1",
+        "@typescript-eslint/scope-manager": "8.44.0",
+        "@typescript-eslint/type-utils": "8.44.0",
+        "@typescript-eslint/utils": "8.44.0",
+        "@typescript-eslint/visitor-keys": "8.44.0",
         "graphemer": "^1.4.0",
-        "ignore": "^5.3.1",
+        "ignore": "^7.0.0",
         "natural-compare": "^1.4.0",
-        "ts-api-utils": "^2.0.1"
+        "ts-api-utils": "^2.1.0"
       },
       "engines": {
         "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -2001,22 +1965,32 @@
         "url": "https://opencollective.com/typescript-eslint"
       },
       "peerDependencies": {
-        "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0",
+        "@typescript-eslint/parser": "^8.44.0",
         "eslint": "^8.57.0 || ^9.0.0",
-        "typescript": ">=4.8.4 <5.9.0"
+        "typescript": ">=4.8.4 <6.0.0"
+      }
+    },
+    "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": {
+      "version": "7.0.5",
+      "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz",
+      "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">= 4"
       }
     },
     "node_modules/@typescript-eslint/parser": {
-      "version": "8.31.1",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.31.1.tgz",
-      "integrity": "sha512-oU/OtYVydhXnumd0BobL9rkJg7wFJ9bFFPmSmB/bf/XWN85hlViji59ko6bSKBXyseT9V8l+CN1nwmlbiN0G7Q==",
+      "version": "8.44.0",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.44.0.tgz",
+      "integrity": "sha512-VGMpFQGUQWYT9LfnPcX8ouFojyrZ/2w3K5BucvxL/spdNehccKhB4jUyB1yBCXpr2XFm0jkECxgrpXBW2ipoAw==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "@typescript-eslint/scope-manager": "8.31.1",
-        "@typescript-eslint/types": "8.31.1",
-        "@typescript-eslint/typescript-estree": "8.31.1",
-        "@typescript-eslint/visitor-keys": "8.31.1",
+        "@typescript-eslint/scope-manager": "8.44.0",
+        "@typescript-eslint/types": "8.44.0",
+        "@typescript-eslint/typescript-estree": "8.44.0",
+        "@typescript-eslint/visitor-keys": "8.44.0",
         "debug": "^4.3.4"
       },
       "engines": {
@@ -2028,18 +2002,40 @@
       },
       "peerDependencies": {
         "eslint": "^8.57.0 || ^9.0.0",
-        "typescript": ">=4.8.4 <5.9.0"
+        "typescript": ">=4.8.4 <6.0.0"
+      }
+    },
+    "node_modules/@typescript-eslint/project-service": {
+      "version": "8.44.0",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.44.0.tgz",
+      "integrity": "sha512-ZeaGNraRsq10GuEohKTo4295Z/SuGcSq2LzfGlqiuEvfArzo/VRrT0ZaJsVPuKZ55lVbNk8U6FcL+ZMH8CoyVA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "@typescript-eslint/tsconfig-utils": "^8.44.0",
+        "@typescript-eslint/types": "^8.44.0",
+        "debug": "^4.3.4"
+      },
+      "engines": {
+        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/typescript-eslint"
+      },
+      "peerDependencies": {
+        "typescript": ">=4.8.4 <6.0.0"
       }
     },
     "node_modules/@typescript-eslint/scope-manager": {
-      "version": "8.31.1",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.31.1.tgz",
-      "integrity": "sha512-BMNLOElPxrtNQMIsFHE+3P0Yf1z0dJqV9zLdDxN/xLlWMlXK/ApEsVEKzpizg9oal8bAT5Sc7+ocal7AC1HCVw==",
+      "version": "8.44.0",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.44.0.tgz",
+      "integrity": "sha512-87Jv3E+al8wpD+rIdVJm/ItDBe/Im09zXIjFoipOjr5gHUhJmTzfFLuTJ/nPTMc2Srsroy4IBXwcTCHyRR7KzA==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "@typescript-eslint/types": "8.31.1",
-        "@typescript-eslint/visitor-keys": "8.31.1"
+        "@typescript-eslint/types": "8.44.0",
+        "@typescript-eslint/visitor-keys": "8.44.0"
       },
       "engines": {
         "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -2049,17 +2045,35 @@
         "url": "https://opencollective.com/typescript-eslint"
       }
     },
+    "node_modules/@typescript-eslint/tsconfig-utils": {
+      "version": "8.44.0",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.44.0.tgz",
+      "integrity": "sha512-x5Y0+AuEPqAInc6yd0n5DAcvtoQ/vyaGwuX5HE9n6qAefk1GaedqrLQF8kQGylLUb9pnZyLf+iEiL9fr8APDtQ==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/typescript-eslint"
+      },
+      "peerDependencies": {
+        "typescript": ">=4.8.4 <6.0.0"
+      }
+    },
     "node_modules/@typescript-eslint/type-utils": {
-      "version": "8.31.1",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.31.1.tgz",
-      "integrity": "sha512-fNaT/m9n0+dpSp8G/iOQ05GoHYXbxw81x+yvr7TArTuZuCA6VVKbqWYVZrV5dVagpDTtj/O8k5HBEE/p/HM5LA==",
+      "version": "8.44.0",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.44.0.tgz",
+      "integrity": "sha512-9cwsoSxJ8Sak67Be/hD2RNt/fsqmWnNE1iHohG8lxqLSNY8xNfyY7wloo5zpW3Nu9hxVgURevqfcH6vvKCt6yg==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "@typescript-eslint/typescript-estree": "8.31.1",
-        "@typescript-eslint/utils": "8.31.1",
+        "@typescript-eslint/types": "8.44.0",
+        "@typescript-eslint/typescript-estree": "8.44.0",
+        "@typescript-eslint/utils": "8.44.0",
         "debug": "^4.3.4",
-        "ts-api-utils": "^2.0.1"
+        "ts-api-utils": "^2.1.0"
       },
       "engines": {
         "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -2070,13 +2084,13 @@
       },
       "peerDependencies": {
         "eslint": "^8.57.0 || ^9.0.0",
-        "typescript": ">=4.8.4 <5.9.0"
+        "typescript": ">=4.8.4 <6.0.0"
       }
     },
     "node_modules/@typescript-eslint/types": {
-      "version": "8.31.1",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.31.1.tgz",
-      "integrity": "sha512-SfepaEFUDQYRoA70DD9GtytljBePSj17qPxFHA/h3eg6lPTqGJ5mWOtbXCk1YrVU1cTJRd14nhaXWFu0l2troQ==",
+      "version": "8.44.0",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.44.0.tgz",
+      "integrity": "sha512-ZSl2efn44VsYM0MfDQe68RKzBz75NPgLQXuGypmym6QVOWL5kegTZuZ02xRAT9T+onqvM6T8CdQk0OwYMB6ZvA==",
       "dev": true,
       "license": "MIT",
       "engines": {
@@ -2088,20 +2102,22 @@
       }
     },
     "node_modules/@typescript-eslint/typescript-estree": {
-      "version": "8.31.1",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.31.1.tgz",
-      "integrity": "sha512-kaA0ueLe2v7KunYOyWYtlf/QhhZb7+qh4Yw6Ni5kgukMIG+iP773tjgBiLWIXYumWCwEq3nLW+TUywEp8uEeag==",
+      "version": "8.44.0",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.44.0.tgz",
+      "integrity": "sha512-lqNj6SgnGcQZwL4/SBJ3xdPEfcBuhCG8zdcwCPgYcmiPLgokiNDKlbPzCwEwu7m279J/lBYWtDYL+87OEfn8Jw==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "@typescript-eslint/types": "8.31.1",
-        "@typescript-eslint/visitor-keys": "8.31.1",
+        "@typescript-eslint/project-service": "8.44.0",
+        "@typescript-eslint/tsconfig-utils": "8.44.0",
+        "@typescript-eslint/types": "8.44.0",
+        "@typescript-eslint/visitor-keys": "8.44.0",
         "debug": "^4.3.4",
         "fast-glob": "^3.3.2",
         "is-glob": "^4.0.3",
         "minimatch": "^9.0.4",
         "semver": "^7.6.0",
-        "ts-api-utils": "^2.0.1"
+        "ts-api-utils": "^2.1.0"
       },
       "engines": {
         "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -2111,13 +2127,13 @@
         "url": "https://opencollective.com/typescript-eslint"
       },
       "peerDependencies": {
-        "typescript": ">=4.8.4 <5.9.0"
+        "typescript": ">=4.8.4 <6.0.0"
       }
     },
     "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
-      "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
+      "version": "2.0.2",
+      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
+      "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
@@ -2141,9 +2157,9 @@
       }
     },
     "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": {
-      "version": "7.7.1",
-      "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz",
-      "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==",
+      "version": "7.7.2",
+      "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz",
+      "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==",
       "dev": true,
       "license": "ISC",
       "bin": {
@@ -2154,16 +2170,16 @@
       }
     },
     "node_modules/@typescript-eslint/utils": {
-      "version": "8.31.1",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.31.1.tgz",
-      "integrity": "sha512-2DSI4SNfF5T4oRveQ4nUrSjUqjMND0nLq9rEkz0gfGr3tg0S5KB6DhwR+WZPCjzkZl3cH+4x2ce3EsL50FubjQ==",
+      "version": "8.44.0",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.44.0.tgz",
+      "integrity": "sha512-nktOlVcg3ALo0mYlV+L7sWUD58KG4CMj1rb2HUVOO4aL3K/6wcD+NERqd0rrA5Vg06b42YhF6cFxeixsp9Riqg==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "@eslint-community/eslint-utils": "^4.4.0",
-        "@typescript-eslint/scope-manager": "8.31.1",
-        "@typescript-eslint/types": "8.31.1",
-        "@typescript-eslint/typescript-estree": "8.31.1"
+        "@eslint-community/eslint-utils": "^4.7.0",
+        "@typescript-eslint/scope-manager": "8.44.0",
+        "@typescript-eslint/types": "8.44.0",
+        "@typescript-eslint/typescript-estree": "8.44.0"
       },
       "engines": {
         "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -2174,18 +2190,18 @@
       },
       "peerDependencies": {
         "eslint": "^8.57.0 || ^9.0.0",
-        "typescript": ">=4.8.4 <5.9.0"
+        "typescript": ">=4.8.4 <6.0.0"
       }
     },
     "node_modules/@typescript-eslint/visitor-keys": {
-      "version": "8.31.1",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.31.1.tgz",
-      "integrity": "sha512-I+/rgqOVBn6f0o7NDTmAPWWC6NuqhV174lfYvAm9fUaWeiefLdux9/YI3/nLugEn9L8fcSi0XmpKi/r5u0nmpw==",
+      "version": "8.44.0",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.44.0.tgz",
+      "integrity": "sha512-zaz9u8EJ4GBmnehlrpoKvj/E3dNbuQ7q0ucyZImm3cLqJ8INTc970B1qEqDX/Rzq65r3TvVTN7kHWPBoyW7DWw==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "@typescript-eslint/types": "8.31.1",
-        "eslint-visitor-keys": "^4.2.0"
+        "@typescript-eslint/types": "8.44.0",
+        "eslint-visitor-keys": "^4.2.1"
       },
       "engines": {
         "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -2202,23 +2218,24 @@
       "license": "ISC"
     },
     "node_modules/@vitejs/plugin-react": {
-      "version": "4.4.1",
-      "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.4.1.tgz",
-      "integrity": "sha512-IpEm5ZmeXAP/osiBXVVP5KjFMzbWOonMs0NaQQl+xYnUAcq4oHUBsF2+p4MgKWG4YMmFYJU8A6sxRPuowllm6w==",
+      "version": "5.0.3",
+      "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-5.0.3.tgz",
+      "integrity": "sha512-PFVHhosKkofGH0Yzrw1BipSedTH68BFF8ZWy1kfUpCtJcouXXY0+racG8sExw7hw0HoX36813ga5o3LTWZ4FUg==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "@babel/core": "^7.26.10",
-        "@babel/plugin-transform-react-jsx-self": "^7.25.9",
-        "@babel/plugin-transform-react-jsx-source": "^7.25.9",
+        "@babel/core": "^7.28.4",
+        "@babel/plugin-transform-react-jsx-self": "^7.27.1",
+        "@babel/plugin-transform-react-jsx-source": "^7.27.1",
+        "@rolldown/pluginutils": "1.0.0-beta.35",
         "@types/babel__core": "^7.20.5",
         "react-refresh": "^0.17.0"
       },
       "engines": {
-        "node": "^14.18.0 || >=16.0.0"
+        "node": "^20.19.0 || >=22.12.0"
       },
       "peerDependencies": {
-        "vite": "^4.2.0 || ^5.0.0 || ^6.0.0"
+        "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"
       }
     },
     "node_modules/@wooorm/starry-night": {
@@ -2264,24 +2281,10 @@
       "integrity": "sha512-hqJHYaQb5OptNunnyAnkHyM8aCjZ1MEIDTQu1iIbbTD/xops91NB5yq1ZK/dC2JDbVWtF23zUtl9JE2NqwT87A==",
       "license": "MIT"
     },
-    "node_modules/accepts": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz",
-      "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "mime-types": "^3.0.0",
-        "negotiator": "^1.0.0"
-      },
-      "engines": {
-        "node": ">= 0.6"
-      }
-    },
     "node_modules/acorn": {
-      "version": "8.14.1",
-      "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz",
-      "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==",
+      "version": "8.15.0",
+      "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz",
+      "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
       "dev": true,
       "license": "MIT",
       "bin": {
@@ -2384,27 +2387,6 @@
       "dev": true,
       "license": "MIT"
     },
-    "node_modules/body-parser": {
-      "version": "2.2.0",
-      "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.0.tgz",
-      "integrity": "sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "bytes": "^3.1.2",
-        "content-type": "^1.0.5",
-        "debug": "^4.4.0",
-        "http-errors": "^2.0.0",
-        "iconv-lite": "^0.6.3",
-        "on-finished": "^2.4.1",
-        "qs": "^6.14.0",
-        "raw-body": "^3.0.0",
-        "type-is": "^2.0.0"
-      },
-      "engines": {
-        "node": ">=18"
-      }
-    },
     "node_modules/boolbase": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
@@ -2437,9 +2419,9 @@
       }
     },
     "node_modules/browserslist": {
-      "version": "4.24.5",
-      "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.5.tgz",
-      "integrity": "sha512-FDToo4Wo82hIdgc1CQ+NQD0hEhmpPjrZ3hiUgwgOG6IuTdlpr8jdjyG24P6cNP1yJpTLzS5OcGgSw0xmDU1/Tw==",
+      "version": "4.25.1",
+      "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.25.1.tgz",
+      "integrity": "sha512-KGj0KoOMXLpSNkkEI6Z6mShmQy0bc1I+T7K9N81k4WWMrfz+6fQ6es80B/YLAeRoKvjYE1YSHHOW1qe9xIVzHw==",
       "dev": true,
       "funding": [
         {
@@ -2457,8 +2439,8 @@
       ],
       "license": "MIT",
       "dependencies": {
-        "caniuse-lite": "^1.0.30001716",
-        "electron-to-chromium": "^1.5.149",
+        "caniuse-lite": "^1.0.30001726",
+        "electron-to-chromium": "^1.5.173",
         "node-releases": "^2.0.19",
         "update-browserslist-db": "^1.1.3"
       },
@@ -2476,47 +2458,6 @@
       "dev": true,
       "license": "MIT"
     },
-    "node_modules/bytes": {
-      "version": "3.1.2",
-      "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
-      "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.8"
-      }
-    },
-    "node_modules/call-bind-apply-helpers": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
-      "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "es-errors": "^1.3.0",
-        "function-bind": "^1.1.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/call-bound": {
-      "version": "1.0.4",
-      "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
-      "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bind-apply-helpers": "^1.0.2",
-        "get-intrinsic": "^1.3.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
     "node_modules/callsites": {
       "version": "3.1.0",
       "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
@@ -2539,9 +2480,9 @@
       }
     },
     "node_modules/caniuse-lite": {
-      "version": "1.0.30001716",
-      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001716.tgz",
-      "integrity": "sha512-49/c1+x3Kwz7ZIWt+4DvK3aMJy9oYXXG6/97JKsnjdCk/6n9vVyWL8NAwVt95Lwt9eigI10Hl782kDfZUUlRXw==",
+      "version": "1.0.30001727",
+      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001727.tgz",
+      "integrity": "sha512-pB68nIHmbN6L/4C6MH1DokyR3bYqFwjaSs/sWDHGj4CTcFtQUQMuJftVwWkXq7mNWOybD3KhUv3oWHoGxgP14Q==",
       "dev": true,
       "funding": [
         {
@@ -2722,19 +2663,18 @@
       "license": "MIT"
     },
     "node_modules/concurrently": {
-      "version": "9.1.2",
-      "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.1.2.tgz",
-      "integrity": "sha512-H9MWcoPsYddwbOGM6difjVwVZHl63nwMEwDJG/L7VGtuaJhb12h2caPG2tVPWs7emuYix252iGfqOyrz1GczTQ==",
+      "version": "9.2.1",
+      "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.2.1.tgz",
+      "integrity": "sha512-fsfrO0MxV64Znoy8/l1vVIjjHa29SZyyqPgQBwhiDcaW8wJc2W3XWVOGx4M3oJBnv/zdUZIIp1gDeS98GzP8Ng==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "chalk": "^4.1.2",
-        "lodash": "^4.17.21",
-        "rxjs": "^7.8.1",
-        "shell-quote": "^1.8.1",
-        "supports-color": "^8.1.1",
-        "tree-kill": "^1.2.2",
-        "yargs": "^17.7.2"
+        "chalk": "4.1.2",
+        "rxjs": "7.8.2",
+        "shell-quote": "1.8.3",
+        "supports-color": "8.1.1",
+        "tree-kill": "1.2.2",
+        "yargs": "17.7.2"
       },
       "bin": {
         "conc": "dist/bin/concurrently.js",
@@ -2764,29 +2704,6 @@
       "dev": true,
       "license": "MIT"
     },
-    "node_modules/content-disposition": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.0.tgz",
-      "integrity": "sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "safe-buffer": "5.2.1"
-      },
-      "engines": {
-        "node": ">= 0.6"
-      }
-    },
-    "node_modules/content-type": {
-      "version": "1.0.5",
-      "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
-      "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.6"
-      }
-    },
     "node_modules/convert-source-map": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",
@@ -2795,37 +2712,12 @@
       "license": "MIT"
     },
     "node_modules/cookie": {
-      "version": "0.7.2",
-      "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
-      "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.6"
-      }
-    },
-    "node_modules/cookie-signature": {
-      "version": "1.2.2",
-      "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz",
-      "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=6.6.0"
-      }
-    },
-    "node_modules/cors": {
-      "version": "2.8.5",
-      "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz",
-      "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==",
-      "dev": true,
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz",
+      "integrity": "sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==",
       "license": "MIT",
-      "dependencies": {
-        "object-assign": "^4",
-        "vary": "^1"
-      },
       "engines": {
-        "node": ">= 0.10"
+        "node": ">=18"
       }
     },
     "node_modules/cross-spawn": {
@@ -2916,16 +2808,6 @@
       "dev": true,
       "license": "MIT"
     },
-    "node_modules/depd": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
-      "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.8"
-      }
-    },
     "node_modules/dequal": {
       "version": "2.0.3",
       "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
@@ -3041,28 +2923,6 @@
         "node": ">=12"
       }
     },
-    "node_modules/dunder-proto": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
-      "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bind-apply-helpers": "^1.0.1",
-        "es-errors": "^1.3.0",
-        "gopd": "^1.2.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/ee-first": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
-      "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
-      "dev": true,
-      "license": "MIT"
-    },
     "node_modules/ejs": {
       "version": "3.1.10",
       "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz",
@@ -3080,9 +2940,9 @@
       }
     },
     "node_modules/electron-to-chromium": {
-      "version": "1.5.149",
-      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.149.tgz",
-      "integrity": "sha512-UyiO82eb9dVOx8YO3ajDf9jz2kKyt98DEITRdeLPstOEuTlLzDA4Gyq5K9he71TQziU5jUVu2OAu5N48HmQiyQ==",
+      "version": "1.5.180",
+      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.180.tgz",
+      "integrity": "sha512-ED+GEyEh3kYMwt2faNmgMB0b8O5qtATGgR4RmRsIp4T6p7B8vdMbIedYndnvZfsaXvSzegtpfqRMDNCjjiSduA==",
       "dev": true,
       "license": "ISC"
     },
@@ -3093,16 +2953,6 @@
       "dev": true,
       "license": "MIT"
     },
-    "node_modules/encodeurl": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
-      "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.8"
-      }
-    },
     "node_modules/entities": {
       "version": "2.2.0",
       "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz",
@@ -3113,49 +2963,16 @@
         "url": "https://github.com/fb55/entities?sponsor=1"
       }
     },
-    "node_modules/es-define-property": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
-      "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/es-errors": {
-      "version": "1.3.0",
-      "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
-      "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
+    "node_modules/esbuild": {
+      "version": "0.25.3",
+      "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.3.tgz",
+      "integrity": "sha512-qKA6Pvai73+M2FtftpNKRxJ78GIjmFXFxd/1DVBqGo/qNhLSfv+G12n9pNoWdytJC8U00TrViOwpjT0zgqQS8Q==",
       "dev": true,
+      "hasInstallScript": true,
       "license": "MIT",
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/es-object-atoms": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
-      "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "es-errors": "^1.3.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/esbuild": {
-      "version": "0.25.3",
-      "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.3.tgz",
-      "integrity": "sha512-qKA6Pvai73+M2FtftpNKRxJ78GIjmFXFxd/1DVBqGo/qNhLSfv+G12n9pNoWdytJC8U00TrViOwpjT0zgqQS8Q==",
-      "dev": true,
-      "hasInstallScript": true,
-      "license": "MIT",
-      "bin": {
-        "esbuild": "bin/esbuild"
-      },
+      "bin": {
+        "esbuild": "bin/esbuild"
+      },
       "engines": {
         "node": ">=18"
       },
@@ -3197,13 +3014,6 @@
         "node": ">=6"
       }
     },
-    "node_modules/escape-html": {
-      "version": "1.0.3",
-      "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
-      "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
-      "dev": true,
-      "license": "MIT"
-    },
     "node_modules/escape-string-regexp": {
       "version": "4.0.0",
       "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
@@ -3218,24 +3028,23 @@
       }
     },
     "node_modules/eslint": {
-      "version": "9.26.0",
-      "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.26.0.tgz",
-      "integrity": "sha512-Hx0MOjPh6uK9oq9nVsATZKE/Wlbai7KFjfCuw9UHaguDW3x+HF0O5nIi3ud39TWgrTjTO5nHxmL3R1eANinWHQ==",
+      "version": "9.35.0",
+      "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.35.0.tgz",
+      "integrity": "sha512-QePbBFMJFjgmlE+cXAlbHZbHpdFVS2E/6vzCy7aKlebddvl1vadiC4JFV5u/wqTkNUwEV8WrQi257jf5f06hrg==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "@eslint-community/eslint-utils": "^4.2.0",
+        "@eslint-community/eslint-utils": "^4.8.0",
         "@eslint-community/regexpp": "^4.12.1",
-        "@eslint/config-array": "^0.20.0",
-        "@eslint/config-helpers": "^0.2.1",
-        "@eslint/core": "^0.13.0",
+        "@eslint/config-array": "^0.21.0",
+        "@eslint/config-helpers": "^0.3.1",
+        "@eslint/core": "^0.15.2",
         "@eslint/eslintrc": "^3.3.1",
-        "@eslint/js": "9.26.0",
-        "@eslint/plugin-kit": "^0.2.8",
+        "@eslint/js": "9.35.0",
+        "@eslint/plugin-kit": "^0.3.5",
         "@humanfs/node": "^0.16.6",
         "@humanwhocodes/module-importer": "^1.0.1",
         "@humanwhocodes/retry": "^0.4.2",
-        "@modelcontextprotocol/sdk": "^1.8.0",
         "@types/estree": "^1.0.6",
         "@types/json-schema": "^7.0.15",
         "ajv": "^6.12.4",
@@ -3243,9 +3052,9 @@
         "cross-spawn": "^7.0.6",
         "debug": "^4.3.2",
         "escape-string-regexp": "^4.0.0",
-        "eslint-scope": "^8.3.0",
-        "eslint-visitor-keys": "^4.2.0",
-        "espree": "^10.3.0",
+        "eslint-scope": "^8.4.0",
+        "eslint-visitor-keys": "^4.2.1",
+        "espree": "^10.4.0",
         "esquery": "^1.5.0",
         "esutils": "^2.0.2",
         "fast-deep-equal": "^3.1.3",
@@ -3259,8 +3068,7 @@
         "lodash.merge": "^4.6.2",
         "minimatch": "^3.1.2",
         "natural-compare": "^1.4.0",
-        "optionator": "^0.9.3",
-        "zod": "^3.24.2"
+        "optionator": "^0.9.3"
       },
       "bin": {
         "eslint": "bin/eslint.js"
@@ -3304,9 +3112,9 @@
       }
     },
     "node_modules/eslint-scope": {
-      "version": "8.3.0",
-      "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.3.0.tgz",
-      "integrity": "sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ==",
+      "version": "8.4.0",
+      "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz",
+      "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==",
       "dev": true,
       "license": "BSD-2-Clause",
       "dependencies": {
@@ -3321,9 +3129,9 @@
       }
     },
     "node_modules/eslint-visitor-keys": {
-      "version": "4.2.0",
-      "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz",
-      "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==",
+      "version": "4.2.1",
+      "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",
+      "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==",
       "dev": true,
       "license": "Apache-2.0",
       "engines": {
@@ -3334,15 +3142,15 @@
       }
     },
     "node_modules/espree": {
-      "version": "10.3.0",
-      "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz",
-      "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==",
+      "version": "10.4.0",
+      "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz",
+      "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==",
       "dev": true,
       "license": "BSD-2-Clause",
       "dependencies": {
-        "acorn": "^8.14.0",
+        "acorn": "^8.15.0",
         "acorn-jsx": "^5.3.2",
-        "eslint-visitor-keys": "^4.2.0"
+        "eslint-visitor-keys": "^4.2.1"
       },
       "engines": {
         "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -3414,98 +3222,6 @@
         "node": ">=0.10.0"
       }
     },
-    "node_modules/etag": {
-      "version": "1.8.1",
-      "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
-      "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.6"
-      }
-    },
-    "node_modules/eventsource": {
-      "version": "3.0.6",
-      "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.6.tgz",
-      "integrity": "sha512-l19WpE2m9hSuyP06+FbuUUf1G+R0SFLrtQfbRb9PRr+oimOfxQhgGCbVaXg5IvZyyTThJsxh6L/srkMiCeBPDA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "eventsource-parser": "^3.0.1"
-      },
-      "engines": {
-        "node": ">=18.0.0"
-      }
-    },
-    "node_modules/eventsource-parser": {
-      "version": "3.0.1",
-      "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.0.1.tgz",
-      "integrity": "sha512-VARTJ9CYeuQYb0pZEPbzi740OWFgpHe7AYJ2WFZVnUDUQp5Dk2yJUgF36YsZ81cOyxT0QxmXD2EQpapAouzWVA==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=18.0.0"
-      }
-    },
-    "node_modules/express": {
-      "version": "5.1.0",
-      "resolved": "https://registry.npmjs.org/express/-/express-5.1.0.tgz",
-      "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "accepts": "^2.0.0",
-        "body-parser": "^2.2.0",
-        "content-disposition": "^1.0.0",
-        "content-type": "^1.0.5",
-        "cookie": "^0.7.1",
-        "cookie-signature": "^1.2.1",
-        "debug": "^4.4.0",
-        "encodeurl": "^2.0.0",
-        "escape-html": "^1.0.3",
-        "etag": "^1.8.1",
-        "finalhandler": "^2.1.0",
-        "fresh": "^2.0.0",
-        "http-errors": "^2.0.0",
-        "merge-descriptors": "^2.0.0",
-        "mime-types": "^3.0.0",
-        "on-finished": "^2.4.1",
-        "once": "^1.4.0",
-        "parseurl": "^1.3.3",
-        "proxy-addr": "^2.0.7",
-        "qs": "^6.14.0",
-        "range-parser": "^1.2.1",
-        "router": "^2.2.0",
-        "send": "^1.1.0",
-        "serve-static": "^2.2.0",
-        "statuses": "^2.0.1",
-        "type-is": "^2.0.1",
-        "vary": "^1.1.2"
-      },
-      "engines": {
-        "node": ">= 18"
-      },
-      "funding": {
-        "type": "opencollective",
-        "url": "https://opencollective.com/express"
-      }
-    },
-    "node_modules/express-rate-limit": {
-      "version": "7.5.0",
-      "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-7.5.0.tgz",
-      "integrity": "sha512-eB5zbQh5h+VenMPM3fh+nw1YExi5nMr6HUCR62ELSP11huvxm/Uir1H1QEyTkk5QX6A58pX6NmaTMceKZ0Eodg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 16"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/express-rate-limit"
-      },
-      "peerDependencies": {
-        "express": "^4.11 || 5 || ^5.0.0-beta.1"
-      }
-    },
     "node_modules/extend": {
       "version": "3.0.2",
       "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
@@ -3587,11 +3303,14 @@
       }
     },
     "node_modules/fdir": {
-      "version": "6.4.4",
-      "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz",
-      "integrity": "sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==",
+      "version": "6.5.0",
+      "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
+      "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",
       "dev": true,
       "license": "MIT",
+      "engines": {
+        "node": ">=12.0.0"
+      },
       "peerDependencies": {
         "picomatch": "^3 || ^4"
       },
@@ -3672,24 +3391,6 @@
         "node": ">=8"
       }
     },
-    "node_modules/finalhandler": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.0.tgz",
-      "integrity": "sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "debug": "^4.4.0",
-        "encodeurl": "^2.0.0",
-        "escape-html": "^1.0.3",
-        "on-finished": "^2.4.1",
-        "parseurl": "^1.3.3",
-        "statuses": "^2.0.1"
-      },
-      "engines": {
-        "node": ">= 0.8"
-      }
-    },
     "node_modules/find-up": {
       "version": "5.0.0",
       "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
@@ -3745,26 +3446,6 @@
         "node": ">=0.4.x"
       }
     },
-    "node_modules/forwarded": {
-      "version": "0.2.0",
-      "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
-      "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.6"
-      }
-    },
-    "node_modules/fresh": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz",
-      "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.8"
-      }
-    },
     "node_modules/fs-extra": {
       "version": "10.1.0",
       "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
@@ -3795,16 +3476,6 @@
         "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
       }
     },
-    "node_modules/function-bind": {
-      "version": "1.1.2",
-      "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
-      "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
-      "dev": true,
-      "license": "MIT",
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
     "node_modules/gensync": {
       "version": "1.0.0-beta.2",
       "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
@@ -3825,45 +3496,6 @@
         "node": "6.* || 8.* || >= 10.*"
       }
     },
-    "node_modules/get-intrinsic": {
-      "version": "1.3.0",
-      "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
-      "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bind-apply-helpers": "^1.0.2",
-        "es-define-property": "^1.0.1",
-        "es-errors": "^1.3.0",
-        "es-object-atoms": "^1.1.1",
-        "function-bind": "^1.1.2",
-        "get-proto": "^1.0.1",
-        "gopd": "^1.2.0",
-        "has-symbols": "^1.1.0",
-        "hasown": "^2.0.2",
-        "math-intrinsics": "^1.1.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/get-proto": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
-      "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "dunder-proto": "^1.0.1",
-        "es-object-atoms": "^1.0.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
     "node_modules/glob-parent": {
       "version": "6.0.2",
       "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
@@ -3878,9 +3510,9 @@
       }
     },
     "node_modules/globals": {
-      "version": "16.0.0",
-      "resolved": "https://registry.npmjs.org/globals/-/globals-16.0.0.tgz",
-      "integrity": "sha512-iInW14XItCXET01CQFqudPOWP2jYMl7T+QRQT+UNcR/iQncN/F0UNpgd76iFkBPgNQb4+X3LV9tLJYzwh+Gl3A==",
+      "version": "16.4.0",
+      "resolved": "https://registry.npmjs.org/globals/-/globals-16.4.0.tgz",
+      "integrity": "sha512-ob/2LcVVaVGCYN+r14cnwnoDPUufjiYgSqRhiFD0Q1iI4Odora5RE8Iv1D24hAz5oMophRGkGz+yuvQmmUMnMw==",
       "dev": true,
       "license": "MIT",
       "engines": {
@@ -3890,19 +3522,6 @@
         "url": "https://github.com/sponsors/sindresorhus"
       }
     },
-    "node_modules/gopd": {
-      "version": "1.2.0",
-      "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
-      "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
     "node_modules/graceful-fs": {
       "version": "4.2.11",
       "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
@@ -3927,32 +3546,6 @@
         "node": ">=8"
       }
     },
-    "node_modules/has-symbols": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
-      "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/hasown": {
-      "version": "2.0.2",
-      "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
-      "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "function-bind": "^1.1.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
     "node_modules/hast-util-parse-selector": {
       "version": "2.2.5",
       "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-2.2.5.tgz",
@@ -4138,36 +3731,6 @@
         "url": "https://opencollective.com/unified"
       }
     },
-    "node_modules/http-errors": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
-      "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "depd": "2.0.0",
-        "inherits": "2.0.4",
-        "setprototypeof": "1.2.0",
-        "statuses": "2.0.1",
-        "toidentifier": "1.0.1"
-      },
-      "engines": {
-        "node": ">= 0.8"
-      }
-    },
-    "node_modules/iconv-lite": {
-      "version": "0.6.3",
-      "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
-      "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "safer-buffer": ">= 2.1.2 < 3.0.0"
-      },
-      "engines": {
-        "node": ">=0.10.0"
-      }
-    },
     "node_modules/ignore": {
       "version": "5.3.2",
       "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz",
@@ -4215,29 +3778,12 @@
         "node": ">=0.8.19"
       }
     },
-    "node_modules/inherits": {
-      "version": "2.0.4",
-      "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
-      "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
-      "dev": true,
-      "license": "ISC"
-    },
     "node_modules/inline-style-parser": {
       "version": "0.2.4",
       "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.4.tgz",
       "integrity": "sha512-0aO8FkhNZlj/ZIbNi7Lxxr12obT7cL1moPfE4tg1LkX7LlLfC6DeX4l2ZEud1ukP9jNQyNnfzQVqwbwmAATY4Q==",
       "license": "MIT"
     },
-    "node_modules/ipaddr.js": {
-      "version": "1.9.1",
-      "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
-      "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.10"
-      }
-    },
     "node_modules/is-alphabetical": {
       "version": "2.0.1",
       "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz",
@@ -4337,13 +3883,6 @@
         "url": "https://github.com/sponsors/sindresorhus"
       }
     },
-    "node_modules/is-promise": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz",
-      "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==",
-      "dev": true,
-      "license": "MIT"
-    },
     "node_modules/isexe": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
@@ -4611,16 +4150,6 @@
         "lz-string": "bin/bin.js"
       }
     },
-    "node_modules/math-intrinsics": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
-      "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
     "node_modules/mdast-util-from-markdown": {
       "version": "2.0.2",
       "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.2.tgz",
@@ -4774,29 +4303,6 @@
         "url": "https://opencollective.com/unified"
       }
     },
-    "node_modules/media-typer": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz",
-      "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.8"
-      }
-    },
-    "node_modules/merge-descriptors": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz",
-      "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
     "node_modules/merge2": {
       "version": "1.4.1",
       "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
@@ -5276,29 +4782,6 @@
         "url": "https://github.com/sponsors/jonschlinkert"
       }
     },
-    "node_modules/mime-db": {
-      "version": "1.54.0",
-      "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz",
-      "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.6"
-      }
-    },
-    "node_modules/mime-types": {
-      "version": "3.0.1",
-      "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.1.tgz",
-      "integrity": "sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "mime-db": "^1.54.0"
-      },
-      "engines": {
-        "node": ">= 0.6"
-      }
-    },
     "node_modules/minimatch": {
       "version": "3.1.2",
       "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
@@ -5361,16 +4844,6 @@
       "dev": true,
       "license": "MIT"
     },
-    "node_modules/negotiator": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz",
-      "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.6"
-      }
-    },
     "node_modules/no-case": {
       "version": "3.0.4",
       "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz",
@@ -5422,42 +4895,6 @@
         "node": ">=0.10.0"
       }
     },
-    "node_modules/object-inspect": {
-      "version": "1.13.4",
-      "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
-      "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/on-finished": {
-      "version": "2.4.1",
-      "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
-      "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "ee-first": "1.1.1"
-      },
-      "engines": {
-        "node": ">= 0.8"
-      }
-    },
-    "node_modules/once": {
-      "version": "1.4.0",
-      "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
-      "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
-      "dev": true,
-      "license": "ISC",
-      "dependencies": {
-        "wrappy": "1"
-      }
-    },
     "node_modules/optionator": {
       "version": "0.9.4",
       "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",
@@ -5569,16 +5006,6 @@
         "url": "https://github.com/sponsors/sindresorhus"
       }
     },
-    "node_modules/parseurl": {
-      "version": "1.3.3",
-      "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
-      "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.8"
-      }
-    },
     "node_modules/pascal-case": {
       "version": "3.1.2",
       "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz",
@@ -5610,16 +5037,6 @@
         "node": ">=8"
       }
     },
-    "node_modules/path-to-regexp": {
-      "version": "8.2.0",
-      "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz",
-      "integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=16"
-      }
-    },
     "node_modules/pathe": {
       "version": "0.2.0",
       "resolved": "https://registry.npmjs.org/pathe/-/pathe-0.2.0.tgz",
@@ -5635,9 +5052,9 @@
       "license": "ISC"
     },
     "node_modules/picomatch": {
-      "version": "4.0.2",
-      "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz",
-      "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==",
+      "version": "4.0.3",
+      "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
+      "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
       "dev": true,
       "license": "MIT",
       "engines": {
@@ -5647,24 +5064,14 @@
         "url": "https://github.com/sponsors/jonschlinkert"
       }
     },
-    "node_modules/pkce-challenge": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-5.0.0.tgz",
-      "integrity": "sha512-ueGLflrrnvwB3xuo/uGob5pd5FN7l0MsLf0Z87o/UQmRtwjvfylfc9MurIxRAWywCYTgrvpXBcqjV4OfCYGCIQ==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=16.20.0"
-      }
-    },
     "node_modules/playwright": {
-      "version": "1.52.0",
-      "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.52.0.tgz",
-      "integrity": "sha512-JAwMNMBlxJ2oD1kce4KPtMkDeKGHQstdpFPcPH3maElAXon/QZeTvtsfXmTMRyO9TslfoYOXkSsvao2nE1ilTw==",
+      "version": "1.55.0",
+      "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.55.0.tgz",
+      "integrity": "sha512-sdCWStblvV1YU909Xqx0DhOjPZE4/5lJsIS84IfN9dAZfcl/CIZ5O8l3o0j7hPMjDvqoTF8ZUcc+i/GL5erstA==",
       "dev": true,
       "license": "Apache-2.0",
       "dependencies": {
-        "playwright-core": "1.52.0"
+        "playwright-core": "1.55.0"
       },
       "bin": {
         "playwright": "cli.js"
@@ -5677,9 +5084,9 @@
       }
     },
     "node_modules/playwright-core": {
-      "version": "1.52.0",
-      "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.52.0.tgz",
-      "integrity": "sha512-l2osTgLXSMeuLZOML9qYODUQoPPnUsKsb5/P6LJ2e6uPKXUdPK5WYhN4z03G+YNbWmGDY4YENauNu4ZKczreHg==",
+      "version": "1.55.0",
+      "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.55.0.tgz",
+      "integrity": "sha512-GvZs4vU3U5ro2nZpeiwyb0zuFaqb9sUiAJuyrWpcGouD8y9/HLgGbNRjIph7zU9D3hnPaisMl9zG9CgFi/biIg==",
       "dev": true,
       "license": "Apache-2.0",
       "bin": {
@@ -5690,9 +5097,9 @@
       }
     },
     "node_modules/postcss": {
-      "version": "8.5.3",
-      "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz",
-      "integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==",
+      "version": "8.5.6",
+      "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz",
+      "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==",
       "dev": true,
       "funding": [
         {
@@ -5710,7 +5117,7 @@
       ],
       "license": "MIT",
       "dependencies": {
-        "nanoid": "^3.3.8",
+        "nanoid": "^3.3.11",
         "picocolors": "^1.1.1",
         "source-map-js": "^1.2.1"
       },
@@ -5729,9 +5136,9 @@
       }
     },
     "node_modules/prettier": {
-      "version": "3.5.3",
-      "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz",
-      "integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==",
+      "version": "3.6.2",
+      "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz",
+      "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==",
       "dev": true,
       "license": "MIT",
       "bin": {
@@ -5745,9 +5152,9 @@
       }
     },
     "node_modules/pretty-bytes": {
-      "version": "7.0.0",
-      "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-7.0.0.tgz",
-      "integrity": "sha512-U5otLYPR3L0SVjHGrkEUx5mf7MxV2ceXeE7VwWPk+hyzC5drNohsOGNPDZqxCqyX1lkbEN4kl1LiI8QFd7r0ZA==",
+      "version": "7.0.1",
+      "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-7.0.1.tgz",
+      "integrity": "sha512-285/jRCYIbMGDciDdrw0KPNC4LKEEwz/bwErcYNxSJOi4CpGUuLpb9gQpg3XJP0XYj9ldSRluXxih4lX2YN8Xw==",
       "license": "MIT",
       "engines": {
         "node": ">=20"
@@ -5757,9 +5164,9 @@
       }
     },
     "node_modules/pretty-ms": {
-      "version": "9.2.0",
-      "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.2.0.tgz",
-      "integrity": "sha512-4yf0QO/sllf/1zbZWYnvWw3NxCQwLXKzIj0G849LSufP15BXKM0rbD2Z3wVnkMfjdn/CB0Dpp444gYAACdsplg==",
+      "version": "9.3.0",
+      "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.3.0.tgz",
+      "integrity": "sha512-gjVS5hOP+M3wMm5nmNOucbIrqudzs9v/57bWRHQWLYklXqoXKrVfYW2W9+glfGsqtPgpiz5WwyEEB+ksXIx3gQ==",
       "license": "MIT",
       "dependencies": {
         "parse-ms": "^4.0.0"
@@ -5801,20 +5208,6 @@
         "url": "https://github.com/sponsors/wooorm"
       }
     },
-    "node_modules/proxy-addr": {
-      "version": "2.0.7",
-      "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
-      "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "forwarded": "0.2.0",
-        "ipaddr.js": "1.9.1"
-      },
-      "engines": {
-        "node": ">= 0.10"
-      }
-    },
     "node_modules/punycode": {
       "version": "2.3.1",
       "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
@@ -5825,22 +5218,6 @@
         "node": ">=6"
       }
     },
-    "node_modules/qs": {
-      "version": "6.14.0",
-      "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz",
-      "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==",
-      "dev": true,
-      "license": "BSD-3-Clause",
-      "dependencies": {
-        "side-channel": "^1.1.0"
-      },
-      "engines": {
-        "node": ">=0.6"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
     "node_modules/queue-microtask": {
       "version": "1.2.3",
       "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
@@ -5862,55 +5239,25 @@
       ],
       "license": "MIT"
     },
-    "node_modules/range-parser": {
-      "version": "1.2.1",
-      "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
-      "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.6"
-      }
-    },
-    "node_modules/raw-body": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.0.tgz",
-      "integrity": "sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "bytes": "3.1.2",
-        "http-errors": "2.0.0",
-        "iconv-lite": "0.6.3",
-        "unpipe": "1.0.0"
-      },
-      "engines": {
-        "node": ">= 0.8"
-      }
-    },
     "node_modules/react": {
-      "version": "18.3.1",
-      "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz",
-      "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==",
+      "version": "19.1.1",
+      "resolved": "https://registry.npmjs.org/react/-/react-19.1.1.tgz",
+      "integrity": "sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ==",
       "license": "MIT",
-      "dependencies": {
-        "loose-envify": "^1.1.0"
-      },
       "engines": {
         "node": ">=0.10.0"
       }
     },
     "node_modules/react-dom": {
-      "version": "18.3.1",
-      "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz",
-      "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==",
+      "version": "19.1.1",
+      "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.1.tgz",
+      "integrity": "sha512-Dlq/5LAZgF0Gaz6yiqZCf6VCcZs1ghAJyrsu84Q/GT0gV+mCxbfmKNoGRKBYMJ8IEdGPqu49YWXD02GCknEDkw==",
       "license": "MIT",
       "dependencies": {
-        "loose-envify": "^1.1.0",
-        "scheduler": "^0.23.2"
+        "scheduler": "^0.26.0"
       },
       "peerDependencies": {
-        "react": "^18.3.1"
+        "react": "^19.1.1"
       }
     },
     "node_modules/react-dropzone": {
@@ -5974,14 +5321,13 @@
       }
     },
     "node_modules/react-router": {
-      "version": "7.5.3",
-      "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.5.3.tgz",
-      "integrity": "sha512-3iUDM4/fZCQ89SXlDa+Ph3MevBrozBAI655OAfWQlTm9nBR0IKlrmNwFow5lPHttbwvITZfkeeeZFP6zt3F7pw==",
+      "version": "7.9.1",
+      "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.9.1.tgz",
+      "integrity": "sha512-pfAByjcTpX55mqSDGwGnY9vDCpxqBLASg0BMNAuMmpSGESo/TaOUG6BllhAtAkCGx8Rnohik/XtaqiYUJtgW2g==",
       "license": "MIT",
       "dependencies": {
         "cookie": "^1.0.1",
-        "set-cookie-parser": "^2.6.0",
-        "turbo-stream": "2.4.0"
+        "set-cookie-parser": "^2.6.0"
       },
       "engines": {
         "node": ">=20.0.0"
@@ -5996,26 +5342,17 @@
         }
       }
     },
-    "node_modules/react-router/node_modules/cookie": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz",
-      "integrity": "sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==",
-      "license": "MIT",
-      "engines": {
-        "node": ">=18"
-      }
-    },
     "node_modules/react-syntax-highlighter": {
-      "version": "15.6.1",
-      "resolved": "https://registry.npmjs.org/react-syntax-highlighter/-/react-syntax-highlighter-15.6.1.tgz",
-      "integrity": "sha512-OqJ2/vL7lEeV5zTJyG7kmARppUjiB9h9udl4qHQjjgEos66z00Ia0OckwYfRxCSFrW8RJIBnsBwQsHZbVPspqg==",
+      "version": "15.6.6",
+      "resolved": "https://registry.npmjs.org/react-syntax-highlighter/-/react-syntax-highlighter-15.6.6.tgz",
+      "integrity": "sha512-DgXrc+AZF47+HvAPEmn7Ua/1p10jNoVZVI/LoPiYdtY+OM+/nG5yefLHKJwdKqY1adMuHFbeyBaG9j64ML7vTw==",
       "license": "MIT",
       "dependencies": {
         "@babel/runtime": "^7.3.1",
         "highlight.js": "^10.4.1",
         "highlightjs-vue": "^1.0.0",
         "lowlight": "^1.17.0",
-        "prismjs": "^1.27.0",
+        "prismjs": "^1.30.0",
         "refractor": "^3.6.0"
       },
       "peerDependencies": {
@@ -6231,13 +5568,13 @@
       }
     },
     "node_modules/rollup": {
-      "version": "4.40.1",
-      "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.40.1.tgz",
-      "integrity": "sha512-C5VvvgCCyfyotVITIAv+4efVytl5F7wt+/I2i9q9GZcEXW9BP52YYOXC58igUi+LFZVHukErIIqQSWwv/M3WRw==",
+      "version": "4.46.2",
+      "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.46.2.tgz",
+      "integrity": "sha512-WMmLFI+Boh6xbop+OAGo9cQ3OgX9MIg7xOQjn+pTCwOkk+FNDAeAemXkJ3HzDJrVXleLOFVa1ipuc1AmEx1Dwg==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "@types/estree": "1.0.7"
+        "@types/estree": "1.0.8"
       },
       "bin": {
         "rollup": "dist/bin/rollup"
@@ -6247,46 +5584,29 @@
         "npm": ">=8.0.0"
       },
       "optionalDependencies": {
-        "@rollup/rollup-android-arm-eabi": "4.40.1",
-        "@rollup/rollup-android-arm64": "4.40.1",
-        "@rollup/rollup-darwin-arm64": "4.40.1",
-        "@rollup/rollup-darwin-x64": "4.40.1",
-        "@rollup/rollup-freebsd-arm64": "4.40.1",
-        "@rollup/rollup-freebsd-x64": "4.40.1",
-        "@rollup/rollup-linux-arm-gnueabihf": "4.40.1",
-        "@rollup/rollup-linux-arm-musleabihf": "4.40.1",
-        "@rollup/rollup-linux-arm64-gnu": "4.40.1",
-        "@rollup/rollup-linux-arm64-musl": "4.40.1",
-        "@rollup/rollup-linux-loongarch64-gnu": "4.40.1",
-        "@rollup/rollup-linux-powerpc64le-gnu": "4.40.1",
-        "@rollup/rollup-linux-riscv64-gnu": "4.40.1",
-        "@rollup/rollup-linux-riscv64-musl": "4.40.1",
-        "@rollup/rollup-linux-s390x-gnu": "4.40.1",
-        "@rollup/rollup-linux-x64-gnu": "4.40.1",
-        "@rollup/rollup-linux-x64-musl": "4.40.1",
-        "@rollup/rollup-win32-arm64-msvc": "4.40.1",
-        "@rollup/rollup-win32-ia32-msvc": "4.40.1",
-        "@rollup/rollup-win32-x64-msvc": "4.40.1",
+        "@rollup/rollup-android-arm-eabi": "4.46.2",
+        "@rollup/rollup-android-arm64": "4.46.2",
+        "@rollup/rollup-darwin-arm64": "4.46.2",
+        "@rollup/rollup-darwin-x64": "4.46.2",
+        "@rollup/rollup-freebsd-arm64": "4.46.2",
+        "@rollup/rollup-freebsd-x64": "4.46.2",
+        "@rollup/rollup-linux-arm-gnueabihf": "4.46.2",
+        "@rollup/rollup-linux-arm-musleabihf": "4.46.2",
+        "@rollup/rollup-linux-arm64-gnu": "4.46.2",
+        "@rollup/rollup-linux-arm64-musl": "4.46.2",
+        "@rollup/rollup-linux-loongarch64-gnu": "4.46.2",
+        "@rollup/rollup-linux-ppc64-gnu": "4.46.2",
+        "@rollup/rollup-linux-riscv64-gnu": "4.46.2",
+        "@rollup/rollup-linux-riscv64-musl": "4.46.2",
+        "@rollup/rollup-linux-s390x-gnu": "4.46.2",
+        "@rollup/rollup-linux-x64-gnu": "4.46.2",
+        "@rollup/rollup-linux-x64-musl": "4.46.2",
+        "@rollup/rollup-win32-arm64-msvc": "4.46.2",
+        "@rollup/rollup-win32-ia32-msvc": "4.46.2",
+        "@rollup/rollup-win32-x64-msvc": "4.46.2",
         "fsevents": "~2.3.2"
       }
     },
-    "node_modules/router": {
-      "version": "2.2.0",
-      "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz",
-      "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "debug": "^4.4.0",
-        "depd": "^2.0.0",
-        "is-promise": "^4.0.0",
-        "parseurl": "^1.3.3",
-        "path-to-regexp": "^8.0.0"
-      },
-      "engines": {
-        "node": ">= 18"
-      }
-    },
     "node_modules/run-parallel": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
@@ -6321,42 +5641,11 @@
         "tslib": "^2.1.0"
       }
     },
-    "node_modules/safe-buffer": {
-      "version": "5.2.1",
-      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
-      "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
-      "dev": true,
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/feross"
-        },
-        {
-          "type": "patreon",
-          "url": "https://www.patreon.com/feross"
-        },
-        {
-          "type": "consulting",
-          "url": "https://feross.org/support"
-        }
-      ],
-      "license": "MIT"
-    },
-    "node_modules/safer-buffer": {
-      "version": "2.1.2",
-      "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
-      "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
-      "dev": true,
-      "license": "MIT"
-    },
     "node_modules/scheduler": {
-      "version": "0.23.2",
-      "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz",
-      "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==",
-      "license": "MIT",
-      "dependencies": {
-        "loose-envify": "^1.1.0"
-      }
+      "version": "0.26.0",
+      "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz",
+      "integrity": "sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==",
+      "license": "MIT"
     },
     "node_modules/semver": {
       "version": "6.3.1",
@@ -6368,58 +5657,12 @@
         "semver": "bin/semver.js"
       }
     },
-    "node_modules/send": {
-      "version": "1.2.0",
-      "resolved": "https://registry.npmjs.org/send/-/send-1.2.0.tgz",
-      "integrity": "sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "debug": "^4.3.5",
-        "encodeurl": "^2.0.0",
-        "escape-html": "^1.0.3",
-        "etag": "^1.8.1",
-        "fresh": "^2.0.0",
-        "http-errors": "^2.0.0",
-        "mime-types": "^3.0.1",
-        "ms": "^2.1.3",
-        "on-finished": "^2.4.1",
-        "range-parser": "^1.2.1",
-        "statuses": "^2.0.1"
-      },
-      "engines": {
-        "node": ">= 18"
-      }
-    },
-    "node_modules/serve-static": {
-      "version": "2.2.0",
-      "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.0.tgz",
-      "integrity": "sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "encodeurl": "^2.0.0",
-        "escape-html": "^1.0.3",
-        "parseurl": "^1.3.3",
-        "send": "^1.2.0"
-      },
-      "engines": {
-        "node": ">= 18"
-      }
-    },
     "node_modules/set-cookie-parser": {
       "version": "2.7.1",
       "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.1.tgz",
       "integrity": "sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==",
       "license": "MIT"
     },
-    "node_modules/setprototypeof": {
-      "version": "1.2.0",
-      "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
-      "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
-      "dev": true,
-      "license": "ISC"
-    },
     "node_modules/shebang-command": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
@@ -6444,87 +5687,11 @@
       }
     },
     "node_modules/shell-quote": {
-      "version": "1.8.2",
-      "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.2.tgz",
-      "integrity": "sha512-AzqKpGKjrj7EM6rKVQEPpB288oCfnrEIuyoT9cyF4nmGa7V8Zk6f7RRqYisX8X9m+Q7bd632aZW4ky7EhbQztA==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/side-channel": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",
-      "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "es-errors": "^1.3.0",
-        "object-inspect": "^1.13.3",
-        "side-channel-list": "^1.0.0",
-        "side-channel-map": "^1.0.1",
-        "side-channel-weakmap": "^1.0.2"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/side-channel-list": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz",
-      "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==",
+      "version": "1.8.3",
+      "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz",
+      "integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==",
       "dev": true,
       "license": "MIT",
-      "dependencies": {
-        "es-errors": "^1.3.0",
-        "object-inspect": "^1.13.3"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/side-channel-map": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
-      "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.2",
-        "es-errors": "^1.3.0",
-        "get-intrinsic": "^1.2.5",
-        "object-inspect": "^1.13.3"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
-    },
-    "node_modules/side-channel-weakmap": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
-      "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "call-bound": "^1.0.2",
-        "es-errors": "^1.3.0",
-        "get-intrinsic": "^1.2.5",
-        "object-inspect": "^1.13.3",
-        "side-channel-map": "^1.0.1"
-      },
       "engines": {
         "node": ">= 0.4"
       },
@@ -6579,16 +5746,6 @@
       "integrity": "sha512-HTEHMNieakEnoe33shBYcZ7NX83ACUjCu8c40iOGEZsngj9zRnkqS9j1pqQPXwobB0ZcVTk27REb7COQ0UR59w==",
       "license": "MIT"
     },
-    "node_modules/statuses": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
-      "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.8"
-      }
-    },
     "node_modules/string-comparison": {
       "version": "1.3.0",
       "resolved": "https://registry.npmjs.org/string-comparison/-/string-comparison-1.3.0.tgz",
@@ -6694,22 +5851,12 @@
       "license": "MIT"
     },
     "node_modules/tauri-pty": {
-      "version": "0.1.0",
-      "resolved": "https://registry.npmjs.org/tauri-pty/-/tauri-pty-0.1.0.tgz",
-      "integrity": "sha512-RkswxIfW5cfZFF4hH5mPENqZ3GkXbEAj/dJ7BgSbFGzRGasUSdWuZMHFJhKmREYFPUBi4z38V1mwOCMWKr0h/g==",
+      "version": "0.1.1",
+      "resolved": "https://registry.npmjs.org/tauri-pty/-/tauri-pty-0.1.1.tgz",
+      "integrity": "sha512-45Lbcr9nCWhdisszvDkAIeU0e5v8LnsFE8nOI2FF/aKWGuVP3CELqloPa6abTZP6blLmZJflQjQYRace2STNnA==",
       "license": "MIT",
       "dependencies": {
-        "@tauri-apps/api": "2.3.0"
-      }
-    },
-    "node_modules/tauri-pty/node_modules/@tauri-apps/api": {
-      "version": "2.3.0",
-      "resolved": "https://registry.npmjs.org/@tauri-apps/api/-/api-2.3.0.tgz",
-      "integrity": "sha512-33Z+0lX2wgZbx1SPFfqvzI6su63hCBkbzv+5NexeYjIx7WA9htdOKoRR7Dh3dJyltqS5/J8vQFyybiRoaL0hlA==",
-      "license": "Apache-2.0 OR MIT",
-      "funding": {
-        "type": "opencollective",
-        "url": "https://opencollective.com/tauri"
+        "@tauri-apps/api": "2.8.0"
       }
     },
     "node_modules/terser": {
@@ -6739,14 +5886,14 @@
       "license": "MIT"
     },
     "node_modules/tinyglobby": {
-      "version": "0.2.13",
-      "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.13.tgz",
-      "integrity": "sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==",
+      "version": "0.2.15",
+      "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz",
+      "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "fdir": "^6.4.4",
-        "picomatch": "^4.0.2"
+        "fdir": "^6.5.0",
+        "picomatch": "^4.0.3"
       },
       "engines": {
         "node": ">=12.0.0"
@@ -6768,16 +5915,6 @@
         "node": ">=8.0"
       }
     },
-    "node_modules/toidentifier": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
-      "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">=0.6"
-      }
-    },
     "node_modules/tree-kill": {
       "version": "1.2.2",
       "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz",
@@ -6822,9 +5959,9 @@
       }
     },
     "node_modules/ts-pattern": {
-      "version": "5.7.0",
-      "resolved": "https://registry.npmjs.org/ts-pattern/-/ts-pattern-5.7.0.tgz",
-      "integrity": "sha512-0/FvIG4g3kNkYgbNwBBW5pZBkfpeYQnH+2AA3xmjkCAit/DSDPKmgwC3fKof4oYUq6gupClVOJlFl+939VRBMg==",
+      "version": "5.8.0",
+      "resolved": "https://registry.npmjs.org/ts-pattern/-/ts-pattern-5.8.0.tgz",
+      "integrity": "sha512-kIjN2qmWiHnhgr5DAkAafF9fwb0T5OhMVSWrm8XEdTFnX6+wfXwYOFjeF86UZ54vduqiR7BfqScFmXSzSaH8oA==",
       "license": "MIT"
     },
     "node_modules/tslib": {
@@ -6833,12 +5970,6 @@
       "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
       "license": "0BSD"
     },
-    "node_modules/turbo-stream": {
-      "version": "2.4.0",
-      "resolved": "https://registry.npmjs.org/turbo-stream/-/turbo-stream-2.4.0.tgz",
-      "integrity": "sha512-FHncC10WpBd2eOmGwpmQsWLDoK4cqsA/UT/GqNoaKOQnT8uzhtCbg3EoUDMvqpOSAI0S26mr0rkjzbOO6S3v1g==",
-      "license": "ISC"
-    },
     "node_modules/type-check": {
       "version": "0.4.0",
       "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
@@ -6852,25 +5983,10 @@
         "node": ">= 0.8.0"
       }
     },
-    "node_modules/type-is": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz",
-      "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==",
-      "dev": true,
-      "license": "MIT",
-      "dependencies": {
-        "content-type": "^1.0.5",
-        "media-typer": "^1.1.0",
-        "mime-types": "^3.0.0"
-      },
-      "engines": {
-        "node": ">= 0.6"
-      }
-    },
     "node_modules/typescript": {
-      "version": "5.8.3",
-      "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
-      "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
+      "version": "5.9.2",
+      "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz",
+      "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==",
       "dev": true,
       "license": "Apache-2.0",
       "bin": {
@@ -6882,15 +5998,16 @@
       }
     },
     "node_modules/typescript-eslint": {
-      "version": "8.31.1",
-      "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.31.1.tgz",
-      "integrity": "sha512-j6DsEotD/fH39qKzXTQRwYYWlt7D+0HmfpOK+DVhwJOFLcdmn92hq3mBb7HlKJHbjjI/gTOqEcc9d6JfpFf/VA==",
+      "version": "8.44.0",
+      "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.44.0.tgz",
+      "integrity": "sha512-ib7mCkYuIzYonCq9XWF5XNw+fkj2zg629PSa9KNIQ47RXFF763S5BIX4wqz1+FLPogTZoiw8KmCiRPRa8bL3qw==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "@typescript-eslint/eslint-plugin": "8.31.1",
-        "@typescript-eslint/parser": "8.31.1",
-        "@typescript-eslint/utils": "8.31.1"
+        "@typescript-eslint/eslint-plugin": "8.44.0",
+        "@typescript-eslint/parser": "8.44.0",
+        "@typescript-eslint/typescript-estree": "8.44.0",
+        "@typescript-eslint/utils": "8.44.0"
       },
       "engines": {
         "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -6901,13 +6018,13 @@
       },
       "peerDependencies": {
         "eslint": "^8.57.0 || ^9.0.0",
-        "typescript": ">=4.8.4 <5.9.0"
+        "typescript": ">=4.8.4 <6.0.0"
       }
     },
     "node_modules/undici-types": {
-      "version": "6.20.0",
-      "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz",
-      "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==",
+      "version": "6.21.0",
+      "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
+      "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
       "dev": true,
       "license": "MIT"
     },
@@ -7008,16 +6125,6 @@
         "node": ">= 10.0.0"
       }
     },
-    "node_modules/unpipe": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
-      "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.8"
-      }
-    },
     "node_modules/update-browserslist-db": {
       "version": "1.1.3",
       "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz",
@@ -7059,16 +6166,6 @@
         "punycode": "^2.1.0"
       }
     },
-    "node_modules/vary": {
-      "version": "1.1.2",
-      "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
-      "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
-      "dev": true,
-      "license": "MIT",
-      "engines": {
-        "node": ">= 0.8"
-      }
-    },
     "node_modules/vfile": {
       "version": "6.0.3",
       "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz",
@@ -7098,24 +6195,24 @@
       }
     },
     "node_modules/vite": {
-      "version": "6.3.4",
-      "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.4.tgz",
-      "integrity": "sha512-BiReIiMS2fyFqbqNT/Qqt4CVITDU9M9vE+DKcVAsB+ZV0wvTKd+3hMbkpxz1b+NmEDMegpVbisKiAZOnvO92Sw==",
+      "version": "7.1.6",
+      "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.6.tgz",
+      "integrity": "sha512-SRYIB8t/isTwNn8vMB3MR6E+EQZM/WG1aKmmIUCfDXfVvKfc20ZpamngWHKzAmmu9ppsgxsg4b2I7c90JZudIQ==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
         "esbuild": "^0.25.0",
-        "fdir": "^6.4.4",
-        "picomatch": "^4.0.2",
-        "postcss": "^8.5.3",
-        "rollup": "^4.34.9",
-        "tinyglobby": "^0.2.13"
+        "fdir": "^6.5.0",
+        "picomatch": "^4.0.3",
+        "postcss": "^8.5.6",
+        "rollup": "^4.43.0",
+        "tinyglobby": "^0.2.15"
       },
       "bin": {
         "vite": "bin/vite.js"
       },
       "engines": {
-        "node": "^18.0.0 || ^20.0.0 || >=22.0.0"
+        "node": "^20.19.0 || >=22.12.0"
       },
       "funding": {
         "url": "https://github.com/vitejs/vite?sponsor=1"
@@ -7124,14 +6221,14 @@
         "fsevents": "~2.3.3"
       },
       "peerDependencies": {
-        "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
+        "@types/node": "^20.19.0 || >=22.12.0",
         "jiti": ">=1.21.0",
-        "less": "*",
+        "less": "^4.0.0",
         "lightningcss": "^1.21.0",
-        "sass": "*",
-        "sass-embedded": "*",
-        "stylus": "*",
-        "sugarss": "*",
+        "sass": "^1.70.0",
+        "sass-embedded": "^1.70.0",
+        "stylus": ">=0.54.8",
+        "sugarss": "^5.0.0",
         "terser": "^5.16.0",
         "tsx": "^4.8.1",
         "yaml": "^2.4.2"
@@ -7267,13 +6364,6 @@
         "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
       }
     },
-    "node_modules/wrappy": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
-      "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
-      "dev": true,
-      "license": "ISC"
-    },
     "node_modules/xtend": {
       "version": "4.0.2",
       "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
@@ -7301,15 +6391,15 @@
       "license": "ISC"
     },
     "node_modules/yaml": {
-      "version": "2.7.1",
-      "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.1.tgz",
-      "integrity": "sha512-10ULxpnOCQXxJvBgxsn9ptjq6uviG/htZKk9veJGhlqn3w/DxQ631zFF+nlQXLwmImeS5amR2dl2U8sg6U9jsQ==",
+      "version": "2.8.1",
+      "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz",
+      "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==",
       "license": "ISC",
       "bin": {
         "yaml": "bin.mjs"
       },
       "engines": {
-        "node": ">= 14"
+        "node": ">= 14.6"
       }
     },
     "node_modules/yargs": {
@@ -7354,26 +6444,6 @@
         "url": "https://github.com/sponsors/sindresorhus"
       }
     },
-    "node_modules/zod": {
-      "version": "3.24.3",
-      "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.3.tgz",
-      "integrity": "sha512-HhY1oqzWCQWuUqvBFnsyrtZRhyPeR7SUGv+C4+MsisMuVfSPx8HpwWqH8tRahSlt6M3PiFAcoeFhZAqIXTxoSg==",
-      "dev": true,
-      "license": "MIT",
-      "funding": {
-        "url": "https://github.com/sponsors/colinhacks"
-      }
-    },
-    "node_modules/zod-to-json-schema": {
-      "version": "3.24.5",
-      "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.24.5.tgz",
-      "integrity": "sha512-/AuWwMP+YqiPbsJx5D6TfgRTc4kTLjsh5SOcd4bLsfUg2RcEXrFMJl1DGgdHy2aCfsIA/cr/1JM0xcB2GZji8g==",
-      "dev": true,
-      "license": "ISC",
-      "peerDependencies": {
-        "zod": "^3.24.1"
-      }
-    },
     "node_modules/zwitch": {
       "version": "2.0.4",
       "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz",
diff --git a/pdl-live-react/package.json b/pdl-live-react/package.json
index 13bc21606..342ba5b15 100644
--- a/pdl-live-react/package.json
+++ b/pdl-live-react/package.json
@@ -1,7 +1,7 @@
 {
   "name": "PDL",
   "private": true,
-  "version": "0.7.0",
+  "version": "0.8.0",
   "type": "module",
   "scripts": {
     "prod:mac:1": "npm run tauri build -- --no-bundle --target=universal-apple-darwin",
@@ -36,8 +36,8 @@
     "lz-string": "^1.5.0",
     "pretty-bytes": "^7.0.0",
     "pretty-ms": "^9.2.0",
-    "react": "^18.3.1",
-    "react-dom": "^18.3.1",
+    "react": "^19.0.0",
+    "react-dom": "^19.0.0",
     "react-markdown": "^10.0.0",
     "react-router": "^7.1.5",
     "react-syntax-highlighter": "^15.6.1",
@@ -51,11 +51,11 @@
     "@eslint/js": "^9.19.0",
     "@playwright/test": "^1.50.0",
     "@tauri-apps/cli": "^2.3.0",
-    "@types/node": "22.12.0",
-    "@types/react": "^18.3.18",
-    "@types/react-dom": "^18.3.5",
+    "@types/node": "22.18.6",
+    "@types/react": "^19.0.0",
+    "@types/react-dom": "^19.0.0",
     "@types/react-syntax-highlighter": "^15.5.13",
-    "@vitejs/plugin-react": "^4.3.4",
+    "@vitejs/plugin-react": "^5.0.0",
     "concurrently": "^9.1.2",
     "eslint": "^9.19.0",
     "eslint-plugin-react-hooks": "^5.1.0",
@@ -63,9 +63,9 @@
     "globals": "^16.0.0",
     "json-schema-to-typescript": "^15.0.4",
     "prettier": "^3.4.2",
-    "typescript": "5.8",
+    "typescript": "5.9",
     "typescript-eslint": "^8.27.0",
-    "vite": "^6.2.3",
+    "vite": "^7.0.0",
     "vite-plugin-html": "^3.2.2"
   },
   "prettier": {
diff --git a/pdl-live-react/src-tauri/Cargo.lock b/pdl-live-react/src-tauri/Cargo.lock
index bb0461cd5..9385b535e 100644
--- a/pdl-live-react/src-tauri/Cargo.lock
+++ b/pdl-live-react/src-tauri/Cargo.lock
@@ -181,17 +181,6 @@ dependencies = [
  "slab",
 ]
 
-[[package]]
-name = "async-fs"
-version = "2.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a"
-dependencies = [
- "async-lock",
- "blocking",
- "futures-lite",
-]
-
 [[package]]
 name = "async-io"
 version = "2.4.0"
@@ -224,9 +213,9 @@ dependencies = [
 
 [[package]]
 name = "async-openai"
-version = "0.28.1"
+version = "0.29.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "14d76e2f5af19477d6254415acc95ba97c6cc6f3b1e3cb4676b7f0fab8194298"
+checksum = "d4fc47ec9e669d562e0755f59e1976d157546910e403f3c2da856d0a4d3cdc07"
 dependencies = [
  "async-openai-macros",
  "backoff",
@@ -235,7 +224,7 @@ dependencies = [
  "derive_builder",
  "eventsource-stream",
  "futures",
- "rand 0.8.5",
+ "rand 0.9.1",
  "reqwest",
  "reqwest-eventsource",
  "secrecy",
@@ -433,9 +422,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
 
 [[package]]
 name = "base64ct"
-version = "1.7.3"
+version = "1.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "89e25b6adfb930f02d1981565a6e5d9c547ac15a96606256d3b59040e5cd4ca3"
+checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba"
 
 [[package]]
 name = "bitflags"
@@ -503,9 +492,9 @@ dependencies = [
 
 [[package]]
 name = "brotli"
-version = "7.0.0"
+version = "8.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd"
+checksum = "9991eea70ea4f293524138648e41ee89b0b2b12ddef3b255effa43c8056e0e0d"
 dependencies = [
  "alloc-no-stdlib",
  "alloc-stdlib",
@@ -514,9 +503,9 @@ dependencies = [
 
 [[package]]
 name = "brotli-decompressor"
-version = "4.0.3"
+version = "5.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a334ef7c9e23abf0ce748e8cd309037da93e606ad52eb372e4ce327a0dcfbdfd"
+checksum = "874bb8112abecc98cbd6d81ea4fa7e94fb9449648c93cc89aa40c81c24d7de03"
 dependencies = [
  "alloc-no-stdlib",
  "alloc-stdlib",
@@ -644,7 +633,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "02260d489095346e5cafd04dea8e8cb54d1d74fcd759022a9b72986ebe9a1257"
 dependencies = [
  "serde",
- "toml",
+ "toml 0.8.22",
 ]
 
 [[package]]
@@ -794,7 +783,7 @@ checksum = "3b79c4069c6cad78e2e0cdfcbd26275770669fb39fd308a752dc110e83b9af32"
 dependencies = [
  "castaway",
  "cfg-if",
- "itoa 1.0.15",
+ "itoa",
  "rustversion",
  "ryu",
  "static_assertions",
@@ -951,15 +940,15 @@ dependencies = [
 
 [[package]]
 name = "cssparser"
-version = "0.27.2"
+version = "0.29.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "754b69d351cdc2d8ee09ae203db831e005560fc6030da058f86ad60c92a9cb0a"
+checksum = "f93d03419cb5950ccfd3daf3ff1c7a36ace64609a1a8746d493df1ca0afde0fa"
 dependencies = [
  "cssparser-macros",
  "dtoa-short",
- "itoa 0.4.8",
+ "itoa",
  "matches",
- "phf 0.8.0",
+ "phf 0.10.1",
  "proc-macro2",
  "quote",
  "smallvec",
@@ -1113,7 +1102,7 @@ dependencies = [
  "libc",
  "option-ext",
  "redox_users",
- "windows-sys 0.59.0",
+ "windows-sys 0.60.2",
 ]
 
 [[package]]
@@ -1145,9 +1134,9 @@ dependencies = [
 
 [[package]]
 name = "dlopen2"
-version = "0.7.0"
+version = "0.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9e1297103d2bbaea85724fcee6294c2d50b1081f9ad47d0f6f6f61eda65315a6"
+checksum = "b54f373ccf864bf587a89e880fb7610f8d73f3045f13580948ccbcaff26febff"
 dependencies = [
  "dlopen2_derive",
  "libc",
@@ -1174,7 +1163,7 @@ checksum = "e5766087c2235fec47fafa4cfecc81e494ee679d0fd4a59887ea0919bfb0e4fc"
 dependencies = [
  "cfg-if",
  "libc",
- "socket2",
+ "socket2 0.5.9",
  "windows-sys 0.48.0",
 ]
 
@@ -1210,14 +1199,14 @@ dependencies = [
 
 [[package]]
 name = "duct"
-version = "0.13.7"
+version = "1.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e4ab5718d1224b63252cd0c6f74f6480f9ffeb117438a2e0f5cf6d9a4798929c"
+checksum = "d7478638a31d1f1f3d6c9f5e57c76b906a04ac4879d6fd0fb6245bc88f73fd0b"
 dependencies = [
  "libc",
- "once_cell",
  "os_pipe",
  "shared_child",
+ "shared_thread",
 ]
 
 [[package]]
@@ -1247,7 +1236,7 @@ dependencies = [
  "cc",
  "memchr",
  "rustc_version",
- "toml",
+ "toml 0.8.22",
  "vswhom",
  "winreg 0.52.0",
 ]
@@ -1329,7 +1318,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e"
 dependencies = [
  "libc",
- "windows-sys 0.59.0",
+ "windows-sys 0.52.0",
 ]
 
 [[package]]
@@ -1390,7 +1379,7 @@ checksum = "0ce92ff622d6dadf7349484f42c93271a0d49b7cc4d466a936405bacbe10aa78"
 dependencies = [
  "cfg-if",
  "rustix 1.0.7",
- "windows-sys 0.59.0",
+ "windows-sys 0.52.0",
 ]
 
 [[package]]
@@ -2035,16 +2024,14 @@ dependencies = [
 
 [[package]]
 name = "html5ever"
-version = "0.26.0"
+version = "0.29.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bea68cab48b8459f17cf1c944c67ddc572d272d9f2b274140f223ecb1da4a3b7"
+checksum = "3b7410cae13cbc75623c98ac4cbfd1f0bedddf3227afc24f370cf0f50a44a11c"
 dependencies = [
  "log",
  "mac",
  "markup5ever",
- "proc-macro2",
- "quote",
- "syn 1.0.109",
+ "match_token",
 ]
 
 [[package]]
@@ -2055,7 +2042,7 @@ checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565"
 dependencies = [
  "bytes",
  "fnv",
- "itoa 1.0.15",
+ "itoa",
 ]
 
 [[package]]
@@ -2099,7 +2086,7 @@ dependencies = [
  "http",
  "http-body",
  "httparse",
- "itoa 1.0.15",
+ "itoa",
  "pin-project-lite",
  "smallvec",
  "tokio",
@@ -2142,19 +2129,23 @@ dependencies = [
 
 [[package]]
 name = "hyper-util"
-version = "0.1.11"
+version = "0.1.15"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "497bbc33a26fdd4af9ed9c70d63f61cf56a938375fbb32df34db9b1cd6d643f2"
+checksum = "7f66d5bd4c6f02bf0542fad85d626775bab9258cf795a4256dcaf3161114d1df"
 dependencies = [
+ "base64 0.22.1",
  "bytes",
  "futures-channel",
+ "futures-core",
  "futures-util",
  "http",
  "http-body",
  "hyper",
+ "ipnet",
  "libc",
+ "percent-encoding",
  "pin-project-lite",
- "socket2",
+ "socket2 0.5.9",
  "tokio",
  "tower-service",
  "tracing",
@@ -2162,9 +2153,9 @@ dependencies = [
 
 [[package]]
 name = "iana-time-zone"
-version = "0.1.63"
+version = "0.1.64"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8"
+checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb"
 dependencies = [
  "android_system_properties",
  "core-foundation-sys",
@@ -2352,13 +2343,14 @@ dependencies = [
 
 [[package]]
 name = "indexmap"
-version = "2.9.0"
+version = "2.11.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e"
+checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5"
 dependencies = [
  "equivalent",
  "hashbrown 0.15.3",
  "serde",
+ "serde_core",
 ]
 
 [[package]]
@@ -2379,12 +2371,33 @@ dependencies = [
  "cfg-if",
 ]
 
+[[package]]
+name = "io-uring"
+version = "0.7.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b86e202f00093dcba4275d4636b93ef9dd75d025ae560d2521b45ea28ab49013"
+dependencies = [
+ "bitflags 2.9.0",
+ "cfg-if",
+ "libc",
+]
+
 [[package]]
 name = "ipnet"
 version = "2.11.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130"
 
+[[package]]
+name = "iri-string"
+version = "0.7.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2"
+dependencies = [
+ "memchr",
+ "serde",
+]
+
 [[package]]
 name = "is-docker"
 version = "0.2.0"
@@ -2431,12 +2444,6 @@ dependencies = [
  "either",
 ]
 
-[[package]]
-name = "itoa"
-version = "0.4.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
-
 [[package]]
 name = "itoa"
 version = "1.0.15"
@@ -2552,14 +2559,13 @@ dependencies = [
 
 [[package]]
 name = "kuchikiki"
-version = "0.8.2"
+version = "0.8.8-speedreader"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f29e4755b7b995046f510a7520c42b2fed58b77bd94d5a87a8eb43d2fd126da8"
+checksum = "02cb977175687f33fa4afa0c95c112b987ea1443e5a51c8f8ff27dc618270cc2"
 dependencies = [
  "cssparser",
  "html5ever",
- "indexmap 1.9.3",
- "matches",
+ "indexmap 2.11.4",
  "selectors",
 ]
 
@@ -2671,7 +2677,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34"
 dependencies = [
  "cfg-if",
- "windows-targets 0.52.6",
+ "windows-targets 0.48.5",
 ]
 
 [[package]]
@@ -2813,18 +2819,29 @@ checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d"
 
 [[package]]
 name = "markup5ever"
-version = "0.11.0"
+version = "0.14.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a2629bb1404f3d34c2e921f21fd34ba00b206124c81f65c50b43b6aaefeb016"
+checksum = "c7a7213d12e1864c0f002f52c2923d4556935a43dec5e71355c2760e0f6e7a18"
 dependencies = [
  "log",
- "phf 0.10.1",
- "phf_codegen 0.10.0",
+ "phf 0.11.3",
+ "phf_codegen 0.11.3",
  "string_cache",
  "string_cache_codegen",
  "tendril",
 ]
 
+[[package]]
+name = "match_token"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "88a9689d8d44bf9964484516275f5cd4c9b59457a6940c1d5d0ecbb94510a36b"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.101",
+]
+
 [[package]]
 name = "matches"
 version = "0.1.10"
@@ -2883,9 +2900,9 @@ dependencies = [
 
 [[package]]
 name = "minijinja"
-version = "2.9.0"
+version = "2.12.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "98642a6dfca91122779a307b77cd07a4aa951fbe32232aaf5bad9febc66be754"
+checksum = "a9f264d75233323f4b7d2f03aefe8a990690cdebfbfe26ea86bcbaec5e9ac990"
 dependencies = [
  "aho-corasick",
  "serde",
@@ -2929,9 +2946,9 @@ dependencies = [
 
 [[package]]
 name = "muda"
-version = "0.16.1"
+version = "0.17.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4de14a9b5d569ca68d7c891d613b390cf5ab4f851c77aaa2f9e435555d3d9492"
+checksum = "58b89bf91c19bf036347f1ab85a81c560f08c0667c8601bece664d860a600988"
 dependencies = [
  "crossbeam-channel",
  "dpi",
@@ -3035,6 +3052,19 @@ dependencies = [
  "memoffset",
 ]
 
+[[package]]
+name = "nix"
+version = "0.30.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6"
+dependencies = [
+ "bitflags 2.9.0",
+ "cfg-if",
+ "cfg_aliases 0.2.1",
+ "libc",
+ "memoffset",
+]
+
 [[package]]
 name = "nodrop"
 version = "0.1.14"
@@ -3267,6 +3297,16 @@ dependencies = [
  "objc2-core-foundation",
 ]
 
+[[package]]
+name = "objc2-javascript-core"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9052cb1bb50a4c161d934befcf879526fb87ae9a68858f241e693ca46225cf5a"
+dependencies = [
+ "objc2 0.6.1",
+ "objc2-core-foundation",
+]
+
 [[package]]
 name = "objc2-metal"
 version = "0.2.2"
@@ -3303,6 +3343,17 @@ dependencies = [
  "objc2-foundation 0.3.1",
 ]
 
+[[package]]
+name = "objc2-security"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e1f8e0ef3ab66b08c42644dcb34dba6ec0a574bbd8adbb8bdbdc7a2779731a44"
+dependencies = [
+ "bitflags 2.9.0",
+ "objc2 0.6.1",
+ "objc2-core-foundation",
+]
+
 [[package]]
 name = "objc2-ui-kit"
 version = "0.3.1"
@@ -3327,6 +3378,8 @@ dependencies = [
  "objc2-app-kit",
  "objc2-core-foundation",
  "objc2-foundation 0.3.1",
+ "objc2-javascript-core",
+ "objc2-security",
 ]
 
 [[package]]
@@ -3340,14 +3393,14 @@ dependencies = [
 
 [[package]]
 name = "ollama-rs"
-version = "0.3.1"
+version = "0.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a0bd0e2c30868e72ffca8143873c6c1e288b2efda9d3950e9ae0d0b4039c49c3"
+checksum = "659dd1460a1079db751a236b301e78e63486758fee7e2db1ddcd2372c264be36"
 dependencies = [
  "async-stream",
  "log",
  "reqwest",
- "schemars",
+ "schemars 1.0.4",
  "serde",
  "serde_json",
  "static_assertions",
@@ -3453,9 +3506,9 @@ dependencies = [
 
 [[package]]
 name = "os_pipe"
-version = "1.2.1"
+version = "1.2.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5ffd2b0a5634335b135d5728d84c5e0fd726954b87111f7506a61c502280d982"
+checksum = "db335f4760b14ead6290116f2427bf33a14d4f0617d49f78a246de10c1831224"
 dependencies = [
  "libc",
  "windows-sys 0.59.0",
@@ -3463,9 +3516,9 @@ dependencies = [
 
 [[package]]
 name = "owo-colors"
-version = "4.2.0"
+version = "4.2.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1036865bb9422d3300cf723f657c2851d0e9ab12567854b1f4eba3d77decf564"
+checksum = "48dd4f4a2c8405440fd0462561f0e5806bd0f77e86f51c761481bdd4018b545e"
 
 [[package]]
 name = "page_size"
@@ -3545,7 +3598,7 @@ checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3"
 
 [[package]]
 name = "pdl"
-version = "0.7.0"
+version = "0.8.0"
 dependencies = [
  "async-openai",
  "async-recursion",
@@ -3556,7 +3609,7 @@ dependencies = [
  "fs4",
  "futures",
  "iana-time-zone",
- "indexmap 2.9.0",
+ "indexmap 2.11.4",
  "minijinja",
  "ollama-rs",
  "owo-colors",
@@ -3565,7 +3618,7 @@ dependencies = [
  "rustpython-pylib",
  "rustpython-stdlib",
  "rustpython-vm",
- "schemars",
+ "schemars 0.8.22",
  "serde",
  "serde_json",
  "serde_norway",
@@ -3595,9 +3648,7 @@ version = "0.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12"
 dependencies = [
- "phf_macros 0.8.0",
  "phf_shared 0.8.0",
- "proc-macro-hack",
 ]
 
 [[package]]
@@ -3606,7 +3657,9 @@ version = "0.10.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259"
 dependencies = [
+ "phf_macros 0.10.0",
  "phf_shared 0.10.0",
+ "proc-macro-hack",
 ]
 
 [[package]]
@@ -3629,16 +3682,6 @@ dependencies = [
  "phf_shared 0.8.0",
 ]
 
-[[package]]
-name = "phf_codegen"
-version = "0.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fb1c3a8bc4dd4e5cfce29b44ffc14bedd2ee294559a294e2a4d4c9e9a6a13cd"
-dependencies = [
- "phf_generator 0.10.0",
- "phf_shared 0.10.0",
-]
-
 [[package]]
 name = "phf_codegen"
 version = "0.11.3"
@@ -3681,12 +3724,12 @@ dependencies = [
 
 [[package]]
 name = "phf_macros"
-version = "0.8.0"
+version = "0.10.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f6fde18ff429ffc8fe78e2bf7f8b7a5a5a6e2a8b58bc5a9ac69198bbda9189c"
+checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0"
 dependencies = [
- "phf_generator 0.8.0",
- "phf_shared 0.8.0",
+ "phf_generator 0.10.0",
+ "phf_shared 0.10.0",
  "proc-macro-hack",
  "proc-macro2",
  "quote",
@@ -3769,7 +3812,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "eac26e981c03a6e53e0aee43c113e3202f5581d5360dae7bd2c70e800dd0451d"
 dependencies = [
  "base64 0.22.1",
- "indexmap 2.9.0",
+ "indexmap 2.11.4",
  "quick-xml",
  "serde",
  "time",
@@ -3956,7 +3999,7 @@ dependencies = [
  "quinn-udp",
  "rustc-hash",
  "rustls",
- "socket2",
+ "socket2 0.5.9",
  "thiserror 2.0.12",
  "tokio",
  "tracing",
@@ -3992,9 +4035,9 @@ dependencies = [
  "cfg_aliases 0.2.1",
  "libc",
  "once_cell",
- "socket2",
+ "socket2 0.5.9",
  "tracing",
- "windows-sys 0.59.0",
+ "windows-sys 0.52.0",
 ]
 
 [[package]]
@@ -4149,9 +4192,9 @@ checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539"
 
 [[package]]
 name = "rayon"
-version = "1.10.0"
+version = "1.11.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa"
+checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f"
 dependencies = [
  "either",
  "rayon-core",
@@ -4159,9 +4202,9 @@ dependencies = [
 
 [[package]]
 name = "rayon-core"
-version = "1.12.1"
+version = "1.13.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2"
+checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
 dependencies = [
  "crossbeam-deque",
  "crossbeam-utils",
@@ -4187,11 +4230,31 @@ dependencies = [
  "thiserror 2.0.12",
 ]
 
+[[package]]
+name = "ref-cast"
+version = "1.0.24"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf"
+dependencies = [
+ "ref-cast-impl",
+]
+
+[[package]]
+name = "ref-cast-impl"
+version = "1.0.24"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.101",
+]
+
 [[package]]
 name = "regex"
-version = "1.11.1"
+version = "1.11.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
+checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912"
 dependencies = [
  "aho-corasick",
  "memchr",
@@ -4218,9 +4281,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
 
 [[package]]
 name = "reqwest"
-version = "0.12.15"
+version = "0.12.22"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d19c46a6fdd48bc4dab94b6103fccc55d34c67cc0ad04653aad4ea2a07cd7bbb"
+checksum = "cbc931937e6ca3a06e3b6c0aa7841849b160a90351d6ab467a8b9b9959767531"
 dependencies = [
  "base64 0.22.1",
  "bytes",
@@ -4233,19 +4296,15 @@ dependencies = [
  "hyper-rustls",
  "hyper-tls",
  "hyper-util",
- "ipnet",
  "js-sys",
  "log",
- "mime",
  "mime_guess",
  "native-tls",
- "once_cell",
  "percent-encoding",
  "pin-project-lite",
  "quinn",
  "rustls",
  "rustls-native-certs",
- "rustls-pemfile",
  "rustls-pki-types",
  "serde",
  "serde_json",
@@ -4256,13 +4315,13 @@ dependencies = [
  "tokio-rustls",
  "tokio-util",
  "tower",
+ "tower-http",
  "tower-service",
  "url",
  "wasm-bindgen",
  "wasm-bindgen-futures",
  "wasm-streams",
  "web-sys",
- "windows-registry",
 ]
 
 [[package]]
@@ -4408,7 +4467,7 @@ dependencies = [
  "errno",
  "libc",
  "linux-raw-sys 0.4.15",
- "windows-sys 0.59.0",
+ "windows-sys 0.52.0",
 ]
 
 [[package]]
@@ -4421,7 +4480,7 @@ dependencies = [
  "errno",
  "libc",
  "linux-raw-sys 0.9.4",
- "windows-sys 0.59.0",
+ "windows-sys 0.52.0",
 ]
 
 [[package]]
@@ -4450,15 +4509,6 @@ dependencies = [
  "security-framework 3.2.0",
 ]
 
-[[package]]
-name = "rustls-pemfile"
-version = "2.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50"
-dependencies = [
- "rustls-pki-types",
-]
-
 [[package]]
 name = "rustls-pki-types"
 version = "1.11.0"
@@ -4486,7 +4536,7 @@ source = "git+https://github.com/RustPython/RustPython.git#85f7ba51f4f9eb8d46f45
 dependencies = [
  "ahash",
  "bitflags 2.9.0",
- "indexmap 2.9.0",
+ "indexmap 2.11.4",
  "itertools",
  "log",
  "malachite-bigint",
@@ -4662,7 +4712,7 @@ dependencies = [
  "foreign-types-shared 0.1.1",
  "gethostname",
  "hex",
- "indexmap 2.9.0",
+ "indexmap 2.11.4",
  "itertools",
  "junction",
  "libc",
@@ -4694,7 +4744,7 @@ dependencies = [
  "sha-1",
  "sha2",
  "sha3",
- "socket2",
+ "socket2 0.5.9",
  "system-configuration",
  "termios",
  "ucd",
@@ -4732,7 +4782,7 @@ dependencies = [
  "glob",
  "half",
  "hex",
- "indexmap 2.9.0",
+ "indexmap 2.11.4",
  "is-macro",
  "itertools",
  "junction",
@@ -4860,13 +4910,26 @@ checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615"
 dependencies = [
  "dyn-clone",
  "indexmap 1.9.3",
- "schemars_derive",
+ "schemars_derive 0.8.22",
  "serde",
  "serde_json",
  "url",
  "uuid",
 ]
 
+[[package]]
+name = "schemars"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0"
+dependencies = [
+ "dyn-clone",
+ "ref-cast",
+ "schemars_derive 1.0.4",
+ "serde",
+ "serde_json",
+]
+
 [[package]]
 name = "schemars_derive"
 version = "0.8.22"
@@ -4879,6 +4942,18 @@ dependencies = [
  "syn 2.0.101",
 ]
 
+[[package]]
+name = "schemars_derive"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "33d020396d1d138dc19f1165df7545479dcd58d93810dc5d646a16e55abefa80"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "serde_derive_internals",
+ "syn 2.0.101",
+]
+
 [[package]]
 name = "scopeguard"
 version = "1.2.0"
@@ -4933,22 +5008,20 @@ dependencies = [
 
 [[package]]
 name = "selectors"
-version = "0.22.0"
+version = "0.24.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df320f1889ac4ba6bc0cdc9c9af7af4bd64bb927bccdf32d81140dc1f9be12fe"
+checksum = "0c37578180969d00692904465fb7f6b3d50b9a2b952b87c23d0e2e5cb5013416"
 dependencies = [
  "bitflags 1.3.2",
  "cssparser",
  "derive_more",
  "fxhash",
  "log",
- "matches",
  "phf 0.8.0",
  "phf_codegen 0.8.0",
  "precomputed-hash",
  "servo_arc",
  "smallvec",
- "thin-slice",
 ]
 
 [[package]]
@@ -4962,10 +5035,11 @@ dependencies = [
 
 [[package]]
 name = "serde"
-version = "1.0.219"
+version = "1.0.225"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
+checksum = "fd6c24dee235d0da097043389623fb913daddf92c76e9f5a1db88607a0bcbd1d"
 dependencies = [
+ "serde_core",
  "serde_derive",
 ]
 
@@ -4980,11 +5054,20 @@ dependencies = [
  "typeid",
 ]
 
+[[package]]
+name = "serde_core"
+version = "1.0.225"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "659356f9a0cb1e529b24c01e43ad2bdf520ec4ceaf83047b83ddcc2251f96383"
+dependencies = [
+ "serde_derive",
+]
+
 [[package]]
 name = "serde_derive"
-version = "1.0.219"
+version = "1.0.225"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
+checksum = "0ea936adf78b1f766949a4977b91d2f5595825bd6ec079aa9543ad2685fc4516"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -5004,14 +5087,16 @@ dependencies = [
 
 [[package]]
 name = "serde_json"
-version = "1.0.140"
+version = "1.0.145"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373"
+checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c"
 dependencies = [
- "itoa 1.0.15",
+ "indexmap 2.11.4",
+ "itoa",
  "memchr",
  "ryu",
  "serde",
+ "serde_core",
 ]
 
 [[package]]
@@ -5020,8 +5105,8 @@ version = "0.9.42"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "e408f29489b5fd500fab51ff1484fc859bb655f32c671f307dcd733b72e8168c"
 dependencies = [
- "indexmap 2.9.0",
- "itoa 1.0.15",
+ "indexmap 2.11.4",
+ "itoa",
  "ryu",
  "serde",
  "unsafe-libyaml-norway",
@@ -5047,6 +5132,15 @@ dependencies = [
  "serde",
 ]
 
+[[package]]
+name = "serde_spanned"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "40734c41988f7306bb04f0ecf60ec0f3f1caa34290e4e8ea471dcd3346483b83"
+dependencies = [
+ "serde",
+]
+
 [[package]]
 name = "serde_urlencoded"
 version = "0.7.1"
@@ -5054,7 +5148,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
 dependencies = [
  "form_urlencoded",
- "itoa 1.0.15",
+ "itoa",
  "ryu",
  "serde",
 ]
@@ -5069,7 +5163,7 @@ dependencies = [
  "chrono",
  "hex",
  "indexmap 1.9.3",
- "indexmap 2.9.0",
+ "indexmap 2.11.4",
  "serde",
  "serde_derive",
  "serde_json",
@@ -5102,9 +5196,9 @@ dependencies = [
 
 [[package]]
 name = "serialize-to-javascript"
-version = "0.1.1"
+version = "0.1.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c9823f2d3b6a81d98228151fdeaf848206a7855a7a042bbf9bf870449a66cafb"
+checksum = "04f3666a07a197cdb77cdf306c32be9b7f598d7060d50cfd4d5aa04bfd92f6c5"
 dependencies = [
  "serde",
  "serde_json",
@@ -5113,20 +5207,20 @@ dependencies = [
 
 [[package]]
 name = "serialize-to-javascript-impl"
-version = "0.1.1"
+version = "0.1.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "74064874e9f6a15f04c1f3cb627902d0e6b410abbf36668afa873c61889f1763"
+checksum = "772ee033c0916d670af7860b6e1ef7d658a4629a6d0b4c8c3e67f09b3765b75d"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 1.0.109",
+ "syn 2.0.101",
 ]
 
 [[package]]
 name = "servo_arc"
-version = "0.1.1"
+version = "0.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d98238b800e0d1576d8b6e3de32827c2d74bee68bb97748dcf5071fb53965432"
+checksum = "d52aa42f8fdf0fed91e5ce7f23d8138441002fa31dca008acf47e6fd4721f741"
 dependencies = [
  "nodrop",
  "stable_deref_trait",
@@ -5166,12 +5260,13 @@ dependencies = [
 
 [[package]]
 name = "shared_child"
-version = "1.0.2"
+version = "1.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7e297bd52991bbe0686c086957bee142f13df85d1e79b0b21630a99d374ae9dc"
+checksum = "1e362d9935bc50f019969e2f9ecd66786612daae13e8f277be7bfb66e8bed3f7"
 dependencies = [
  "libc",
- "windows-sys 0.59.0",
+ "sigchld",
+ "windows-sys 0.60.2",
 ]
 
 [[package]]
@@ -5184,6 +5279,12 @@ dependencies = [
  "libc",
 ]
 
+[[package]]
+name = "shared_thread"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "52b86057fcb5423f5018e331ac04623e32d6b5ce85e33300f92c79a1973928b0"
+
 [[package]]
 name = "shell-words"
 version = "1.1.0"
@@ -5196,6 +5297,27 @@ version = "1.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
 
+[[package]]
+name = "sigchld"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "47106eded3c154e70176fc83df9737335c94ce22f821c32d17ed1db1f83badb1"
+dependencies = [
+ "libc",
+ "os_pipe",
+ "signal-hook",
+]
+
+[[package]]
+name = "signal-hook"
+version = "0.3.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2"
+dependencies = [
+ "libc",
+ "signal-hook-registry",
+]
+
 [[package]]
 name = "signal-hook-registry"
 version = "1.4.5"
@@ -5248,6 +5370,16 @@ dependencies = [
  "windows-sys 0.52.0",
 ]
 
+[[package]]
+name = "socket2"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807"
+dependencies = [
+ "libc",
+ "windows-sys 0.59.0",
+]
+
 [[package]]
 name = "softbuffer"
 version = "0.4.6"
@@ -5458,17 +5590,18 @@ dependencies = [
  "cfg-expr",
  "heck 0.5.0",
  "pkg-config",
- "toml",
+ "toml 0.8.22",
  "version-compare",
 ]
 
 [[package]]
 name = "tao"
-version = "0.33.0"
+version = "0.34.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e59c1f38e657351a2e822eadf40d6a2ad4627b9c25557bc1180ec1b3295ef82"
+checksum = "4daa814018fecdfb977b59a094df4bd43b42e8e21f88fddfc05807e6f46efaaf"
 dependencies = [
  "bitflags 2.9.0",
+ "block2 0.6.1",
  "core-foundation 0.10.0",
  "core-graphics",
  "crossbeam-channel",
@@ -5520,17 +5653,17 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
 
 [[package]]
 name = "tauri"
-version = "2.5.1"
+version = "2.8.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e7b0bc1aec81bda6bc455ea98fcaed26b3c98c1648c627ad6ff1c704e8bf8cbc"
+checksum = "d4d1d3b3dc4c101ac989fd7db77e045cc6d91a25349cd410455cb5c57d510c1c"
 dependencies = [
  "anyhow",
  "bytes",
+ "cookie",
  "dirs",
  "dunce",
  "embed_plist",
- "futures-util",
- "getrandom 0.2.16",
+ "getrandom 0.3.2",
  "glob",
  "gtk",
  "heck 0.5.0",
@@ -5544,6 +5677,7 @@ dependencies = [
  "objc2-app-kit",
  "objc2-foundation 0.3.1",
  "objc2-ui-kit",
+ "objc2-web-kit",
  "percent-encoding",
  "plist",
  "raw-window-handle",
@@ -5571,9 +5705,9 @@ dependencies = [
 
 [[package]]
 name = "tauri-build"
-version = "2.2.0"
+version = "2.4.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7a0350f0df1db385ca5c02888a83e0e66655c245b7443db8b78a70da7d7f8fc"
+checksum = "9c432ccc9ff661803dab74c6cd78de11026a578a9307610bbc39d3c55be7943f"
 dependencies = [
  "anyhow",
  "cargo_toml",
@@ -5581,21 +5715,21 @@ dependencies = [
  "glob",
  "heck 0.5.0",
  "json-patch",
- "schemars",
+ "schemars 0.8.22",
  "semver",
  "serde",
  "serde_json",
  "tauri-utils",
  "tauri-winres",
- "toml",
+ "toml 0.9.5",
  "walkdir",
 ]
 
 [[package]]
 name = "tauri-codegen"
-version = "2.2.0"
+version = "2.4.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f93f035551bf7b11b3f51ad9bc231ebbe5e085565527991c16cf326aa38cdf47"
+checksum = "1ab3a62cf2e6253936a8b267c2e95839674e7439f104fa96ad0025e149d54d8a"
 dependencies = [
  "base64 0.22.1",
  "brotli",
@@ -5620,9 +5754,9 @@ dependencies = [
 
 [[package]]
 name = "tauri-macros"
-version = "2.2.0"
+version = "2.4.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8db4df25e2d9d45de0c4c910da61cd5500190da14ae4830749fee3466dddd112"
+checksum = "4368ea8094e7045217edb690f493b55b30caf9f3e61f79b4c24b6db91f07995e"
 dependencies = [
  "heck 0.5.0",
  "proc-macro2",
@@ -5634,26 +5768,26 @@ dependencies = [
 
 [[package]]
 name = "tauri-plugin"
-version = "2.2.0"
+version = "2.4.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37a5ebe6a610d1b78a94650896e6f7c9796323f408800cef436e0fa0539de601"
+checksum = "9946a3cede302eac0c6eb6c6070ac47b1768e326092d32efbb91f21ed58d978f"
 dependencies = [
  "anyhow",
  "glob",
  "plist",
- "schemars",
+ "schemars 0.8.22",
  "serde",
  "serde_json",
  "tauri-utils",
- "toml",
+ "toml 0.9.5",
  "walkdir",
 ]
 
 [[package]]
 name = "tauri-plugin-cli"
-version = "2.2.0"
+version = "2.4.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e5458ae16eac81bdbe8d9da2a9f3e01e8cdedbc381cc1727c01127542c8a61c5"
+checksum = "53e76101cc9848adfb6a04aae48a389062be457a785bb4349ae1423ddab5a82d"
 dependencies = [
  "clap",
  "log",
@@ -5666,31 +5800,31 @@ dependencies = [
 
 [[package]]
 name = "tauri-plugin-opener"
-version = "2.2.6"
+version = "2.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2fdc6cb608e04b7d2b6d1f21e9444ad49245f6d03465ba53323d692d1ceb1a30"
+checksum = "786156aa8e89e03d271fbd3fe642207da8e65f3c961baa9e2930f332bf80a1f5"
 dependencies = [
  "dunce",
  "glob",
  "objc2-app-kit",
  "objc2-foundation 0.3.1",
  "open",
- "schemars",
+ "schemars 0.8.22",
  "serde",
  "serde_json",
  "tauri",
  "tauri-plugin",
  "thiserror 2.0.12",
  "url",
- "windows 0.60.0",
+ "windows 0.61.1",
  "zbus",
 ]
 
 [[package]]
 name = "tauri-plugin-pty"
-version = "0.1.0"
+version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "236a449e38fa57c78870114f3bace4f6f53858324212456bdc7dc7a93632dd6a"
+checksum = "5f171506c49f603fd9c15b819e78b31a0016a447cfff8260af97801236930d1d"
 dependencies = [
  "portable-pty",
  "serde",
@@ -5701,9 +5835,9 @@ dependencies = [
 
 [[package]]
 name = "tauri-plugin-window-state"
-version = "2.2.2"
+version = "2.4.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a27a3fe49de72adbe0d84aee33c89a0b059722cd0b42aaeab29eaaee7f7535cd"
+checksum = "2d5f6fe3291bfa609c7e0b0ee3bedac294d94c7018934086ce782c1d0f2a468e"
 dependencies = [
  "bitflags 2.9.0",
  "log",
@@ -5716,9 +5850,9 @@ dependencies = [
 
 [[package]]
 name = "tauri-runtime"
-version = "2.6.0"
+version = "2.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "00f004905d549854069e6774533d742b03cacfd6f03deb08940a8677586cbe39"
+checksum = "d4cfc9ad45b487d3fded5a4731a567872a4812e9552e3964161b08edabf93846"
 dependencies = [
  "cookie",
  "dpi",
@@ -5727,20 +5861,23 @@ dependencies = [
  "jni",
  "objc2 0.6.1",
  "objc2-ui-kit",
+ "objc2-web-kit",
  "raw-window-handle",
  "serde",
  "serde_json",
  "tauri-utils",
  "thiserror 2.0.12",
  "url",
+ "webkit2gtk",
+ "webview2-com",
  "windows 0.61.1",
 ]
 
 [[package]]
 name = "tauri-runtime-wry"
-version = "2.6.0"
+version = "2.8.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f85d056f4d4b014fe874814034f3416d57114b617a493a4fe552580851a3f3a2"
+checksum = "c1fe9d48bd122ff002064e88cfcd7027090d789c4302714e68fcccba0f4b7807"
 dependencies = [
  "gtk",
  "http",
@@ -5765,9 +5902,9 @@ dependencies = [
 
 [[package]]
 name = "tauri-utils"
-version = "2.4.0"
+version = "2.7.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2900399c239a471bcff7f15c4399eb1a8c4fe511ba2853e07c996d771a5e0a4"
+checksum = "41a3852fdf9a4f8fbeaa63dc3e9a85284dd6ef7200751f0bd66ceee30c93f212"
 dependencies = [
  "anyhow",
  "brotli",
@@ -5786,7 +5923,7 @@ dependencies = [
  "proc-macro2",
  "quote",
  "regex",
- "schemars",
+ "schemars 0.8.22",
  "semver",
  "serde",
  "serde-untagged",
@@ -5794,7 +5931,7 @@ dependencies = [
  "serde_with",
  "swift-rs",
  "thiserror 2.0.12",
- "toml",
+ "toml 0.9.5",
  "url",
  "urlpattern",
  "uuid",
@@ -5808,21 +5945,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "e8d321dbc6f998d825ab3f0d62673e810c861aac2d0de2cc2c395328f1d113b4"
 dependencies = [
  "embed-resource",
- "indexmap 2.9.0",
- "toml",
+ "indexmap 2.11.4",
+ "toml 0.8.22",
 ]
 
 [[package]]
 name = "tempfile"
-version = "3.19.1"
+version = "3.22.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf"
+checksum = "84fa4d11fadde498443cca10fd3ac23c951f0dc59e080e9f4b93d4df4e4eea53"
 dependencies = [
  "fastrand",
  "getrandom 0.3.2",
  "once_cell",
  "rustix 1.0.7",
- "windows-sys 0.59.0",
+ "windows-sys 0.52.0",
 ]
 
 [[package]]
@@ -5851,12 +5988,6 @@ version = "0.16.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057"
 
-[[package]]
-name = "thin-slice"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c"
-
 [[package]]
 name = "thiserror"
 version = "1.0.69"
@@ -5914,7 +6045,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40"
 dependencies = [
  "deranged",
- "itoa 1.0.15",
+ "itoa",
  "num-conv",
  "powerfmt",
  "serde",
@@ -5971,20 +6102,22 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
 
 [[package]]
 name = "tokio"
-version = "1.44.2"
+version = "1.47.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6b88822cbe49de4185e3a4cbf8321dd487cf5fe0c5c65695fef6346371e9c48"
+checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038"
 dependencies = [
  "backtrace",
  "bytes",
+ "io-uring",
  "libc",
  "mio",
  "parking_lot",
  "pin-project-lite",
  "signal-hook-registry",
- "socket2",
+ "slab",
+ "socket2 0.6.0",
  "tokio-macros",
- "windows-sys 0.52.0",
+ "windows-sys 0.59.0",
 ]
 
 [[package]]
@@ -6049,11 +6182,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "05ae329d1f08c4d17a59bed7ff5b5a769d062e64a62d34a3261b219e62cd5aae"
 dependencies = [
  "serde",
- "serde_spanned",
- "toml_datetime",
+ "serde_spanned 0.6.8",
+ "toml_datetime 0.6.9",
  "toml_edit 0.22.26",
 ]
 
+[[package]]
+name = "toml"
+version = "0.9.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "75129e1dc5000bfbaa9fee9d1b21f974f9fbad9daec557a521ee6e080825f6e8"
+dependencies = [
+ "indexmap 2.11.4",
+ "serde",
+ "serde_spanned 1.0.0",
+ "toml_datetime 0.7.0",
+ "toml_parser",
+ "toml_writer",
+ "winnow 0.7.13",
+]
+
 [[package]]
 name = "toml_datetime"
 version = "0.6.9"
@@ -6063,14 +6211,23 @@ dependencies = [
  "serde",
 ]
 
+[[package]]
+name = "toml_datetime"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bade1c3e902f58d73d3f294cd7f20391c1cb2fbcb643b73566bc773971df91e3"
+dependencies = [
+ "serde",
+]
+
 [[package]]
 name = "toml_edit"
 version = "0.19.15"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421"
 dependencies = [
- "indexmap 2.9.0",
- "toml_datetime",
+ "indexmap 2.11.4",
+ "toml_datetime 0.6.9",
  "winnow 0.5.40",
 ]
 
@@ -6080,8 +6237,8 @@ version = "0.20.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81"
 dependencies = [
- "indexmap 2.9.0",
- "toml_datetime",
+ "indexmap 2.11.4",
+ "toml_datetime 0.6.9",
  "winnow 0.5.40",
 ]
 
@@ -6091,12 +6248,21 @@ version = "0.22.26"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "310068873db2c5b3e7659d2cc35d21855dbafa50d1ce336397c666e3cb08137e"
 dependencies = [
- "indexmap 2.9.0",
+ "indexmap 2.11.4",
  "serde",
- "serde_spanned",
- "toml_datetime",
+ "serde_spanned 0.6.8",
+ "toml_datetime 0.6.9",
  "toml_write",
- "winnow 0.7.9",
+ "winnow 0.7.13",
+]
+
+[[package]]
+name = "toml_parser"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b551886f449aa90d4fe2bdaa9f4a2577ad2dde302c61ecf262d80b116db95c10"
+dependencies = [
+ "winnow 0.7.13",
 ]
 
 [[package]]
@@ -6105,6 +6271,12 @@ version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "bfb942dfe1d8e29a7ee7fcbde5bd2b9a25fb89aa70caea2eba3bee836ff41076"
 
+[[package]]
+name = "toml_writer"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fcc842091f2def52017664b53082ecbbeb5c7731092bad69d2c63050401dfd64"
+
 [[package]]
 name = "tower"
 version = "0.5.2"
@@ -6120,6 +6292,24 @@ dependencies = [
  "tower-service",
 ]
 
+[[package]]
+name = "tower-http"
+version = "0.6.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2"
+dependencies = [
+ "bitflags 2.9.0",
+ "bytes",
+ "futures-util",
+ "http",
+ "http-body",
+ "iri-string",
+ "pin-project-lite",
+ "tower",
+ "tower-layer",
+ "tower-service",
+]
+
 [[package]]
 name = "tower-layer"
 version = "0.3.3"
@@ -6165,9 +6355,9 @@ dependencies = [
 
 [[package]]
 name = "tray-icon"
-version = "0.20.1"
+version = "0.21.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f7eee98ec5c90daf179d55c20a49d8c0d043054ce7c26336c09a24d31f14fa0"
+checksum = "2da75ec677957aa21f6e0b361df0daab972f13a5bee3606de0638fd4ee1c666a"
 dependencies = [
  "crossbeam-channel",
  "dirs",
@@ -6716,15 +6906,15 @@ dependencies = [
 
 [[package]]
 name = "webview2-com"
-version = "0.37.0"
+version = "0.38.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b542b5cfbd9618c46c2784e4d41ba218c336ac70d44c55e47b251033e7d85601"
+checksum = "d4ba622a989277ef3886dd5afb3e280e3dd6d974b766118950a08f8f678ad6a4"
 dependencies = [
  "webview2-com-macros",
  "webview2-com-sys",
  "windows 0.61.1",
  "windows-core 0.61.0",
- "windows-implement 0.60.0",
+ "windows-implement",
  "windows-interface",
 ]
 
@@ -6741,9 +6931,9 @@ dependencies = [
 
 [[package]]
 name = "webview2-com-sys"
-version = "0.37.0"
+version = "0.38.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ae2d11c4a686e4409659d7891791254cf9286d3cfe0eef54df1523533d22295"
+checksum = "36695906a1b53a3bf5c4289621efedac12b73eeb0b89e7e1a89b517302d5d75c"
 dependencies = [
  "thiserror 2.0.12",
  "windows 0.61.1",
@@ -6790,7 +6980,7 @@ version = "0.1.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
 dependencies = [
- "windows-sys 0.59.0",
+ "windows-sys 0.48.0",
 ]
 
 [[package]]
@@ -6824,39 +7014,17 @@ dependencies = [
  "windows-targets 0.52.6",
 ]
 
-[[package]]
-name = "windows"
-version = "0.60.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ddf874e74c7a99773e62b1c671427abf01a425e77c3d3fb9fb1e4883ea934529"
-dependencies = [
- "windows-collections 0.1.1",
- "windows-core 0.60.1",
- "windows-future 0.1.1",
- "windows-link",
- "windows-numerics 0.1.1",
-]
-
 [[package]]
 name = "windows"
 version = "0.61.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "c5ee8f3d025738cb02bad7868bbb5f8a6327501e870bf51f1b455b0a2454a419"
 dependencies = [
- "windows-collections 0.2.0",
+ "windows-collections",
  "windows-core 0.61.0",
- "windows-future 0.2.0",
+ "windows-future",
  "windows-link",
- "windows-numerics 0.2.0",
-]
-
-[[package]]
-name = "windows-collections"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5467f79cc1ba3f52ebb2ed41dbb459b8e7db636cc3429458d9a852e15bc24dec"
-dependencies = [
- "windows-core 0.60.1",
+ "windows-numerics",
 ]
 
 [[package]]
@@ -6877,40 +7045,17 @@ dependencies = [
  "windows-targets 0.52.6",
 ]
 
-[[package]]
-name = "windows-core"
-version = "0.60.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca21a92a9cae9bf4ccae5cf8368dce0837100ddf6e6d57936749e85f152f6247"
-dependencies = [
- "windows-implement 0.59.0",
- "windows-interface",
- "windows-link",
- "windows-result",
- "windows-strings 0.3.1",
-]
-
 [[package]]
 name = "windows-core"
 version = "0.61.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980"
 dependencies = [
- "windows-implement 0.60.0",
+ "windows-implement",
  "windows-interface",
  "windows-link",
  "windows-result",
- "windows-strings 0.4.0",
-]
-
-[[package]]
-name = "windows-future"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a787db4595e7eb80239b74ce8babfb1363d8e343ab072f2ffe901400c03349f0"
-dependencies = [
- "windows-core 0.60.1",
- "windows-link",
+ "windows-strings",
 ]
 
 [[package]]
@@ -6923,17 +7068,6 @@ dependencies = [
  "windows-link",
 ]
 
-[[package]]
-name = "windows-implement"
-version = "0.59.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "83577b051e2f49a058c308f17f273b570a6a758386fc291b5f6a934dd84e48c1"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.101",
-]
-
 [[package]]
 name = "windows-implement"
 version = "0.60.0"
@@ -6962,16 +7096,6 @@ version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38"
 
-[[package]]
-name = "windows-numerics"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "005dea54e2f6499f2cee279b8f703b3cf3b5734a2d8d21867c8f44003182eeed"
-dependencies = [
- "windows-core 0.60.1",
- "windows-link",
-]
-
 [[package]]
 name = "windows-numerics"
 version = "0.2.0"
@@ -6982,17 +7106,6 @@ dependencies = [
  "windows-link",
 ]
 
-[[package]]
-name = "windows-registry"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3"
-dependencies = [
- "windows-result",
- "windows-strings 0.3.1",
- "windows-targets 0.53.0",
-]
-
 [[package]]
 name = "windows-result"
 version = "0.3.2"
@@ -7002,15 +7115,6 @@ dependencies = [
  "windows-link",
 ]
 
-[[package]]
-name = "windows-strings"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319"
-dependencies = [
- "windows-link",
-]
-
 [[package]]
 name = "windows-strings"
 version = "0.4.0"
@@ -7056,6 +7160,15 @@ dependencies = [
  "windows-targets 0.52.6",
 ]
 
+[[package]]
+name = "windows-sys"
+version = "0.60.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
+dependencies = [
+ "windows-targets 0.53.2",
+]
+
 [[package]]
 name = "windows-targets"
 version = "0.42.2"
@@ -7104,9 +7217,9 @@ dependencies = [
 
 [[package]]
 name = "windows-targets"
-version = "0.53.0"
+version = "0.53.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b"
+checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef"
 dependencies = [
  "windows_aarch64_gnullvm 0.53.0",
  "windows_aarch64_msvc 0.53.0",
@@ -7318,9 +7431,9 @@ dependencies = [
 
 [[package]]
 name = "winnow"
-version = "0.7.9"
+version = "0.7.13"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d9fb597c990f03753e08d3c29efbfcf2019a003b4bf4ba19225c158e1549f0f3"
+checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf"
 dependencies = [
  "memchr",
 ]
@@ -7383,14 +7496,15 @@ checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51"
 
 [[package]]
 name = "wry"
-version = "0.51.2"
+version = "0.53.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c886a0a9d2a94fd90cfa1d929629b79cfefb1546e2c7430c63a47f0664c0e4e2"
+checksum = "31f0e9642a0d061f6236c54ccae64c2722a7879ad4ec7dff59bd376d446d8e90"
 dependencies = [
  "base64 0.22.1",
  "block2 0.6.1",
  "cookie",
  "crossbeam-channel",
+ "dirs",
  "dpi",
  "dunce",
  "gdkx11",
@@ -7446,16 +7560,6 @@ dependencies = [
  "pkg-config",
 ]
 
-[[package]]
-name = "xdg-home"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6"
-dependencies = [
- "libc",
- "windows-sys 0.59.0",
-]
-
 [[package]]
 name = "xml-rs"
 version = "0.8.26"
@@ -7464,9 +7568,9 @@ checksum = "a62ce76d9b56901b19a74f19431b0d8b3bc7ca4ad685a746dfd78ca8f4fc6bda"
 
 [[package]]
 name = "yaml-rust2"
-version = "0.10.1"
+version = "0.10.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "818913695e83ece1f8d2a1c52d54484b7b46d0f9c06beeb2649b9da50d9b512d"
+checksum = "2462ea039c445496d8793d052e13787f2b90e750b833afee748e601c17621ed9"
 dependencies = [
  "arraydeque",
  "encoding_rs",
@@ -7499,13 +7603,12 @@ dependencies = [
 
 [[package]]
 name = "zbus"
-version = "5.5.0"
+version = "5.10.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59c333f648ea1b647bc95dc1d34807c8e25ed7a6feff3394034dc4776054b236"
+checksum = "67a073be99ace1adc48af593701c8015cd9817df372e14a1a6b0ee8f8bf043be"
 dependencies = [
  "async-broadcast",
  "async-executor",
- "async-fs",
  "async-io",
  "async-lock",
  "async-process",
@@ -7518,16 +7621,14 @@ dependencies = [
  "futures-core",
  "futures-lite",
  "hex",
- "nix 0.29.0",
+ "nix 0.30.1",
  "ordered-stream",
  "serde",
  "serde_repr",
- "static_assertions",
  "tracing",
  "uds_windows",
- "windows-sys 0.59.0",
- "winnow 0.7.9",
- "xdg-home",
+ "windows-sys 0.60.2",
+ "winnow 0.7.13",
  "zbus_macros",
  "zbus_names",
  "zvariant",
@@ -7535,9 +7636,9 @@ dependencies = [
 
 [[package]]
 name = "zbus_macros"
-version = "5.5.0"
+version = "5.10.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f325ad10eb0d0a3eb060203494c3b7ec3162a01a59db75d2deee100339709fc0"
+checksum = "0e80cd713a45a49859dcb648053f63265f4f2851b6420d47a958e5697c68b131"
 dependencies = [
  "proc-macro-crate 3.3.0",
  "proc-macro2",
@@ -7556,7 +7657,7 @@ checksum = "7be68e64bf6ce8db94f63e72f0c7eb9a60d733f7e0499e628dfab0f84d6bcb97"
 dependencies = [
  "serde",
  "static_assertions",
- "winnow 0.7.9",
+ "winnow 0.7.13",
  "zvariant",
 ]
 
@@ -7657,24 +7758,23 @@ checksum = "868b928d7949e09af2f6086dfc1e01936064cc7a819253bce650d4e2a2d63ba8"
 
 [[package]]
 name = "zvariant"
-version = "5.4.0"
+version = "5.7.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2df9ee044893fcffbdc25de30546edef3e32341466811ca18421e3cd6c5a3ac"
+checksum = "999dd3be73c52b1fccd109a4a81e4fcd20fab1d3599c8121b38d04e1419498db"
 dependencies = [
  "endi",
  "enumflags2",
  "serde",
- "static_assertions",
- "winnow 0.7.9",
+ "winnow 0.7.13",
  "zvariant_derive",
  "zvariant_utils",
 ]
 
 [[package]]
 name = "zvariant_derive"
-version = "5.4.0"
+version = "5.7.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "74170caa85b8b84cc4935f2d56a57c7a15ea6185ccdd7eadb57e6edd90f94b2f"
+checksum = "6643fd0b26a46d226bd90d3f07c1b5321fe9bb7f04673cb37ac6d6883885b68e"
 dependencies = [
  "proc-macro-crate 3.3.0",
  "proc-macro2",
@@ -7694,5 +7794,5 @@ dependencies = [
  "serde",
  "static_assertions",
  "syn 2.0.101",
- "winnow 0.7.9",
+ "winnow 0.7.13",
 ]
diff --git a/pdl-live-react/src-tauri/Cargo.toml b/pdl-live-react/src-tauri/Cargo.toml
index 2ac9ef147..233c6a651 100644
--- a/pdl-live-react/src-tauri/Cargo.toml
+++ b/pdl-live-react/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "pdl"
-version = "0.7.0"
+version = "0.8.0"
 description = "Prompt Declaration Language"
 authors = ["nickm@us.ibm.com"]
 edition = "2024"
@@ -14,6 +14,9 @@ edition = "2024"
 name = "tauri_app_lib"
 crate-type = ["staticlib", "cdylib", "rlib"]
 
+[features]
+interpreter = ["dep:rustpython-vm", "dep:rustpython-stdlib", "dep:rustpython-pylib"]
+
 [build-dependencies]
 tauri-build = { version = "2", features = [] }
 
@@ -26,7 +29,7 @@ serde = { version = "1", features = ["derive"] }
 serde_json = "1"
 urlencoding = "2.1.3"
 tempfile = "3.16.0"
-duct = "0.13.7"
+duct = "1.0.0"
 rayon = "1.10.0"
 yaml-rust2 = "0.10.0"
 futures = "0.3.31"
@@ -37,18 +40,18 @@ serde_norway = "0.9.42"
 minijinja = { version = "2.9.0", features = ["custom_syntax"] }
 ollama-rs = { version = "0.3.1", features = ["stream"] }
 owo-colors = "4.2.0"
-rustpython-vm = { git="https://github.com/RustPython/RustPython.git", features= ["importlib", "threading", "encodings"] } # "0.4.0"
+rustpython-vm = { git="https://github.com/RustPython/RustPython.git", features= ["importlib", "threading", "encodings"], optional = true } # "0.4.0"
 async-recursion = "1.1.1"
 tokio-stream = "0.1.17"
 tokio = { version = "1.44.1", features = ["io-std"] }
 indexmap = { version = "2.9.0", features = ["serde"] }
-rustpython-stdlib = { git="https://github.com/RustPython/RustPython.git", features = ["ssl-vendor"] } # 0.4.0
-rustpython-pylib = { git="https://github.com/RustPython/RustPython.git", features = ["freeze-stdlib"] } # 0.4.0
+rustpython-stdlib = { git="https://github.com/RustPython/RustPython.git", features = ["ssl-vendor"], optional = true } # 0.4.0
+rustpython-pylib = { git="https://github.com/RustPython/RustPython.git", features = ["freeze-stdlib"], optional = true } # 0.4.0
 schemars = "0.8.22"
 fs4 = "0.13.1"
 derive_builder = "0.20.2"
 iana-time-zone = "0.1.63"
-async-openai = "0.28.1"
+async-openai = "0.29.0"
 regex = "1.11.1"
 
 [target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
diff --git a/pdl-live-react/src-tauri/src/cli.rs b/pdl-live-react/src-tauri/src/cli.rs
index a85a6b6fd..9aba03a0e 100644
--- a/pdl-live-react/src-tauri/src/cli.rs
+++ b/pdl-live-react/src-tauri/src/cli.rs
@@ -5,6 +5,7 @@ use urlencoding::encode;
 
 use crate::compile;
 use crate::gui::new_window;
+#[cfg(feature = "interpreter")]
 use crate::pdl::interpreter::{RunOptions, load_scope, run_file_sync};
 
 #[cfg(desktop)]
@@ -49,6 +50,7 @@ pub fn setup(app: &mut tauri::App) -> Result>
                 _ => Err(Box::from("Unsupported compile command")),
             }
         }
+        #[cfg(feature = "interpreter")]
         "run" => run_file_sync(
             subcommand_args
                 .get("source")
diff --git a/pdl-live-react/src-tauri/src/commands/mod.rs b/pdl-live-react/src-tauri/src/commands/mod.rs
index 5c98f7441..f78e96cdd 100644
--- a/pdl-live-react/src-tauri/src/commands/mod.rs
+++ b/pdl-live-react/src-tauri/src/commands/mod.rs
@@ -1,3 +1,5 @@
+#[cfg(feature = "interpreter")]
 pub mod interpreter;
+
 pub mod read_trace;
 pub mod replay_prep;
diff --git a/pdl-live-react/src-tauri/src/lib.rs b/pdl-live-react/src-tauri/src/lib.rs
index 86b0b444c..1589720de 100644
--- a/pdl-live-react/src-tauri/src/lib.rs
+++ b/pdl-live-react/src-tauri/src/lib.rs
@@ -33,6 +33,7 @@ pub fn run() {
         .invoke_handler(tauri::generate_handler![
             commands::read_trace::read_trace,
             commands::replay_prep::replay_prep,
+            #[cfg(feature = "interpreter")]
             commands::interpreter::run_pdl_program,
         ])
         .run(tauri::generate_context!())
diff --git a/pdl-live-react/src-tauri/src/pdl/mod.rs b/pdl-live-react/src-tauri/src/pdl/mod.rs
index 179cb9e10..b8580f387 100644
--- a/pdl-live-react/src-tauri/src/pdl/mod.rs
+++ b/pdl-live-react/src-tauri/src/pdl/mod.rs
@@ -1,6 +1,8 @@
 pub mod ast;
 pub mod extract;
+#[cfg(feature = "interpreter")]
 pub mod interpreter;
+#[cfg(feature = "interpreter")]
 mod interpreter_tests;
 pub mod pip;
 pub mod pull;
diff --git a/pdl-live-react/src/demos/demo1.json b/pdl-live-react/src/demos/demo1.json
index c3ae5059e..f61d0dfdd 100644
--- a/pdl-live-react/src/demos/demo1.json
+++ b/pdl-live-react/src/demos/demo1.json
@@ -1 +1 @@
-{"kind": "text", "pdl__id": "text", "description": "Simple LLM interaction", "defs": {}, "context": "dependent", "text": [{"kind": "data", "pdl__id": "text.0", "defs": {}, "data": {"pdl__expr": "write a hello world example, and explain to me how to run it", "pdl__result": "write a hello world example, and explain to me how to run it"}, "pdl__result": "write a hello world example, and explain to me how to run it", "pdl__timing": {"start_nanos": 1750789936107628000, "end_nanos": 1750789936108899000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "model", "pdl__id": "text.1.model", "pdl__context": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}], "defs": {}, "platform": "litellm", "model": {"pdl__expr": "ollama_chat/granite3.2:2b", "pdl__result": "ollama_chat/granite3.2:2b"}, "input": {"kind": "data", "pdl__id": "text.1.model", "defs": {}, "data": {"pdl__expr": "${ pdl_context }", "pdl__result": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}]}, "pdl__result": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}], "pdl__timing": {"start_nanos": 1750789936205506000, "end_nanos": 1750789936206408000, "timezone": "EDT"}, "pdl__is_leaf": true}, "parameters": {"pdl__expr": null}, "pdl__usage": {"completion_tokens": 496, "prompt_tokens": 21}, "pdl__model_input": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}], "pdl__result": "Sure, I'd be happy to help with that! Here's a simple \"Hello, World!\" program in Python, which is one of the most popular programming languages:\n\n```python\nprint(\"Hello, World!\")\n```\n\nThis single line of code will output the text \"Hello, World!\" when run.\n\nTo run this Python script, follow these steps:\n\n1. **Install Python**: If you haven't already installed Python on your computer, download and install it from the official website (https://www.python.org/downloads/). Make sure to select the option that includes the Python interpreter during installation.\n\n2. **Create a new file**: Open a text editor or an Integrated Development Environment (IDE) like Visual Studio Code, PyCharm, or even Notepad on Windows. Create a new file and save it with a `.py` extension, for example, `hello_world.py`.\n\n3. **Copy the Python code**: Copy the \"Hello, World!\" script provided above into your newly created text file.\n\n4. **Open a terminal/command prompt**: On Windows, press `Win + R`, type `cmd`, and hit Enter to open Command Prompt. On macOS or Linux, use `Terminal`.\n\n5. **Navigate to the directory containing your Python file**: Use the `cd` command (for Unix-based systems) or `cd` followed by the path (for Windows) to change into the folder where you saved `hello_world.py`. For example:\n\n   - On Unix/Linux:\n     ```\n     cd /path/to/your/directory\n     ```\n   - On macOS:\n     ```\n     cd ~/Desktop\n     ```\n\n6. **Run the Python script**: Type `python hello_world.py` and press Enter. If everything is set up correctly, you should see \"Hello, World!\" printed in your terminal or command prompt.\n\nHere's what happens under the hood:\n\n- When you run a `.py` file, the Python interpreter reads it line by line.\n- The first line of code (`print(\"Hello, World!\")`) tells the interpreter to display the text \"Hello, World!\" on the screen.\n- The `print()` function is a built-in Python function that outputs the specified string (enclosed in quotes) to the console or terminal.\n- After executing this line, the program ends, and control returns to the command prompt or terminal.\n\nThat's it! You've just run your first \"Hello, World!\" program using Python.", "pdl__timing": {"start_nanos": 1750789936205261000, "end_nanos": 1750789973932310000, "timezone": "EDT"}, "pdl__is_leaf": true}], "pdl__result": "write a hello world example, and explain to me how to run itSure, I'd be happy to help with that! Here's a simple \"Hello, World!\" program in Python, which is one of the most popular programming languages:\n\n```python\nprint(\"Hello, World!\")\n```\n\nThis single line of code will output the text \"Hello, World!\" when run.\n\nTo run this Python script, follow these steps:\n\n1. **Install Python**: If you haven't already installed Python on your computer, download and install it from the official website (https://www.python.org/downloads/). Make sure to select the option that includes the Python interpreter during installation.\n\n2. **Create a new file**: Open a text editor or an Integrated Development Environment (IDE) like Visual Studio Code, PyCharm, or even Notepad on Windows. Create a new file and save it with a `.py` extension, for example, `hello_world.py`.\n\n3. **Copy the Python code**: Copy the \"Hello, World!\" script provided above into your newly created text file.\n\n4. **Open a terminal/command prompt**: On Windows, press `Win + R`, type `cmd`, and hit Enter to open Command Prompt. On macOS or Linux, use `Terminal`.\n\n5. **Navigate to the directory containing your Python file**: Use the `cd` command (for Unix-based systems) or `cd` followed by the path (for Windows) to change into the folder where you saved `hello_world.py`. For example:\n\n   - On Unix/Linux:\n     ```\n     cd /path/to/your/directory\n     ```\n   - On macOS:\n     ```\n     cd ~/Desktop\n     ```\n\n6. **Run the Python script**: Type `python hello_world.py` and press Enter. If everything is set up correctly, you should see \"Hello, World!\" printed in your terminal or command prompt.\n\nHere's what happens under the hood:\n\n- When you run a `.py` file, the Python interpreter reads it line by line.\n- The first line of code (`print(\"Hello, World!\")`) tells the interpreter to display the text \"Hello, World!\" on the screen.\n- The `print()` function is a built-in Python function that outputs the specified string (enclosed in quotes) to the console or terminal.\n- After executing this line, the program ends, and control returns to the command prompt or terminal.\n\nThat's it! You've just run your first \"Hello, World!\" program using Python.", "pdl__timing": {"start_nanos": 1750789936010969000, "end_nanos": 1750789973932402000, "timezone": "EDT"}, "pdl__is_leaf": false}
\ No newline at end of file
+{"kind": "text", "pdl__id": "text", "description": "Simple LLM interaction", "defs": {}, "context": "dependent", "text": [{"kind": "data", "pdl__id": "text.0", "defs": {}, "data": {"pdl__expr": "write a hello world example, and explain to me how to run it", "pdl__result": "write a hello world example, and explain to me how to run it"}, "pdl__result": "write a hello world example, and explain to me how to run it", "requirements": [], "pdl__timing": {"start_nanos": 1758570216694012000, "end_nanos": 1758570216695189000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "model", "pdl__id": "text.1.model", "pdl__context": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}], "defs": {}, "platform": "litellm", "model": {"pdl__expr": "ollama_chat/granite3.2:2b", "pdl__result": "ollama_chat/granite3.2:2b"}, "input": {"kind": "data", "pdl__id": "text.1.model.input", "defs": {}, "data": {"pdl__expr": "${ pdl_context }", "pdl__result": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}]}, "pdl__result": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}], "requirements": [], "pdl__timing": {"start_nanos": 1758570216730835000, "end_nanos": 1758570216731675000, "timezone": "EDT"}, "pdl__is_leaf": true}, "parameters": {"pdl__expr": null}, "pdl__usage": {"completion_tokens": 538, "prompt_tokens": 57}, "pdl__model_input": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}], "pdl__result": "Sure, I'd be happy to help with that! Here's a simple \"Hello, World!\" program in Python, which is one of the most popular programming languages:\n\n```python\nprint(\"Hello, World!\")\n```\n\nThis single line of code will output the text \"Hello, World!\" when run.\n\nTo run this Python script, follow these steps:\n\n1. **Install Python**: If you haven't already installed Python on your computer, download and install it from the official website (https://www.python.org/downloads/). Make sure to select the option that includes the Python interpreter during installation.\n\n2. **Create a new file**: Open a text editor or an Integrated Development Environment (IDE) like Visual Studio Code, PyCharm, or even Notepad on Windows. Create a new file and save it with a `.py` extension, for example, `hello_world.py`.\n\n3. **Copy the Python code**: Copy the \"Hello, World!\" script provided above into your newly created text file.\n\n4. **Open a terminal/command prompt**: On Windows, press `Win + R`, type `cmd`, and hit Enter to open Command Prompt. On macOS or Linux, use `Terminal`.\n\n5. **Navigate to the directory containing your Python file**: Use the `cd` command (for Unix-based systems) or `cd` followed by the path (for Windows) to change into the folder where you saved `hello_world.py`. For example:\n\n   - On Unix/Linux:\n     ```\n     cd /path/to/your/directory\n     ```\n   - On macOS:\n     ```\n     cd ~/Desktop\n     ```\n\n6. **Run the Python script**: Type `python hello_world.py` and press Enter. If everything is set up correctly, you should see \"Hello, World!\" printed in your terminal or command prompt.\n\nHere's what happens under the hood:\n\n- When you run a `.py` file, the Python interpreter reads it line by line.\n- The first line of code (`print(\"Hello, World!\")`) tells the interpreter to display the text \"Hello, World!\" on the screen.\n- The `print()` function is a built-in Python function that outputs the specified string (enclosed in quotes) to the console or terminal.\n- After executing this line, the program ends, and control returns to the command prompt or terminal.\n\nThat's it! You've just run your first \"Hello, World!\" program using Python.", "requirements": [], "pdl__timing": {"start_nanos": 1758570216730640000, "end_nanos": 1758570261196400000, "timezone": "EDT"}, "pdl__is_leaf": true}], "pdl__result": "write a hello world example, and explain to me how to run itSure, I'd be happy to help with that! Here's a simple \"Hello, World!\" program in Python, which is one of the most popular programming languages:\n\n```python\nprint(\"Hello, World!\")\n```\n\nThis single line of code will output the text \"Hello, World!\" when run.\n\nTo run this Python script, follow these steps:\n\n1. **Install Python**: If you haven't already installed Python on your computer, download and install it from the official website (https://www.python.org/downloads/). Make sure to select the option that includes the Python interpreter during installation.\n\n2. **Create a new file**: Open a text editor or an Integrated Development Environment (IDE) like Visual Studio Code, PyCharm, or even Notepad on Windows. Create a new file and save it with a `.py` extension, for example, `hello_world.py`.\n\n3. **Copy the Python code**: Copy the \"Hello, World!\" script provided above into your newly created text file.\n\n4. **Open a terminal/command prompt**: On Windows, press `Win + R`, type `cmd`, and hit Enter to open Command Prompt. On macOS or Linux, use `Terminal`.\n\n5. **Navigate to the directory containing your Python file**: Use the `cd` command (for Unix-based systems) or `cd` followed by the path (for Windows) to change into the folder where you saved `hello_world.py`. For example:\n\n   - On Unix/Linux:\n     ```\n     cd /path/to/your/directory\n     ```\n   - On macOS:\n     ```\n     cd ~/Desktop\n     ```\n\n6. **Run the Python script**: Type `python hello_world.py` and press Enter. If everything is set up correctly, you should see \"Hello, World!\" printed in your terminal or command prompt.\n\nHere's what happens under the hood:\n\n- When you run a `.py` file, the Python interpreter reads it line by line.\n- The first line of code (`print(\"Hello, World!\")`) tells the interpreter to display the text \"Hello, World!\" on the screen.\n- The `print()` function is a built-in Python function that outputs the specified string (enclosed in quotes) to the console or terminal.\n- After executing this line, the program ends, and control returns to the command prompt or terminal.\n\nThat's it! You've just run your first \"Hello, World!\" program using Python.", "requirements": [], "pdl__timing": {"start_nanos": 1758570216693909000, "end_nanos": 1758570219892773000, "timezone": "EDT"}, "pdl__is_leaf": false}
\ No newline at end of file
diff --git a/pdl-live-react/src/demos/demo2.json b/pdl-live-react/src/demos/demo2.json
index 868bc2770..ea470b18a 100644
--- a/pdl-live-react/src/demos/demo2.json
+++ b/pdl-live-react/src/demos/demo2.json
@@ -1 +1 @@
-{"kind": "text", "pdl__id": "text", "description": "Model chaining", "defs": {}, "context": "dependent", "text": [{"kind": "data", "pdl__id": "text.0", "defs": {}, "data": {"pdl__expr": "write a hello world example, and explain to me how to run it", "pdl__result": "write a hello world example, and explain to me how to run it"}, "pdl__result": "write a hello world example, and explain to me how to run it", "pdl__timing": {"start_nanos": 1750789975739696000, "end_nanos": 1750789975740984000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "model", "pdl__id": "text.1.model", "pdl__context": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}], "defs": {}, "platform": "litellm", "model": {"pdl__expr": "ollama_chat/granite3.2:2b", "pdl__result": "ollama_chat/granite3.2:2b"}, "input": {"kind": "data", "pdl__id": "text.1.model", "defs": {}, "data": {"pdl__expr": "${ pdl_context }", "pdl__result": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}]}, "pdl__result": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}], "pdl__timing": {"start_nanos": 1750789975831792000, "end_nanos": 1750789975832639000, "timezone": "EDT"}, "pdl__is_leaf": true}, "parameters": {"pdl__expr": {"timeout": null, "temperature": 0.0, "top_p": null, "n": null, "stop": null, "max_tokens": null, "presence_penalty": null, "frequency_penalty": null, "logit_bias": null, "user": null, "response_format": null, "seed": null, "tools": null, "tool_choice": null, "logprobs": null, "top_logprobs": null, "parallel_tool_calls": null, "extra_headers": null, "functions": null, "function_call": null, "base_url": null, "api_version": null, "api_key": null, "model_list": null, "mock_response": null, "custom_llm_provider": null, "max_retries": null}, "pdl__result": {"timeout": null, "temperature": 0.0, "top_p": null, "n": null, "stop": null, "max_tokens": null, "presence_penalty": null, "frequency_penalty": null, "logit_bias": null, "user": null, "response_format": null, "seed": null, "tools": null, "tool_choice": null, "logprobs": null, "top_logprobs": null, "parallel_tool_calls": null, "extra_headers": null, "functions": null, "function_call": null, "base_url": null, "api_version": null, "api_key": null, "model_list": null, "mock_response": null, "custom_llm_provider": null, "max_retries": null}}, "pdl__usage": {"completion_tokens": 534, "prompt_tokens": 21}, "pdl__model_input": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}], "pdl__result": "Sure, I'd be happy to help with that! Here's a simple \"Hello, World!\" program in Python, which is one of the most popular programming languages:\n\n```python\nprint(\"Hello, World!\")\n```\n\nTo run this code, follow these steps:\n\n1. **Install Python**: If you haven't already, download and install Python from its official website (https://www.python.org/). Make sure to check the box for \"Add Python to PATH\" during installation; this step is crucial as it allows your system to find the Python executable in any directory.\n\n2. **Open a Text Editor**: Use a text editor like Notepad (on Windows), TextEdit (on macOS), or Visual Studio Code, Sublime Text, Atom, etc., for writing your code.\n\n3. **Write Your Code**: Copy and paste the Python code above into your text editor. Save this file with a `.py` extension, for example, `hello_world.py`. You can name it anything you like, but using `.py` ensures that the file is recognized as a Python script.\n\n4. **Open Command Prompt/Terminal**: On Windows, press `Win + R`, type `cmd`, and hit Enter. On macOS or Linux, open Terminal from Applications > Utilities (macOS) or Spotlight Search (Linux).\n\n5. **Navigate to the Directory**: In the command prompt or terminal window, navigate to the directory where you saved your Python file using the `cd` command followed by the path to that folder. For example:\n\n   ```\n   cd C:\\Users\\YourUsername\\Documents\n   ```\n\n   Or on macOS/Linux:\n\n   ```\n   cd ~/Documents\n   ```\n\n6. **Run Your Script**: Type `python hello_world.py` and press Enter. If everything is set up correctly, you should see the output \"Hello, World!\" displayed in your terminal or command prompt.\n\nHere's what happens under the hood:\n\n- When Python encounters the line `print(\"Hello, World!\")`, it interprets this as a command to display the string \"Hello, World!\" on the console.\n- The `python` command at the end of your terminal/command prompt invocation tells the system to use its built-in Python interpreter (or any other Python version you have installed) to run the script.\n- The Python interpreter reads each line in your file, executes it, and prints the result to the console. In this case, it prints \"Hello, World!\".\n\nThat's it! You've just written and executed a simple \"Hello, World!\" program using Python. This is a great starting point for learning programming concepts.", "pdl__timing": {"start_nanos": 1750789975830109000, "end_nanos": 1750790014446954000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "data", "pdl__id": "text.2", "defs": {}, "data": {"pdl__expr": "how about in Rust?", "pdl__result": "how about in Rust?"}, "pdl__result": "how about in Rust?", "pdl__timing": {"start_nanos": 1750790014447055000, "end_nanos": 1750790014447174000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "model", "pdl__id": "text.3.model", "pdl__context": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}, {"content": "Sure, I'd be happy to help with that! Here's a simple \"Hello, World!\" program in Python, which is one of the most popular programming languages:\n\n```python\nprint(\"Hello, World!\")\n```\n\nTo run this code, follow these steps:\n\n1. **Install Python**: If you haven't already, download and install Python from its official website (https://www.python.org/). Make sure to check the box for \"Add Python to PATH\" during installation; this step is crucial as it allows your system to find the Python executable in any directory.\n\n2. **Open a Text Editor**: Use a text editor like Notepad (on Windows), TextEdit (on macOS), or Visual Studio Code, Sublime Text, Atom, etc., for writing your code.\n\n3. **Write Your Code**: Copy and paste the Python code above into your text editor. Save this file with a `.py` extension, for example, `hello_world.py`. You can name it anything you like, but using `.py` ensures that the file is recognized as a Python script.\n\n4. **Open Command Prompt/Terminal**: On Windows, press `Win + R`, type `cmd`, and hit Enter. On macOS or Linux, open Terminal from Applications > Utilities (macOS) or Spotlight Search (Linux).\n\n5. **Navigate to the Directory**: In the command prompt or terminal window, navigate to the directory where you saved your Python file using the `cd` command followed by the path to that folder. For example:\n\n   ```\n   cd C:\\Users\\YourUsername\\Documents\n   ```\n\n   Or on macOS/Linux:\n\n   ```\n   cd ~/Documents\n   ```\n\n6. **Run Your Script**: Type `python hello_world.py` and press Enter. If everything is set up correctly, you should see the output \"Hello, World!\" displayed in your terminal or command prompt.\n\nHere's what happens under the hood:\n\n- When Python encounters the line `print(\"Hello, World!\")`, it interprets this as a command to display the string \"Hello, World!\" on the console.\n- The `python` command at the end of your terminal/command prompt invocation tells the system to use its built-in Python interpreter (or any other Python version you have installed) to run the script.\n- The Python interpreter reads each line in your file, executes it, and prints the result to the console. In this case, it prints \"Hello, World!\".\n\nThat's it! You've just written and executed a simple \"Hello, World!\" program using Python. This is a great starting point for learning programming concepts.", "role": "assistant", "pdl__defsite": "text.1.model"}, {"role": "user", "content": "how about in Rust?", "pdl__defsite": "text.2"}], "defs": {}, "platform": "litellm", "model": {"pdl__expr": "ollama_chat/granite3.2:2b", "pdl__result": "ollama_chat/granite3.2:2b"}, "input": {"kind": "data", "pdl__id": "text.3.model", "defs": {}, "data": {"pdl__expr": "${ pdl_context }", "pdl__result": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}, {"content": "Sure, I'd be happy to help with that! Here's a simple \"Hello, World!\" program in Python, which is one of the most popular programming languages:\n\n```python\nprint(\"Hello, World!\")\n```\n\nTo run this code, follow these steps:\n\n1. **Install Python**: If you haven't already, download and install Python from its official website (https://www.python.org/). Make sure to check the box for \"Add Python to PATH\" during installation; this step is crucial as it allows your system to find the Python executable in any directory.\n\n2. **Open a Text Editor**: Use a text editor like Notepad (on Windows), TextEdit (on macOS), or Visual Studio Code, Sublime Text, Atom, etc., for writing your code.\n\n3. **Write Your Code**: Copy and paste the Python code above into your text editor. Save this file with a `.py` extension, for example, `hello_world.py`. You can name it anything you like, but using `.py` ensures that the file is recognized as a Python script.\n\n4. **Open Command Prompt/Terminal**: On Windows, press `Win + R`, type `cmd`, and hit Enter. On macOS or Linux, open Terminal from Applications > Utilities (macOS) or Spotlight Search (Linux).\n\n5. **Navigate to the Directory**: In the command prompt or terminal window, navigate to the directory where you saved your Python file using the `cd` command followed by the path to that folder. For example:\n\n   ```\n   cd C:\\Users\\YourUsername\\Documents\n   ```\n\n   Or on macOS/Linux:\n\n   ```\n   cd ~/Documents\n   ```\n\n6. **Run Your Script**: Type `python hello_world.py` and press Enter. If everything is set up correctly, you should see the output \"Hello, World!\" displayed in your terminal or command prompt.\n\nHere's what happens under the hood:\n\n- When Python encounters the line `print(\"Hello, World!\")`, it interprets this as a command to display the string \"Hello, World!\" on the console.\n- The `python` command at the end of your terminal/command prompt invocation tells the system to use its built-in Python interpreter (or any other Python version you have installed) to run the script.\n- The Python interpreter reads each line in your file, executes it, and prints the result to the console. In this case, it prints \"Hello, World!\".\n\nThat's it! You've just written and executed a simple \"Hello, World!\" program using Python. This is a great starting point for learning programming concepts.", "role": "assistant", "pdl__defsite": "text.1.model"}, {"role": "user", "content": "how about in Rust?", "pdl__defsite": "text.2"}]}, "pdl__result": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}, {"content": "Sure, I'd be happy to help with that! Here's a simple \"Hello, World!\" program in Python, which is one of the most popular programming languages:\n\n```python\nprint(\"Hello, World!\")\n```\n\nTo run this code, follow these steps:\n\n1. **Install Python**: If you haven't already, download and install Python from its official website (https://www.python.org/). Make sure to check the box for \"Add Python to PATH\" during installation; this step is crucial as it allows your system to find the Python executable in any directory.\n\n2. **Open a Text Editor**: Use a text editor like Notepad (on Windows), TextEdit (on macOS), or Visual Studio Code, Sublime Text, Atom, etc., for writing your code.\n\n3. **Write Your Code**: Copy and paste the Python code above into your text editor. Save this file with a `.py` extension, for example, `hello_world.py`. You can name it anything you like, but using `.py` ensures that the file is recognized as a Python script.\n\n4. **Open Command Prompt/Terminal**: On Windows, press `Win + R`, type `cmd`, and hit Enter. On macOS or Linux, open Terminal from Applications > Utilities (macOS) or Spotlight Search (Linux).\n\n5. **Navigate to the Directory**: In the command prompt or terminal window, navigate to the directory where you saved your Python file using the `cd` command followed by the path to that folder. For example:\n\n   ```\n   cd C:\\Users\\YourUsername\\Documents\n   ```\n\n   Or on macOS/Linux:\n\n   ```\n   cd ~/Documents\n   ```\n\n6. **Run Your Script**: Type `python hello_world.py` and press Enter. If everything is set up correctly, you should see the output \"Hello, World!\" displayed in your terminal or command prompt.\n\nHere's what happens under the hood:\n\n- When Python encounters the line `print(\"Hello, World!\")`, it interprets this as a command to display the string \"Hello, World!\" on the console.\n- The `python` command at the end of your terminal/command prompt invocation tells the system to use its built-in Python interpreter (or any other Python version you have installed) to run the script.\n- The Python interpreter reads each line in your file, executes it, and prints the result to the console. In this case, it prints \"Hello, World!\".\n\nThat's it! You've just written and executed a simple \"Hello, World!\" program using Python. This is a great starting point for learning programming concepts.", "role": "assistant", "pdl__defsite": "text.1.model"}, {"role": "user", "content": "how about in Rust?", "pdl__defsite": "text.2"}], "pdl__timing": {"start_nanos": 1750790014449254000, "end_nanos": 1750790014450157000, "timezone": "EDT"}, "pdl__is_leaf": true}, "parameters": {"pdl__expr": {"timeout": null, "temperature": 0.0, "top_p": null, "n": null, "stop": null, "max_tokens": null, "presence_penalty": null, "frequency_penalty": null, "logit_bias": null, "user": null, "response_format": null, "seed": null, "tools": null, "tool_choice": null, "logprobs": null, "top_logprobs": null, "parallel_tool_calls": null, "extra_headers": null, "functions": null, "function_call": null, "base_url": null, "api_version": null, "api_key": null, "model_list": null, "mock_response": null, "custom_llm_provider": null, "max_retries": null}, "pdl__result": {"timeout": null, "temperature": 0.0, "top_p": null, "n": null, "stop": null, "max_tokens": null, "presence_penalty": null, "frequency_penalty": null, "logit_bias": null, "user": null, "response_format": null, "seed": null, "tools": null, "tool_choice": null, "logprobs": null, "top_logprobs": null, "parallel_tool_calls": null, "extra_headers": null, "functions": null, "function_call": null, "base_url": null, "api_version": null, "api_key": null, "model_list": null, "mock_response": null, "custom_llm_provider": null, "max_retries": null}}, "pdl__usage": {"completion_tokens": 629, "prompt_tokens": 568}, "pdl__model_input": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}, {"content": "Sure, I'd be happy to help with that! Here's a simple \"Hello, World!\" program in Python, which is one of the most popular programming languages:\n\n```python\nprint(\"Hello, World!\")\n```\n\nTo run this code, follow these steps:\n\n1. **Install Python**: If you haven't already, download and install Python from its official website (https://www.python.org/). Make sure to check the box for \"Add Python to PATH\" during installation; this step is crucial as it allows your system to find the Python executable in any directory.\n\n2. **Open a Text Editor**: Use a text editor like Notepad (on Windows), TextEdit (on macOS), or Visual Studio Code, Sublime Text, Atom, etc., for writing your code.\n\n3. **Write Your Code**: Copy and paste the Python code above into your text editor. Save this file with a `.py` extension, for example, `hello_world.py`. You can name it anything you like, but using `.py` ensures that the file is recognized as a Python script.\n\n4. **Open Command Prompt/Terminal**: On Windows, press `Win + R`, type `cmd`, and hit Enter. On macOS or Linux, open Terminal from Applications > Utilities (macOS) or Spotlight Search (Linux).\n\n5. **Navigate to the Directory**: In the command prompt or terminal window, navigate to the directory where you saved your Python file using the `cd` command followed by the path to that folder. For example:\n\n   ```\n   cd C:\\Users\\YourUsername\\Documents\n   ```\n\n   Or on macOS/Linux:\n\n   ```\n   cd ~/Documents\n   ```\n\n6. **Run Your Script**: Type `python hello_world.py` and press Enter. If everything is set up correctly, you should see the output \"Hello, World!\" displayed in your terminal or command prompt.\n\nHere's what happens under the hood:\n\n- When Python encounters the line `print(\"Hello, World!\")`, it interprets this as a command to display the string \"Hello, World!\" on the console.\n- The `python` command at the end of your terminal/command prompt invocation tells the system to use its built-in Python interpreter (or any other Python version you have installed) to run the script.\n- The Python interpreter reads each line in your file, executes it, and prints the result to the console. In this case, it prints \"Hello, World!\".\n\nThat's it! You've just written and executed a simple \"Hello, World!\" program using Python. This is a great starting point for learning programming concepts.", "role": "assistant", "pdl__defsite": "text.1.model"}, {"role": "user", "content": "how about in Rust?", "pdl__defsite": "text.2"}], "pdl__result": "Absolutely, here's how you can write and run a \"Hello, World!\" program in Rust:\n\n1. **Install Rust**: First, you need to install Rust on your system. Visit the official Rust website (https://www.rust-lang.org/) and follow the instructions for your operating system to download and install Rust. Make sure to add Rust to your PATH during installation so that your terminal can find the `rustc` command.\n\n2. **Create a New Rust File**: Open a text editor or use an Integrated Development Environment (IDE) like Visual Studio Code, IntelliJ IDEA with the Rust plugin, or cargo-edit. For this example, let's use nano, a simple text editor available on most Unix-based systems:\n\n   ```\n   nano hello_world.rs\n   ```\n\n3. **Write Your Code**: Copy and paste the following Rust code into your file:\n\n   ```rust\n   fn main() {\n       println!(\"Hello, World!\");\n   }\n   ```\n\n   This is a simple \"Hello, World!\" program in Rust. The `fn main()` function is the entry point of any Rust program. Inside this function, `println!` is used to print the string \"Hello, World!\" to the console.\n\n4. **Save and Exit**: Save the file with a `.rs` extension (e.g., `hello_world.rs`). If you're using nano, press `Ctrl+X`, then `Y` to confirm saving changes, and finally `Enter`.\n\n5. **Open Terminal/Command Prompt**: Open your terminal or command prompt. On Windows, use PowerShell or Command Prompt; on macOS or Linux, open Terminal from Applications > Utilities (macOS) or Spotlight Search (Linux).\n\n6. **Navigate to Your Project Directory**: Change into the directory where you saved `hello_world.rs` using the `cd` command:\n\n   ```\n   cd path/to/your/project\n   ```\n\n   Replace `path/to/your/project` with the actual path to your project folder.\n\n7. **Compile and Run Your Rust Program**: Use the `rustc` command to compile your Rust code into an executable, then run it using `./`. Here's how:\n\n   ```\n   rustc hello_world.rs  # This compiles your .rs file into an object file (hello_world)\n   ./hello_world      # This runs the compiled program and prints \"Hello, World!\"\n   ```\n\nHere's what happens under the hood:\n\n- `rustc` is Rust's compiler that translates your source code (`hello_world.rs`) into machine code or an executable file (in this case, `hello_world`).\n- The `./` command tells the system to run the compiled binary directly from the current directory.\n- When you run `./hello_world`, it prints \"Hello, World!\" to your terminal because that's what the `println!` function in Rust does \u2013 it outputs a string to the console.\n\nThat's how you write and run a simple \"Hello, World!\" program in Rust! This example demonstrates basic Rust syntax and shows how to compile and execute code using the command line.", "pdl__timing": {"start_nanos": 1750790014447340000, "end_nanos": 1750790071342498000, "timezone": "EDT"}, "pdl__is_leaf": true}], "pdl__result": "write a hello world example, and explain to me how to run itSure, I'd be happy to help with that! Here's a simple \"Hello, World!\" program in Python, which is one of the most popular programming languages:\n\n```python\nprint(\"Hello, World!\")\n```\n\nTo run this code, follow these steps:\n\n1. **Install Python**: If you haven't already, download and install Python from its official website (https://www.python.org/). Make sure to check the box for \"Add Python to PATH\" during installation; this step is crucial as it allows your system to find the Python executable in any directory.\n\n2. **Open a Text Editor**: Use a text editor like Notepad (on Windows), TextEdit (on macOS), or Visual Studio Code, Sublime Text, Atom, etc., for writing your code.\n\n3. **Write Your Code**: Copy and paste the Python code above into your text editor. Save this file with a `.py` extension, for example, `hello_world.py`. You can name it anything you like, but using `.py` ensures that the file is recognized as a Python script.\n\n4. **Open Command Prompt/Terminal**: On Windows, press `Win + R`, type `cmd`, and hit Enter. On macOS or Linux, open Terminal from Applications > Utilities (macOS) or Spotlight Search (Linux).\n\n5. **Navigate to the Directory**: In the command prompt or terminal window, navigate to the directory where you saved your Python file using the `cd` command followed by the path to that folder. For example:\n\n   ```\n   cd C:\\Users\\YourUsername\\Documents\n   ```\n\n   Or on macOS/Linux:\n\n   ```\n   cd ~/Documents\n   ```\n\n6. **Run Your Script**: Type `python hello_world.py` and press Enter. If everything is set up correctly, you should see the output \"Hello, World!\" displayed in your terminal or command prompt.\n\nHere's what happens under the hood:\n\n- When Python encounters the line `print(\"Hello, World!\")`, it interprets this as a command to display the string \"Hello, World!\" on the console.\n- The `python` command at the end of your terminal/command prompt invocation tells the system to use its built-in Python interpreter (or any other Python version you have installed) to run the script.\n- The Python interpreter reads each line in your file, executes it, and prints the result to the console. In this case, it prints \"Hello, World!\".\n\nThat's it! You've just written and executed a simple \"Hello, World!\" program using Python. This is a great starting point for learning programming concepts.how about in Rust?Absolutely, here's how you can write and run a \"Hello, World!\" program in Rust:\n\n1. **Install Rust**: First, you need to install Rust on your system. Visit the official Rust website (https://www.rust-lang.org/) and follow the instructions for your operating system to download and install Rust. Make sure to add Rust to your PATH during installation so that your terminal can find the `rustc` command.\n\n2. **Create a New Rust File**: Open a text editor or use an Integrated Development Environment (IDE) like Visual Studio Code, IntelliJ IDEA with the Rust plugin, or cargo-edit. For this example, let's use nano, a simple text editor available on most Unix-based systems:\n\n   ```\n   nano hello_world.rs\n   ```\n\n3. **Write Your Code**: Copy and paste the following Rust code into your file:\n\n   ```rust\n   fn main() {\n       println!(\"Hello, World!\");\n   }\n   ```\n\n   This is a simple \"Hello, World!\" program in Rust. The `fn main()` function is the entry point of any Rust program. Inside this function, `println!` is used to print the string \"Hello, World!\" to the console.\n\n4. **Save and Exit**: Save the file with a `.rs` extension (e.g., `hello_world.rs`). If you're using nano, press `Ctrl+X`, then `Y` to confirm saving changes, and finally `Enter`.\n\n5. **Open Terminal/Command Prompt**: Open your terminal or command prompt. On Windows, use PowerShell or Command Prompt; on macOS or Linux, open Terminal from Applications > Utilities (macOS) or Spotlight Search (Linux).\n\n6. **Navigate to Your Project Directory**: Change into the directory where you saved `hello_world.rs` using the `cd` command:\n\n   ```\n   cd path/to/your/project\n   ```\n\n   Replace `path/to/your/project` with the actual path to your project folder.\n\n7. **Compile and Run Your Rust Program**: Use the `rustc` command to compile your Rust code into an executable, then run it using `./`. Here's how:\n\n   ```\n   rustc hello_world.rs  # This compiles your .rs file into an object file (hello_world)\n   ./hello_world      # This runs the compiled program and prints \"Hello, World!\"\n   ```\n\nHere's what happens under the hood:\n\n- `rustc` is Rust's compiler that translates your source code (`hello_world.rs`) into machine code or an executable file (in this case, `hello_world`).\n- The `./` command tells the system to run the compiled binary directly from the current directory.\n- When you run `./hello_world`, it prints \"Hello, World!\" to your terminal because that's what the `println!` function in Rust does \u2013 it outputs a string to the console.\n\nThat's how you write and run a simple \"Hello, World!\" program in Rust! This example demonstrates basic Rust syntax and shows how to compile and execute code using the command line.", "pdl__timing": {"start_nanos": 1750789975645980000, "end_nanos": 1750790071342592000, "timezone": "EDT"}, "pdl__is_leaf": false}
\ No newline at end of file
+{"kind": "text", "pdl__id": "text", "description": "Model chaining", "defs": {}, "context": "dependent", "text": [{"kind": "data", "pdl__id": "text.0", "defs": {}, "data": {"pdl__expr": "write a hello world example, and explain to me how to run it", "pdl__result": "write a hello world example, and explain to me how to run it"}, "pdl__result": "write a hello world example, and explain to me how to run it", "requirements": [], "pdl__timing": {"start_nanos": 1758570263520608000, "end_nanos": 1758570263521883000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "model", "pdl__id": "text.1.model", "pdl__context": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}], "defs": {}, "platform": "litellm", "model": {"pdl__expr": "ollama_chat/granite3.2:2b", "pdl__result": "ollama_chat/granite3.2:2b"}, "input": {"kind": "data", "pdl__id": "text.1.model.input", "defs": {}, "data": {"pdl__expr": "${ pdl_context }", "pdl__result": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}]}, "pdl__result": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}], "requirements": [], "pdl__timing": {"start_nanos": 1758570263566698000, "end_nanos": 1758570263567603000, "timezone": "EDT"}, "pdl__is_leaf": true}, "parameters": {"pdl__expr": {"timeout": null, "temperature": 0.0, "top_p": null, "n": null, "stop": null, "max_tokens": null, "presence_penalty": null, "frequency_penalty": null, "logit_bias": null, "user": null, "response_format": null, "seed": null, "tools": null, "tool_choice": null, "logprobs": null, "top_logprobs": null, "parallel_tool_calls": null, "extra_headers": null, "functions": null, "function_call": null, "base_url": null, "api_version": null, "api_key": null, "model_list": null, "mock_response": null, "custom_llm_provider": null, "max_retries": null}, "pdl__result": {"timeout": null, "temperature": 0.0, "top_p": null, "n": null, "stop": null, "max_tokens": null, "presence_penalty": null, "frequency_penalty": null, "logit_bias": null, "user": null, "response_format": null, "seed": null, "tools": null, "tool_choice": null, "logprobs": null, "top_logprobs": null, "parallel_tool_calls": null, "extra_headers": null, "functions": null, "function_call": null, "base_url": null, "api_version": null, "api_key": null, "model_list": null, "mock_response": null, "custom_llm_provider": null, "max_retries": null}}, "pdl__usage": {"completion_tokens": 569, "prompt_tokens": 57}, "pdl__model_input": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}], "pdl__result": "Sure, I'd be happy to help with that! Here's a simple \"Hello, World!\" program in Python, which is one of the most popular programming languages:\n\n```python\nprint(\"Hello, World!\")\n```\n\nTo run this code, follow these steps:\n\n1. **Install Python**: If you haven't already, download and install Python from its official website (https://www.python.org/). Make sure to check the box for \"Add Python to PATH\" during installation; this step is crucial as it allows your system to find the Python executable in any directory.\n\n2. **Open a Text Editor**: Use a text editor like Notepad (on Windows), TextEdit (on macOS), or Visual Studio Code, Sublime Text, Atom, etc., for writing your code.\n\n3. **Write Your Code**: Copy and paste the Python code above into your text editor. Save this file with a `.py` extension, for example, `hello_world.py`. You can name it anything you like, but using `.py` ensures that the file is recognized as a Python script.\n\n4. **Open Command Prompt/Terminal**: On Windows, press `Win + R`, type `cmd`, and hit Enter. On macOS or Linux, open Terminal from Applications > Utilities (macOS) or Spotlight Search (Linux).\n\n5. **Navigate to the Directory**: In the command prompt or terminal window, navigate to the directory where you saved your Python file using the `cd` command followed by the path to that folder. For example:\n\n   ```\n   cd C:\\Users\\YourUsername\\Documents\n   ```\n\n   Or on macOS/Linux:\n\n   ```\n   cd ~/Documents\n   ```\n\n6. **Run Your Script**: Type `python hello_world.py` and press Enter. If everything is set up correctly, you should see the output \"Hello, World!\" displayed in your terminal or command prompt.\n\nHere's what happens under the hood:\n\n- When Python encounters the line `print(\"Hello, World!\")`, it interprets this as a command to display the string \"Hello, World!\" on the console.\n- The `python` command at the end of your terminal/command prompt invocation tells the system to use its built-in Python interpreter (or any other Python version you have installed) to run the script.\n- The Python interpreter reads each line in your file, executes it, and prints the result to the console. In this case, it prints \"Hello, World!\".\n\nThat's it! You've just written and executed a simple \"Hello, World!\" program using Python. This is a great starting point for learning programming concepts.", "requirements": [], "pdl__timing": {"start_nanos": 1758570263564862000, "end_nanos": 1758570308445227000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "data", "pdl__id": "text.2", "defs": {}, "data": {"pdl__expr": "how about in Rust?", "pdl__result": "how about in Rust?"}, "pdl__result": "how about in Rust?", "requirements": [], "pdl__timing": {"start_nanos": 1758570265724811000, "end_nanos": 1758570265724919000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "model", "pdl__id": "text.3.model", "pdl__context": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}, {"content": "Sure, I'd be happy to help with that! Here's a simple \"Hello, World!\" program in Python, which is one of the most popular programming languages:\n\n```python\nprint(\"Hello, World!\")\n```\n\nTo run this code, follow these steps:\n\n1. **Install Python**: If you haven't already, download and install Python from its official website (https://www.python.org/). Make sure to check the box for \"Add Python to PATH\" during installation; this step is crucial as it allows your system to find the Python executable in any directory.\n\n2. **Open a Text Editor**: Use a text editor like Notepad (on Windows), TextEdit (on macOS), or Visual Studio Code, Sublime Text, Atom, etc., for writing your code.\n\n3. **Write Your Code**: Copy and paste the Python code above into your text editor. Save this file with a `.py` extension, for example, `hello_world.py`. You can name it anything you like, but using `.py` ensures that the file is recognized as a Python script.\n\n4. **Open Command Prompt/Terminal**: On Windows, press `Win + R`, type `cmd`, and hit Enter. On macOS or Linux, open Terminal from Applications > Utilities (macOS) or Spotlight Search (Linux).\n\n5. **Navigate to the Directory**: In the command prompt or terminal window, navigate to the directory where you saved your Python file using the `cd` command followed by the path to that folder. For example:\n\n   ```\n   cd C:\\Users\\YourUsername\\Documents\n   ```\n\n   Or on macOS/Linux:\n\n   ```\n   cd ~/Documents\n   ```\n\n6. **Run Your Script**: Type `python hello_world.py` and press Enter. If everything is set up correctly, you should see the output \"Hello, World!\" displayed in your terminal or command prompt.\n\nHere's what happens under the hood:\n\n- When Python encounters the line `print(\"Hello, World!\")`, it interprets this as a command to display the string \"Hello, World!\" on the console.\n- The `python` command at the end of your terminal/command prompt invocation tells the system to use its built-in Python interpreter (or any other Python version you have installed) to run the script.\n- The Python interpreter reads each line in your file, executes it, and prints the result to the console. In this case, it prints \"Hello, World!\".\n\nThat's it! You've just written and executed a simple \"Hello, World!\" program using Python. This is a great starting point for learning programming concepts.", "role": "assistant", "pdl__defsite": "text.1.model"}, {"role": "user", "content": "how about in Rust?", "pdl__defsite": "text.2"}], "defs": {}, "platform": "litellm", "model": {"pdl__expr": "ollama_chat/granite3.2:2b", "pdl__result": "ollama_chat/granite3.2:2b"}, "input": {"kind": "data", "pdl__id": "text.3.model.input", "defs": {}, "data": {"pdl__expr": "${ pdl_context }", "pdl__result": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}, {"content": "Sure, I'd be happy to help with that! Here's a simple \"Hello, World!\" program in Python, which is one of the most popular programming languages:\n\n```python\nprint(\"Hello, World!\")\n```\n\nTo run this code, follow these steps:\n\n1. **Install Python**: If you haven't already, download and install Python from its official website (https://www.python.org/). Make sure to check the box for \"Add Python to PATH\" during installation; this step is crucial as it allows your system to find the Python executable in any directory.\n\n2. **Open a Text Editor**: Use a text editor like Notepad (on Windows), TextEdit (on macOS), or Visual Studio Code, Sublime Text, Atom, etc., for writing your code.\n\n3. **Write Your Code**: Copy and paste the Python code above into your text editor. Save this file with a `.py` extension, for example, `hello_world.py`. You can name it anything you like, but using `.py` ensures that the file is recognized as a Python script.\n\n4. **Open Command Prompt/Terminal**: On Windows, press `Win + R`, type `cmd`, and hit Enter. On macOS or Linux, open Terminal from Applications > Utilities (macOS) or Spotlight Search (Linux).\n\n5. **Navigate to the Directory**: In the command prompt or terminal window, navigate to the directory where you saved your Python file using the `cd` command followed by the path to that folder. For example:\n\n   ```\n   cd C:\\Users\\YourUsername\\Documents\n   ```\n\n   Or on macOS/Linux:\n\n   ```\n   cd ~/Documents\n   ```\n\n6. **Run Your Script**: Type `python hello_world.py` and press Enter. If everything is set up correctly, you should see the output \"Hello, World!\" displayed in your terminal or command prompt.\n\nHere's what happens under the hood:\n\n- When Python encounters the line `print(\"Hello, World!\")`, it interprets this as a command to display the string \"Hello, World!\" on the console.\n- The `python` command at the end of your terminal/command prompt invocation tells the system to use its built-in Python interpreter (or any other Python version you have installed) to run the script.\n- The Python interpreter reads each line in your file, executes it, and prints the result to the console. In this case, it prints \"Hello, World!\".\n\nThat's it! You've just written and executed a simple \"Hello, World!\" program using Python. This is a great starting point for learning programming concepts.", "role": "assistant", "pdl__defsite": "text.1.model"}, {"role": "user", "content": "how about in Rust?", "pdl__defsite": "text.2"}]}, "pdl__result": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}, {"content": "Sure, I'd be happy to help with that! Here's a simple \"Hello, World!\" program in Python, which is one of the most popular programming languages:\n\n```python\nprint(\"Hello, World!\")\n```\n\nTo run this code, follow these steps:\n\n1. **Install Python**: If you haven't already, download and install Python from its official website (https://www.python.org/). Make sure to check the box for \"Add Python to PATH\" during installation; this step is crucial as it allows your system to find the Python executable in any directory.\n\n2. **Open a Text Editor**: Use a text editor like Notepad (on Windows), TextEdit (on macOS), or Visual Studio Code, Sublime Text, Atom, etc., for writing your code.\n\n3. **Write Your Code**: Copy and paste the Python code above into your text editor. Save this file with a `.py` extension, for example, `hello_world.py`. You can name it anything you like, but using `.py` ensures that the file is recognized as a Python script.\n\n4. **Open Command Prompt/Terminal**: On Windows, press `Win + R`, type `cmd`, and hit Enter. On macOS or Linux, open Terminal from Applications > Utilities (macOS) or Spotlight Search (Linux).\n\n5. **Navigate to the Directory**: In the command prompt or terminal window, navigate to the directory where you saved your Python file using the `cd` command followed by the path to that folder. For example:\n\n   ```\n   cd C:\\Users\\YourUsername\\Documents\n   ```\n\n   Or on macOS/Linux:\n\n   ```\n   cd ~/Documents\n   ```\n\n6. **Run Your Script**: Type `python hello_world.py` and press Enter. If everything is set up correctly, you should see the output \"Hello, World!\" displayed in your terminal or command prompt.\n\nHere's what happens under the hood:\n\n- When Python encounters the line `print(\"Hello, World!\")`, it interprets this as a command to display the string \"Hello, World!\" on the console.\n- The `python` command at the end of your terminal/command prompt invocation tells the system to use its built-in Python interpreter (or any other Python version you have installed) to run the script.\n- The Python interpreter reads each line in your file, executes it, and prints the result to the console. In this case, it prints \"Hello, World!\".\n\nThat's it! You've just written and executed a simple \"Hello, World!\" program using Python. This is a great starting point for learning programming concepts.", "role": "assistant", "pdl__defsite": "text.1.model"}, {"role": "user", "content": "how about in Rust?", "pdl__defsite": "text.2"}], "requirements": [], "pdl__timing": {"start_nanos": 1758570265726736000, "end_nanos": 1758570265727575000, "timezone": "EDT"}, "pdl__is_leaf": true}, "parameters": {"pdl__expr": {"timeout": null, "temperature": 0.0, "top_p": null, "n": null, "stop": null, "max_tokens": null, "presence_penalty": null, "frequency_penalty": null, "logit_bias": null, "user": null, "response_format": null, "seed": null, "tools": null, "tool_choice": null, "logprobs": null, "top_logprobs": null, "parallel_tool_calls": null, "extra_headers": null, "functions": null, "function_call": null, "base_url": null, "api_version": null, "api_key": null, "model_list": null, "mock_response": null, "custom_llm_provider": null, "max_retries": null}, "pdl__result": {"timeout": null, "temperature": 0.0, "top_p": null, "n": null, "stop": null, "max_tokens": null, "presence_penalty": null, "frequency_penalty": null, "logit_bias": null, "user": null, "response_format": null, "seed": null, "tools": null, "tool_choice": null, "logprobs": null, "top_logprobs": null, "parallel_tool_calls": null, "extra_headers": null, "functions": null, "function_call": null, "base_url": null, "api_version": null, "api_key": null, "model_list": null, "mock_response": null, "custom_llm_provider": null, "max_retries": null}}, "pdl__usage": {"completion_tokens": 662, "prompt_tokens": 635}, "pdl__model_input": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}, {"content": "Sure, I'd be happy to help with that! Here's a simple \"Hello, World!\" program in Python, which is one of the most popular programming languages:\n\n```python\nprint(\"Hello, World!\")\n```\n\nTo run this code, follow these steps:\n\n1. **Install Python**: If you haven't already, download and install Python from its official website (https://www.python.org/). Make sure to check the box for \"Add Python to PATH\" during installation; this step is crucial as it allows your system to find the Python executable in any directory.\n\n2. **Open a Text Editor**: Use a text editor like Notepad (on Windows), TextEdit (on macOS), or Visual Studio Code, Sublime Text, Atom, etc., for writing your code.\n\n3. **Write Your Code**: Copy and paste the Python code above into your text editor. Save this file with a `.py` extension, for example, `hello_world.py`. You can name it anything you like, but using `.py` ensures that the file is recognized as a Python script.\n\n4. **Open Command Prompt/Terminal**: On Windows, press `Win + R`, type `cmd`, and hit Enter. On macOS or Linux, open Terminal from Applications > Utilities (macOS) or Spotlight Search (Linux).\n\n5. **Navigate to the Directory**: In the command prompt or terminal window, navigate to the directory where you saved your Python file using the `cd` command followed by the path to that folder. For example:\n\n   ```\n   cd C:\\Users\\YourUsername\\Documents\n   ```\n\n   Or on macOS/Linux:\n\n   ```\n   cd ~/Documents\n   ```\n\n6. **Run Your Script**: Type `python hello_world.py` and press Enter. If everything is set up correctly, you should see the output \"Hello, World!\" displayed in your terminal or command prompt.\n\nHere's what happens under the hood:\n\n- When Python encounters the line `print(\"Hello, World!\")`, it interprets this as a command to display the string \"Hello, World!\" on the console.\n- The `python` command at the end of your terminal/command prompt invocation tells the system to use its built-in Python interpreter (or any other Python version you have installed) to run the script.\n- The Python interpreter reads each line in your file, executes it, and prints the result to the console. In this case, it prints \"Hello, World!\".\n\nThat's it! You've just written and executed a simple \"Hello, World!\" program using Python. This is a great starting point for learning programming concepts.", "role": "assistant", "pdl__defsite": "text.1.model"}, {"role": "user", "content": "how about in Rust?", "pdl__defsite": "text.2"}], "pdl__result": "Absolutely, here's how you can write and run a \"Hello, World!\" program in Rust:\n\n1. **Install Rust**: First, you need to install Rust on your system. Visit the official Rust website (https://www.rust-lang.org/) and follow the instructions for your operating system to download and install Rust. Make sure to add Rust to your PATH during installation so that your terminal can find the `rustc` command.\n\n2. **Create a New Rust File**: Open a text editor or use an Integrated Development Environment (IDE) like Visual Studio Code, IntelliJ IDEA with the Rust plugin, or cargo-edit. For this example, let's use nano, a simple text editor available on most Unix-based systems:\n\n   ```\n   nano hello_world.rs\n   ```\n\n3. **Write Your Code**: Copy and paste the following Rust code into your file:\n\n   ```rust\n   fn main() {\n       println!(\"Hello, World!\");\n   }\n   ```\n\n   This is a simple \"Hello, World!\" program in Rust. The `fn main()` function is the entry point of any Rust program. Inside this function, `println!` is used to print the string \"Hello, World!\" to the console.\n\n4. **Save and Exit**: Save the file with a `.rs` extension (e.g., `hello_world.rs`). If you're using nano, press `Ctrl+X`, then `Y` to confirm saving changes, and finally `Enter`.\n\n5. **Open Terminal/Command Prompt**: Open your terminal or command prompt. On Windows, use PowerShell or Command Prompt; on macOS or Linux, open Terminal from Applications > Utilities (macOS) or Spotlight Search (Linux).\n\n6. **Navigate to Your Project Directory**: Change into the directory where you saved `hello_world.rs` using the `cd` command:\n\n   ```\n   cd path/to/your/project\n   ```\n\n   Replace `path/to/your/project` with the actual path to your project folder.\n\n7. **Compile and Run Your Rust Program**: Use the `rustc` command to compile your Rust code into an executable, then run it using `./`. Here's how:\n\n   ```\n   rustc hello_world.rs  # This compiles your .rs file into an object file (hello_world)\n   ./hello_world      # This runs the compiled program and prints \"Hello, World!\"\n   ```\n\nHere's what happens under the hood:\n\n- `rustc` is Rust's compiler that translates your source code (`hello_world.rs`) into machine code or an executable file (in this case, `hello_world`).\n- The `./` command tells the system to run the compiled binary directly from the current directory.\n- When you run `./hello_world`, it prints \"Hello, World!\" to your terminal because that's what the `println!` function in Rust does \u2013 it outputs a string to the console.\n\nThat's how you write and run a simple \"Hello, World!\" program in Rust! This example demonstrates basic Rust syntax and shows how to compile and execute code using the command line.", "requirements": [], "pdl__timing": {"start_nanos": 1758570265725021000, "end_nanos": 1758570372676220000, "timezone": "EDT"}, "pdl__is_leaf": true}], "pdl__result": "write a hello world example, and explain to me how to run itSure, I'd be happy to help with that! Here's a simple \"Hello, World!\" program in Python, which is one of the most popular programming languages:\n\n```python\nprint(\"Hello, World!\")\n```\n\nTo run this code, follow these steps:\n\n1. **Install Python**: If you haven't already, download and install Python from its official website (https://www.python.org/). Make sure to check the box for \"Add Python to PATH\" during installation; this step is crucial as it allows your system to find the Python executable in any directory.\n\n2. **Open a Text Editor**: Use a text editor like Notepad (on Windows), TextEdit (on macOS), or Visual Studio Code, Sublime Text, Atom, etc., for writing your code.\n\n3. **Write Your Code**: Copy and paste the Python code above into your text editor. Save this file with a `.py` extension, for example, `hello_world.py`. You can name it anything you like, but using `.py` ensures that the file is recognized as a Python script.\n\n4. **Open Command Prompt/Terminal**: On Windows, press `Win + R`, type `cmd`, and hit Enter. On macOS or Linux, open Terminal from Applications > Utilities (macOS) or Spotlight Search (Linux).\n\n5. **Navigate to the Directory**: In the command prompt or terminal window, navigate to the directory where you saved your Python file using the `cd` command followed by the path to that folder. For example:\n\n   ```\n   cd C:\\Users\\YourUsername\\Documents\n   ```\n\n   Or on macOS/Linux:\n\n   ```\n   cd ~/Documents\n   ```\n\n6. **Run Your Script**: Type `python hello_world.py` and press Enter. If everything is set up correctly, you should see the output \"Hello, World!\" displayed in your terminal or command prompt.\n\nHere's what happens under the hood:\n\n- When Python encounters the line `print(\"Hello, World!\")`, it interprets this as a command to display the string \"Hello, World!\" on the console.\n- The `python` command at the end of your terminal/command prompt invocation tells the system to use its built-in Python interpreter (or any other Python version you have installed) to run the script.\n- The Python interpreter reads each line in your file, executes it, and prints the result to the console. In this case, it prints \"Hello, World!\".\n\nThat's it! You've just written and executed a simple \"Hello, World!\" program using Python. This is a great starting point for learning programming concepts.how about in Rust?Absolutely, here's how you can write and run a \"Hello, World!\" program in Rust:\n\n1. **Install Rust**: First, you need to install Rust on your system. Visit the official Rust website (https://www.rust-lang.org/) and follow the instructions for your operating system to download and install Rust. Make sure to add Rust to your PATH during installation so that your terminal can find the `rustc` command.\n\n2. **Create a New Rust File**: Open a text editor or use an Integrated Development Environment (IDE) like Visual Studio Code, IntelliJ IDEA with the Rust plugin, or cargo-edit. For this example, let's use nano, a simple text editor available on most Unix-based systems:\n\n   ```\n   nano hello_world.rs\n   ```\n\n3. **Write Your Code**: Copy and paste the following Rust code into your file:\n\n   ```rust\n   fn main() {\n       println!(\"Hello, World!\");\n   }\n   ```\n\n   This is a simple \"Hello, World!\" program in Rust. The `fn main()` function is the entry point of any Rust program. Inside this function, `println!` is used to print the string \"Hello, World!\" to the console.\n\n4. **Save and Exit**: Save the file with a `.rs` extension (e.g., `hello_world.rs`). If you're using nano, press `Ctrl+X`, then `Y` to confirm saving changes, and finally `Enter`.\n\n5. **Open Terminal/Command Prompt**: Open your terminal or command prompt. On Windows, use PowerShell or Command Prompt; on macOS or Linux, open Terminal from Applications > Utilities (macOS) or Spotlight Search (Linux).\n\n6. **Navigate to Your Project Directory**: Change into the directory where you saved `hello_world.rs` using the `cd` command:\n\n   ```\n   cd path/to/your/project\n   ```\n\n   Replace `path/to/your/project` with the actual path to your project folder.\n\n7. **Compile and Run Your Rust Program**: Use the `rustc` command to compile your Rust code into an executable, then run it using `./`. Here's how:\n\n   ```\n   rustc hello_world.rs  # This compiles your .rs file into an object file (hello_world)\n   ./hello_world      # This runs the compiled program and prints \"Hello, World!\"\n   ```\n\nHere's what happens under the hood:\n\n- `rustc` is Rust's compiler that translates your source code (`hello_world.rs`) into machine code or an executable file (in this case, `hello_world`).\n- The `./` command tells the system to run the compiled binary directly from the current directory.\n- When you run `./hello_world`, it prints \"Hello, World!\" to your terminal because that's what the `println!` function in Rust does \u2013 it outputs a string to the console.\n\nThat's how you write and run a simple \"Hello, World!\" program in Rust! This example demonstrates basic Rust syntax and shows how to compile and execute code using the command line.", "requirements": [], "pdl__timing": {"start_nanos": 1758570263520483000, "end_nanos": 1758570308445592000, "timezone": "EDT"}, "pdl__is_leaf": false}
\ No newline at end of file
diff --git a/pdl-live-react/src/demos/demo3.json b/pdl-live-react/src/demos/demo3.json
index f16a3989e..fdd1adc18 100644
--- a/pdl-live-react/src/demos/demo3.json
+++ b/pdl-live-react/src/demos/demo3.json
@@ -1 +1 @@
-{"kind": "text", "pdl__id": "text", "description": "Fibonacci", "defs": {}, "context": "dependent", "text": [{"kind": "model", "pdl__id": "text.0.model", "defs": {}, "platform": "litellm", "model": {"pdl__expr": "ollama_chat/granite3.2:2b", "pdl__result": "ollama_chat/granite3.2:2b"}, "input": {"kind": "data", "pdl__id": "text.0.model", "defs": {}, "data": {"pdl__expr": "Write a Python function to compute the Fibonacci sequence. Do not include a doc string.\n\n", "pdl__result": "Write a Python function to compute the Fibonacci sequence. Do not include a doc string.\n\n"}, "pdl__result": "Write a Python function to compute the Fibonacci sequence. Do not include a doc string.\n\n", "pdl__timing": {"start_nanos": 1750790073536914000, "end_nanos": 1750790073537006000, "timezone": "EDT"}, "pdl__is_leaf": true}, "parameters": {"pdl__expr": {"timeout": null, "temperature": 0.0, "top_p": null, "n": null, "stop": null, "max_tokens": null, "presence_penalty": null, "frequency_penalty": null, "logit_bias": null, "user": null, "response_format": null, "seed": null, "tools": null, "tool_choice": null, "logprobs": null, "top_logprobs": null, "parallel_tool_calls": null, "extra_headers": null, "functions": null, "function_call": null, "base_url": null, "api_version": null, "api_key": null, "model_list": null, "mock_response": null, "custom_llm_provider": null, "max_retries": null}, "pdl__result": {"timeout": null, "temperature": 0.0, "top_p": null, "n": null, "stop": null, "max_tokens": null, "presence_penalty": null, "frequency_penalty": null, "logit_bias": null, "user": null, "response_format": null, "seed": null, "tools": null, "tool_choice": null, "logprobs": null, "top_logprobs": null, "parallel_tool_calls": null, "extra_headers": null, "functions": null, "function_call": null, "base_url": null, "api_version": null, "api_key": null, "model_list": null, "mock_response": null, "custom_llm_provider": null, "max_retries": null}}, "pdl__usage": {"completion_tokens": 292, "prompt_tokens": 24}, "pdl__model_input": [{"role": "user", "content": "Write a Python function to compute the Fibonacci sequence. Do not include a doc string.\n\n"}], "def": "CODE", "pdl__result": "Here is a simple Python function that computes the Fibonacci sequence using recursion:\n\n```python\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n```\n\nThis function takes an integer `n` as input and returns the nth number in the Fibonacci sequence. However, it's important to note that this implementation has exponential time complexity due to repeated calculations of the same subproblems (i.e., it performs a lot of redundant work). For larger inputs, you should use an iterative approach or memoization to improve performance:\n\n```python\ndef fibonacci_iterative(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n\n    fib_values = [0, 1] + [0] * (n - 2)\n    for i in range(2, n):\n        fib_values[i] = fib_values[i - 1] + fib_values[i - 2]\n    return fib_values[n - 1]\n```\n\nThis version of the function uses an iterative approach with a list to store previously computed Fibonacci numbers, reducing time complexity to linear.", "pdl__timing": {"start_nanos": 1750790073532369000, "end_nanos": 1750790097839995000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "data", "pdl__id": "text.1", "defs": {}, "data": {"pdl__expr": "\nFind a random number between 1 and 20\n", "pdl__result": "\nFind a random number between 1 and 20\n"}, "pdl__result": "\nFind a random number between 1 and 20\n", "pdl__timing": {"start_nanos": 1750790097840106000, "end_nanos": 1750790097840248000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "code", "pdl__id": "text.2.code", "defs": {}, "lang": "python", "code": {"kind": "data", "pdl__id": "text.2.code", "defs": {}, "data": {"pdl__expr": "import random\n# (In PDL, set `result` to the output you wish for your code block.)\nresult = random.randint(1, 20)\n", "pdl__result": "import random\n# (In PDL, set `result` to the output you wish for your code block.)\nresult = random.randint(1, 20)\n"}, "pdl__result": "import random\n# (In PDL, set `result` to the output you wish for your code block.)\nresult = random.randint(1, 20)\n", "pdl__timing": {"start_nanos": 1750790097840626000, "end_nanos": 1750790097840742000, "timezone": "EDT"}, "pdl__is_leaf": true}, "def": "N", "pdl__result": 11, "pdl__timing": {"start_nanos": 1750790097840512000, "end_nanos": 1750790097841165000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "data", "pdl__id": "text.3", "defs": {}, "data": {"pdl__expr": "\nNow computing fibonacci(${ N })\n", "pdl__result": "\nNow computing fibonacci(11)\n"}, "pdl__result": "\nNow computing fibonacci(11)\n", "pdl__timing": {"start_nanos": 1750790097841231000, "end_nanos": 1750790097842661000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "code", "pdl__id": "text.4.code", "defs": {}, "lang": "python", "code": {"kind": "data", "pdl__id": "text.4.code", "defs": {}, "data": {"pdl__expr": "s = \"\"\"'${ CODE } '\"\"\"\nresult = s.split(\"```\")[1].replace(\"python\", \"\")\n", "pdl__result": "s = \"\"\"'Here is a simple Python function that computes the Fibonacci sequence using recursion:\n\n```python\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n```\n\nThis function takes an integer `n` as input and returns the nth number in the Fibonacci sequence. However, it's important to note that this implementation has exponential time complexity due to repeated calculations of the same subproblems (i.e., it performs a lot of redundant work). For larger inputs, you should use an iterative approach or memoization to improve performance:\n\n```python\ndef fibonacci_iterative(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n\n    fib_values = [0, 1] + [0] * (n - 2)\n    for i in range(2, n):\n        fib_values[i] = fib_values[i - 1] + fib_values[i - 2]\n    return fib_values[n - 1]\n```\n\nThis version of the function uses an iterative approach with a list to store previously computed Fibonacci numbers, reducing time complexity to linear. '\"\"\"\nresult = s.split(\"```\")[1].replace(\"python\", \"\")\n"}, "pdl__result": "s = \"\"\"'Here is a simple Python function that computes the Fibonacci sequence using recursion:\n\n```python\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n```\n\nThis function takes an integer `n` as input and returns the nth number in the Fibonacci sequence. However, it's important to note that this implementation has exponential time complexity due to repeated calculations of the same subproblems (i.e., it performs a lot of redundant work). For larger inputs, you should use an iterative approach or memoization to improve performance:\n\n```python\ndef fibonacci_iterative(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n\n    fib_values = [0, 1] + [0] * (n - 2)\n    for i in range(2, n):\n        fib_values[i] = fib_values[i - 1] + fib_values[i - 2]\n    return fib_values[n - 1]\n```\n\nThis version of the function uses an iterative approach with a list to store previously computed Fibonacci numbers, reducing time complexity to linear. '\"\"\"\nresult = s.split(\"```\")[1].replace(\"python\", \"\")\n", "pdl__timing": {"start_nanos": 1750790097842906000, "end_nanos": 1750790097844013000, "timezone": "EDT"}, "pdl__is_leaf": true}, "def": "EXTRACTED", "pdl__result": "\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n", "pdl__timing": {"start_nanos": 1750790097842833000, "end_nanos": 1750790097844328000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "code", "pdl__id": "text.5.code", "defs": {}, "lang": "python", "code": {"kind": "data", "pdl__id": "text.5.code", "defs": {}, "data": {"pdl__expr": "${ EXTRACTED }\nresult = fibonacci(${ N })\n", "pdl__result": "\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n\nresult = fibonacci(11)\n"}, "pdl__result": "\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n\nresult = fibonacci(11)\n", "pdl__timing": {"start_nanos": 1750790097844480000, "end_nanos": 1750790097845736000, "timezone": "EDT"}, "pdl__is_leaf": true}, "def": "RESULT", "contribute": [], "pdl__result": 55, "pdl__timing": {"start_nanos": 1750790097844407000, "end_nanos": 1750790097846042000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "data", "pdl__id": "text.6", "defs": {}, "data": {"pdl__expr": "The result is: ${ RESULT }", "pdl__result": "The result is: 55"}, "pdl__result": "The result is: 55", "pdl__timing": {"start_nanos": 1750790097846096000, "end_nanos": 1750790097846998000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "data", "pdl__id": "text.7", "defs": {}, "data": {"pdl__expr": "\n\nExplain what the above code does and what the result means\n\n", "pdl__result": "\n\nExplain what the above code does and what the result means\n\n"}, "pdl__result": "\n\nExplain what the above code does and what the result means\n\n", "pdl__timing": {"start_nanos": 1750790097847155000, "end_nanos": 1750790097847272000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "model", "pdl__id": "text.8.model", "pdl__context": [{"content": "Here is a simple Python function that computes the Fibonacci sequence using recursion:\n\n```python\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n```\n\nThis function takes an integer `n` as input and returns the nth number in the Fibonacci sequence. However, it's important to note that this implementation has exponential time complexity due to repeated calculations of the same subproblems (i.e., it performs a lot of redundant work). For larger inputs, you should use an iterative approach or memoization to improve performance:\n\n```python\ndef fibonacci_iterative(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n\n    fib_values = [0, 1] + [0] * (n - 2)\n    for i in range(2, n):\n        fib_values[i] = fib_values[i - 1] + fib_values[i - 2]\n    return fib_values[n - 1]\n```\n\nThis version of the function uses an iterative approach with a list to store previously computed Fibonacci numbers, reducing time complexity to linear.", "role": "assistant", "pdl__defsite": "text.0.model"}, {"role": "user", "content": "\nFind a random number between 1 and 20\n", "pdl__defsite": "text.1"}, {"role": "user", "content": "11", "pdl__defsite": "text.2.code"}, {"role": "user", "content": "\nNow computing fibonacci(11)\n", "pdl__defsite": "text.3"}, {"role": "user", "content": "\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n", "pdl__defsite": "text.4.code"}, {"role": "user", "content": "The result is: 55", "pdl__defsite": "text.6"}, {"role": "user", "content": "\n\nExplain what the above code does and what the result means\n\n", "pdl__defsite": "text.7"}], "defs": {}, "platform": "litellm", "model": {"pdl__expr": "ollama_chat/granite3.2:2b", "pdl__result": "ollama_chat/granite3.2:2b"}, "input": {"kind": "data", "pdl__id": "text.8.model", "defs": {}, "data": {"pdl__expr": "${ pdl_context }", "pdl__result": [{"content": "Here is a simple Python function that computes the Fibonacci sequence using recursion:\n\n```python\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n```\n\nThis function takes an integer `n` as input and returns the nth number in the Fibonacci sequence. However, it's important to note that this implementation has exponential time complexity due to repeated calculations of the same subproblems (i.e., it performs a lot of redundant work). For larger inputs, you should use an iterative approach or memoization to improve performance:\n\n```python\ndef fibonacci_iterative(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n\n    fib_values = [0, 1] + [0] * (n - 2)\n    for i in range(2, n):\n        fib_values[i] = fib_values[i - 1] + fib_values[i - 2]\n    return fib_values[n - 1]\n```\n\nThis version of the function uses an iterative approach with a list to store previously computed Fibonacci numbers, reducing time complexity to linear.", "role": "assistant", "pdl__defsite": "text.0.model"}, {"role": "user", "content": "\nFind a random number between 1 and 20\n", "pdl__defsite": "text.1"}, {"role": "user", "content": "11", "pdl__defsite": "text.2.code"}, {"role": "user", "content": "\nNow computing fibonacci(11)\n", "pdl__defsite": "text.3"}, {"role": "user", "content": "\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n", "pdl__defsite": "text.4.code"}, {"role": "user", "content": "The result is: 55", "pdl__defsite": "text.6"}, {"role": "user", "content": "\n\nExplain what the above code does and what the result means\n\n", "pdl__defsite": "text.7"}]}, "pdl__result": [{"content": "Here is a simple Python function that computes the Fibonacci sequence using recursion:\n\n```python\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n```\n\nThis function takes an integer `n` as input and returns the nth number in the Fibonacci sequence. However, it's important to note that this implementation has exponential time complexity due to repeated calculations of the same subproblems (i.e., it performs a lot of redundant work). For larger inputs, you should use an iterative approach or memoization to improve performance:\n\n```python\ndef fibonacci_iterative(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n\n    fib_values = [0, 1] + [0] * (n - 2)\n    for i in range(2, n):\n        fib_values[i] = fib_values[i - 1] + fib_values[i - 2]\n    return fib_values[n - 1]\n```\n\nThis version of the function uses an iterative approach with a list to store previously computed Fibonacci numbers, reducing time complexity to linear.", "role": "assistant", "pdl__defsite": "text.0.model"}, {"role": "user", "content": "\nFind a random number between 1 and 20\n", "pdl__defsite": "text.1"}, {"role": "user", "content": "11", "pdl__defsite": "text.2.code"}, {"role": "user", "content": "\nNow computing fibonacci(11)\n", "pdl__defsite": "text.3"}, {"role": "user", "content": "\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n", "pdl__defsite": "text.4.code"}, {"role": "user", "content": "The result is: 55", "pdl__defsite": "text.6"}, {"role": "user", "content": "\n\nExplain what the above code does and what the result means\n\n", "pdl__defsite": "text.7"}], "pdl__timing": {"start_nanos": 1750790097847734000, "end_nanos": 1750790097848747000, "timezone": "EDT"}, "pdl__is_leaf": true}, "parameters": {"pdl__expr": null}, "pdl__usage": {"completion_tokens": 479, "prompt_tokens": 427}, "pdl__model_input": [{"content": "Here is a simple Python function that computes the Fibonacci sequence using recursion:\n\n```python\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n```\n\nThis function takes an integer `n` as input and returns the nth number in the Fibonacci sequence. However, it's important to note that this implementation has exponential time complexity due to repeated calculations of the same subproblems (i.e., it performs a lot of redundant work). For larger inputs, you should use an iterative approach or memoization to improve performance:\n\n```python\ndef fibonacci_iterative(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n\n    fib_values = [0, 1] + [0] * (n - 2)\n    for i in range(2, n):\n        fib_values[i] = fib_values[i - 1] + fib_values[i - 2]\n    return fib_values[n - 1]\n```\n\nThis version of the function uses an iterative approach with a list to store previously computed Fibonacci numbers, reducing time complexity to linear.", "role": "assistant", "pdl__defsite": "text.0.model"}, {"role": "user", "content": "\nFind a random number between 1 and 20\n", "pdl__defsite": "text.1"}, {"role": "user", "content": "11", "pdl__defsite": "text.2.code"}, {"role": "user", "content": "\nNow computing fibonacci(11)\n", "pdl__defsite": "text.3"}, {"role": "user", "content": "\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n", "pdl__defsite": "text.4.code"}, {"role": "user", "content": "The result is: 55", "pdl__defsite": "text.6"}, {"role": "user", "content": "\n\nExplain what the above code does and what the result means\n\n", "pdl__defsite": "text.7"}], "pdl__result": "The provided Python code defines a function called `fibonacci` that calculates the nth number in the Fibonacci sequence using recursion. The Fibonacci sequence is a series of numbers where each number is the sum of the two preceding ones, usually starting with 0 and 1 (0, 1, 1, 2, 3, 5, 8, ...).\n\nHere's what the code does:\n\n1. It checks if the input `n` is less than or equal to zero; if so, it returns a message indicating that the input should be a positive integer.\n2. If `n` equals 1, it returns 0 (the first number in the Fibonacci sequence).\n3. If `n` equals 2, it returns 1 (the second number in the Fibonacci sequence).\n4. For any other value of `n`, it recursively calls itself with arguments `n - 1` and `n - 2`, then adds the results together to get the nth Fibonacci number.\n\nNow let's compute `fibonacci(11)` using this function:\n\n- The base cases are handled first:\n  - `fibonacci(1) = 0`\n  - `fibonacci(2) = 1`\n\n- Next, we calculate the value for `n = 3`:\n  - `fibonacci(3) = fibonacci(2) + fibonacci(1) = 1 + 0 = 1`\n\n- Then, we compute `fibonacci(4)` using previously calculated values:\n  - `fibonacci(4) = fibonacci(3) + fibonacci(2) = 1 + 1 = 2`\n\n- Continuing this process for each value up to `n = 11`:\n\n  - `fibonacci(5) = fibonacci(4) + fibonacci(3) = 2 + 1 = 3`\n  - `fibonacci(6) = fibonacci(5) + fibonacci(4) = 3 + 2 = 5`\n  - ...\n  - `fibonacci(11) = fibonacci(10) + fibonacci(9) = 55 + 34 = 89`\n\nThe result of `fibonacci(11)` is **89**. This means that the 11th number in the Fibonacci sequence, starting with 0 and 1, is 89.", "pdl__timing": {"start_nanos": 1750790097847515000, "end_nanos": 1750790158829255000, "timezone": "EDT"}, "pdl__is_leaf": true}], "pdl__result": "Here is a simple Python function that computes the Fibonacci sequence using recursion:\n\n```python\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n```\n\nThis function takes an integer `n` as input and returns the nth number in the Fibonacci sequence. However, it's important to note that this implementation has exponential time complexity due to repeated calculations of the same subproblems (i.e., it performs a lot of redundant work). For larger inputs, you should use an iterative approach or memoization to improve performance:\n\n```python\ndef fibonacci_iterative(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n\n    fib_values = [0, 1] + [0] * (n - 2)\n    for i in range(2, n):\n        fib_values[i] = fib_values[i - 1] + fib_values[i - 2]\n    return fib_values[n - 1]\n```\n\nThis version of the function uses an iterative approach with a list to store previously computed Fibonacci numbers, reducing time complexity to linear.\nFind a random number between 1 and 20\n11\nNow computing fibonacci(11)\n\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\nThe result is: 55\n\nExplain what the above code does and what the result means\n\nThe provided Python code defines a function called `fibonacci` that calculates the nth number in the Fibonacci sequence using recursion. The Fibonacci sequence is a series of numbers where each number is the sum of the two preceding ones, usually starting with 0 and 1 (0, 1, 1, 2, 3, 5, 8, ...).\n\nHere's what the code does:\n\n1. It checks if the input `n` is less than or equal to zero; if so, it returns a message indicating that the input should be a positive integer.\n2. If `n` equals 1, it returns 0 (the first number in the Fibonacci sequence).\n3. If `n` equals 2, it returns 1 (the second number in the Fibonacci sequence).\n4. For any other value of `n`, it recursively calls itself with arguments `n - 1` and `n - 2`, then adds the results together to get the nth Fibonacci number.\n\nNow let's compute `fibonacci(11)` using this function:\n\n- The base cases are handled first:\n  - `fibonacci(1) = 0`\n  - `fibonacci(2) = 1`\n\n- Next, we calculate the value for `n = 3`:\n  - `fibonacci(3) = fibonacci(2) + fibonacci(1) = 1 + 0 = 1`\n\n- Then, we compute `fibonacci(4)` using previously calculated values:\n  - `fibonacci(4) = fibonacci(3) + fibonacci(2) = 1 + 1 = 2`\n\n- Continuing this process for each value up to `n = 11`:\n\n  - `fibonacci(5) = fibonacci(4) + fibonacci(3) = 2 + 1 = 3`\n  - `fibonacci(6) = fibonacci(5) + fibonacci(4) = 3 + 2 = 5`\n  - ...\n  - `fibonacci(11) = fibonacci(10) + fibonacci(9) = 55 + 34 = 89`\n\nThe result of `fibonacci(11)` is **89**. This means that the 11th number in the Fibonacci sequence, starting with 0 and 1, is 89.", "pdl__timing": {"start_nanos": 1750790073405758000, "end_nanos": 1750790158829358000, "timezone": "EDT"}, "pdl__is_leaf": false}
\ No newline at end of file
+{"kind": "text", "pdl__id": "text", "description": "Fibonacci", "defs": {}, "context": "dependent", "text": [{"kind": "model", "pdl__id": "text.0.model", "defs": {}, "platform": "litellm", "model": {"pdl__expr": "ollama_chat/granite3.2:2b", "pdl__result": "ollama_chat/granite3.2:2b"}, "input": {"kind": "data", "pdl__id": "text.0.model.input", "defs": {}, "data": {"pdl__expr": "Write a Python function to compute the Fibonacci sequence. Do not include a doc string.\n\n", "pdl__result": "Write a Python function to compute the Fibonacci sequence. Do not include a doc string.\n\n"}, "pdl__result": "Write a Python function to compute the Fibonacci sequence. Do not include a doc string.\n\n", "requirements": [], "pdl__timing": {"start_nanos": 1758570374545178000, "end_nanos": 1758570374545251000, "timezone": "EDT"}, "pdl__is_leaf": true}, "parameters": {"pdl__expr": {"timeout": null, "temperature": 0.0, "top_p": null, "n": null, "stop": null, "max_tokens": null, "presence_penalty": null, "frequency_penalty": null, "logit_bias": null, "user": null, "response_format": null, "seed": null, "tools": null, "tool_choice": null, "logprobs": null, "top_logprobs": null, "parallel_tool_calls": null, "extra_headers": null, "functions": null, "function_call": null, "base_url": null, "api_version": null, "api_key": null, "model_list": null, "mock_response": null, "custom_llm_provider": null, "max_retries": null}, "pdl__result": {"timeout": null, "temperature": 0.0, "top_p": null, "n": null, "stop": null, "max_tokens": null, "presence_penalty": null, "frequency_penalty": null, "logit_bias": null, "user": null, "response_format": null, "seed": null, "tools": null, "tool_choice": null, "logprobs": null, "top_logprobs": null, "parallel_tool_calls": null, "extra_headers": null, "functions": null, "function_call": null, "base_url": null, "api_version": null, "api_key": null, "model_list": null, "mock_response": null, "custom_llm_provider": null, "max_retries": null}}, "pdl__usage": {"completion_tokens": 324, "prompt_tokens": 63}, "pdl__model_input": [{"role": "user", "content": "Write a Python function to compute the Fibonacci sequence. Do not include a doc string.\n\n"}], "def": "CODE", "pdl__result": "Here is a simple Python function that computes the Fibonacci sequence using recursion:\n\n```python\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n```\n\nThis function takes an integer `n` as input and returns the nth number in the Fibonacci sequence. However, it's important to note that this implementation has exponential time complexity due to repeated calculations of the same subproblems (i.e., it performs a lot of redundant work). For larger inputs, you should use an iterative approach or memoization to improve performance:\n\n```python\ndef fibonacci_iterative(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n\n    fib_values = [0, 1] + [0] * (n - 2)\n    for i in range(2, n):\n        fib_values[i] = fib_values[i - 1] + fib_values[i - 2]\n    return fib_values[n - 1]\n```\n\nThis version of the function uses an iterative approach with a list to store previously computed Fibonacci numbers, reducing time complexity to linear.", "requirements": [], "pdl__timing": {"start_nanos": 1758570374542167000, "end_nanos": 1758570402846842000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "data", "pdl__id": "text.1", "defs": {}, "data": {"pdl__expr": "\nFind a random number between 1 and 20\n", "pdl__result": "\nFind a random number between 1 and 20\n"}, "pdl__result": "\nFind a random number between 1 and 20\n", "requirements": [], "pdl__timing": {"start_nanos": 1758570376734433000, "end_nanos": 1758570376734561000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "code", "pdl__id": "text.2.code", "defs": {}, "lang": "python", "code": {"kind": "data", "pdl__id": "text.2.code.code", "defs": {}, "data": {"pdl__expr": "import random\n# (In PDL, set `result` to the output you wish for your code block.)\nresult = random.randint(1, 20)\n", "pdl__result": "import random\n# (In PDL, set `result` to the output you wish for your code block.)\nresult = random.randint(1, 20)\n"}, "pdl__result": "import random\n# (In PDL, set `result` to the output you wish for your code block.)\nresult = random.randint(1, 20)\n", "requirements": [], "pdl__timing": {"start_nanos": 1758570376734805000, "end_nanos": 1758570376734898000, "timezone": "EDT"}, "pdl__is_leaf": true}, "def": "N", "pdl__result": 10, "requirements": [], "pdl__timing": {"start_nanos": 1758570376734692000, "end_nanos": 1758570402847080000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "data", "pdl__id": "text.3", "defs": {}, "data": {"pdl__expr": "\nNow computing fibonacci(${ N })\n", "pdl__result": "\nNow computing fibonacci(10)\n"}, "pdl__result": "\nNow computing fibonacci(10)\n", "requirements": [], "pdl__timing": {"start_nanos": 1758570402847126000, "end_nanos": 1758570402848198000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "code", "pdl__id": "text.4.code", "defs": {}, "lang": "python", "code": {"kind": "data", "pdl__id": "text.4.code.code", "defs": {}, "data": {"pdl__expr": "s = \"\"\"'${ CODE } '\"\"\"\nresult = s.split(\"```\")[1].replace(\"python\", \"\")\n", "pdl__result": "s = \"\"\"'Here is a simple Python function that computes the Fibonacci sequence using recursion:\n\n```python\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n```\n\nThis function takes an integer `n` as input and returns the nth number in the Fibonacci sequence. However, it's important to note that this implementation has exponential time complexity due to repeated calculations of the same subproblems (i.e., it performs a lot of redundant work). For larger inputs, you should use an iterative approach or memoization to improve performance:\n\n```python\ndef fibonacci_iterative(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n\n    fib_values = [0, 1] + [0] * (n - 2)\n    for i in range(2, n):\n        fib_values[i] = fib_values[i - 1] + fib_values[i - 2]\n    return fib_values[n - 1]\n```\n\nThis version of the function uses an iterative approach with a list to store previously computed Fibonacci numbers, reducing time complexity to linear. '\"\"\"\nresult = s.split(\"```\")[1].replace(\"python\", \"\")\n"}, "pdl__result": "s = \"\"\"'Here is a simple Python function that computes the Fibonacci sequence using recursion:\n\n```python\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n```\n\nThis function takes an integer `n` as input and returns the nth number in the Fibonacci sequence. However, it's important to note that this implementation has exponential time complexity due to repeated calculations of the same subproblems (i.e., it performs a lot of redundant work). For larger inputs, you should use an iterative approach or memoization to improve performance:\n\n```python\ndef fibonacci_iterative(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n\n    fib_values = [0, 1] + [0] * (n - 2)\n    for i in range(2, n):\n        fib_values[i] = fib_values[i - 1] + fib_values[i - 2]\n    return fib_values[n - 1]\n```\n\nThis version of the function uses an iterative approach with a list to store previously computed Fibonacci numbers, reducing time complexity to linear. '\"\"\"\nresult = s.split(\"```\")[1].replace(\"python\", \"\")\n", "requirements": [], "pdl__timing": {"start_nanos": 1758570402848362000, "end_nanos": 1758570402849111000, "timezone": "EDT"}, "pdl__is_leaf": true}, "def": "EXTRACTED", "pdl__result": "\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n", "requirements": [], "pdl__timing": {"start_nanos": 1758570402848298000, "end_nanos": 1758570402849328000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "code", "pdl__id": "text.5.code", "defs": {}, "lang": "python", "code": {"kind": "data", "pdl__id": "text.5.code.code", "defs": {}, "data": {"pdl__expr": "${ EXTRACTED }\nresult = fibonacci(${ N })\n", "pdl__result": "\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n\nresult = fibonacci(10)\n"}, "pdl__result": "\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n\nresult = fibonacci(10)\n", "requirements": [], "pdl__timing": {"start_nanos": 1758570402849435000, "end_nanos": 1758570402850313000, "timezone": "EDT"}, "pdl__is_leaf": true}, "def": "RESULT", "contribute": [], "pdl__result": 34, "requirements": [], "pdl__timing": {"start_nanos": 1758570402849377000, "end_nanos": 1758570402850566000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "data", "pdl__id": "text.6", "defs": {}, "data": {"pdl__expr": "The result is: ${ RESULT }", "pdl__result": "The result is: 34"}, "pdl__result": "The result is: 34", "requirements": [], "pdl__timing": {"start_nanos": 1758570402850602000, "end_nanos": 1758570402851272000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "data", "pdl__id": "text.7", "defs": {}, "data": {"pdl__expr": "\n\nExplain what the above code does and what the result means\n\n", "pdl__result": "\n\nExplain what the above code does and what the result means\n\n"}, "pdl__result": "\n\nExplain what the above code does and what the result means\n\n", "requirements": [], "pdl__timing": {"start_nanos": 1758570402851344000, "end_nanos": 1758570402851427000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "model", "pdl__id": "text.8.model", "pdl__context": [{"content": "Here is a simple Python function that computes the Fibonacci sequence using recursion:\n\n```python\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n```\n\nThis function takes an integer `n` as input and returns the nth number in the Fibonacci sequence. However, it's important to note that this implementation has exponential time complexity due to repeated calculations of the same subproblems (i.e., it performs a lot of redundant work). For larger inputs, you should use an iterative approach or memoization to improve performance:\n\n```python\ndef fibonacci_iterative(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n\n    fib_values = [0, 1] + [0] * (n - 2)\n    for i in range(2, n):\n        fib_values[i] = fib_values[i - 1] + fib_values[i - 2]\n    return fib_values[n - 1]\n```\n\nThis version of the function uses an iterative approach with a list to store previously computed Fibonacci numbers, reducing time complexity to linear.", "role": "assistant", "pdl__defsite": "text.0.model"}, {"role": "user", "content": "\nFind a random number between 1 and 20\n", "pdl__defsite": "text.1"}, {"role": "user", "content": "10", "pdl__defsite": "text.2.code"}, {"role": "user", "content": "\nNow computing fibonacci(10)\n", "pdl__defsite": "text.3"}, {"role": "user", "content": "\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n", "pdl__defsite": "text.4.code"}, {"role": "user", "content": "The result is: 34", "pdl__defsite": "text.6"}, {"role": "user", "content": "\n\nExplain what the above code does and what the result means\n\n", "pdl__defsite": "text.7"}], "defs": {}, "platform": "litellm", "model": {"pdl__expr": "ollama_chat/granite3.2:2b", "pdl__result": "ollama_chat/granite3.2:2b"}, "input": {"kind": "data", "pdl__id": "text.8.model.input", "defs": {}, "data": {"pdl__expr": "${ pdl_context }", "pdl__result": [{"content": "Here is a simple Python function that computes the Fibonacci sequence using recursion:\n\n```python\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n```\n\nThis function takes an integer `n` as input and returns the nth number in the Fibonacci sequence. However, it's important to note that this implementation has exponential time complexity due to repeated calculations of the same subproblems (i.e., it performs a lot of redundant work). For larger inputs, you should use an iterative approach or memoization to improve performance:\n\n```python\ndef fibonacci_iterative(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n\n    fib_values = [0, 1] + [0] * (n - 2)\n    for i in range(2, n):\n        fib_values[i] = fib_values[i - 1] + fib_values[i - 2]\n    return fib_values[n - 1]\n```\n\nThis version of the function uses an iterative approach with a list to store previously computed Fibonacci numbers, reducing time complexity to linear.", "role": "assistant", "pdl__defsite": "text.0.model"}, {"role": "user", "content": "\nFind a random number between 1 and 20\n", "pdl__defsite": "text.1"}, {"role": "user", "content": "10", "pdl__defsite": "text.2.code"}, {"role": "user", "content": "\nNow computing fibonacci(10)\n", "pdl__defsite": "text.3"}, {"role": "user", "content": "\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n", "pdl__defsite": "text.4.code"}, {"role": "user", "content": "The result is: 34", "pdl__defsite": "text.6"}, {"role": "user", "content": "\n\nExplain what the above code does and what the result means\n\n", "pdl__defsite": "text.7"}]}, "pdl__result": [{"content": "Here is a simple Python function that computes the Fibonacci sequence using recursion:\n\n```python\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n```\n\nThis function takes an integer `n` as input and returns the nth number in the Fibonacci sequence. However, it's important to note that this implementation has exponential time complexity due to repeated calculations of the same subproblems (i.e., it performs a lot of redundant work). For larger inputs, you should use an iterative approach or memoization to improve performance:\n\n```python\ndef fibonacci_iterative(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n\n    fib_values = [0, 1] + [0] * (n - 2)\n    for i in range(2, n):\n        fib_values[i] = fib_values[i - 1] + fib_values[i - 2]\n    return fib_values[n - 1]\n```\n\nThis version of the function uses an iterative approach with a list to store previously computed Fibonacci numbers, reducing time complexity to linear.", "role": "assistant", "pdl__defsite": "text.0.model"}, {"role": "user", "content": "\nFind a random number between 1 and 20\n", "pdl__defsite": "text.1"}, {"role": "user", "content": "10", "pdl__defsite": "text.2.code"}, {"role": "user", "content": "\nNow computing fibonacci(10)\n", "pdl__defsite": "text.3"}, {"role": "user", "content": "\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n", "pdl__defsite": "text.4.code"}, {"role": "user", "content": "The result is: 34", "pdl__defsite": "text.6"}, {"role": "user", "content": "\n\nExplain what the above code does and what the result means\n\n", "pdl__defsite": "text.7"}], "requirements": [], "pdl__timing": {"start_nanos": 1758570402851672000, "end_nanos": 1758570402853096000, "timezone": "EDT"}, "pdl__is_leaf": true}, "parameters": {"pdl__expr": null}, "pdl__usage": {"completion_tokens": 560, "prompt_tokens": 506}, "pdl__model_input": [{"content": "Here is a simple Python function that computes the Fibonacci sequence using recursion:\n\n```python\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n```\n\nThis function takes an integer `n` as input and returns the nth number in the Fibonacci sequence. However, it's important to note that this implementation has exponential time complexity due to repeated calculations of the same subproblems (i.e., it performs a lot of redundant work). For larger inputs, you should use an iterative approach or memoization to improve performance:\n\n```python\ndef fibonacci_iterative(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n\n    fib_values = [0, 1] + [0] * (n - 2)\n    for i in range(2, n):\n        fib_values[i] = fib_values[i - 1] + fib_values[i - 2]\n    return fib_values[n - 1]\n```\n\nThis version of the function uses an iterative approach with a list to store previously computed Fibonacci numbers, reducing time complexity to linear.", "role": "assistant", "pdl__defsite": "text.0.model"}, {"role": "user", "content": "\nFind a random number between 1 and 20\n", "pdl__defsite": "text.1"}, {"role": "user", "content": "10", "pdl__defsite": "text.2.code"}, {"role": "user", "content": "\nNow computing fibonacci(10)\n", "pdl__defsite": "text.3"}, {"role": "user", "content": "\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n", "pdl__defsite": "text.4.code"}, {"role": "user", "content": "The result is: 34", "pdl__defsite": "text.6"}, {"role": "user", "content": "\n\nExplain what the above code does and what the result means\n\n", "pdl__defsite": "text.7"}], "pdl__result": "The provided Python code defines a recursive function `fibonacci(n)` that calculates the nth number in the Fibonacci sequence. The Fibonacci sequence is a series of numbers where each number is the sum of the two preceding ones, usually starting with 0 and 1 (0, 1, 1, 2, 3, 5, 8, ...).\n\nHere's what the code does:\n\n1. It checks if the input `n` is less than or equal to zero; if so, it returns a message indicating that the input should be a positive integer.\n2. If `n` equals 1, it returns 0 (the first number in the Fibonacci sequence).\n3. If `n` equals 2, it returns 1 (the second number in the Fibonacci sequence).\n4. For any other value of `n`, it recursively calls itself with arguments `n - 1` and `n - 2`, then adds the results together to get the nth Fibonacci number.\n\nNow let's compute `fibonacci(10)` using this function:\n\n- `fibonacci(10)`:\n  - Recursively calls `fibonacci(9)`.\n  - Then, `fibonacci(8)`, which in turn calls `fibonacci(7)` and `fibonacci(6)`.\n  - This process continues until it reaches the base cases of `n = 1` and `n = 2`.\n- The function will calculate:\n  - `fibonacci(9) = fibonacci(8) + fibonacci(7)`\n  - `fibonacci(8) = fibonacci(7) + fibonacci(6)`\n  - ...\n  - Eventually, it'll compute the following values in sequence:\n    - `fibonacci(2) = 1` (base case)\n    - `fibonacci(3) = 1 + 1 = 2`\n    - `fibonacci(4) = 2 + 1 = 3`\n    - ...\n    - Finally, it will return the result of `fibonacci(10)`, which is:\n      - `fibonacci(9) = fibonacci(8) + fibonacci(7)`\n      - `= (55 + 34) = 89`\n      - `fibonacci(10) = 89 + 61 = 150`\n\nThe result of `fibonacci(10)` is **150**. This means that the 10th number in the Fibonacci sequence (starting from 0 and 1) is 150.", "requirements": [], "pdl__timing": {"start_nanos": 1758570402851506000, "end_nanos": 1758570454761940000, "timezone": "EDT"}, "pdl__is_leaf": true}], "pdl__result": "Here is a simple Python function that computes the Fibonacci sequence using recursion:\n\n```python\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\n```\n\nThis function takes an integer `n` as input and returns the nth number in the Fibonacci sequence. However, it's important to note that this implementation has exponential time complexity due to repeated calculations of the same subproblems (i.e., it performs a lot of redundant work). For larger inputs, you should use an iterative approach or memoization to improve performance:\n\n```python\ndef fibonacci_iterative(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n\n    fib_values = [0, 1] + [0] * (n - 2)\n    for i in range(2, n):\n        fib_values[i] = fib_values[i - 1] + fib_values[i - 2]\n    return fib_values[n - 1]\n```\n\nThis version of the function uses an iterative approach with a list to store previously computed Fibonacci numbers, reducing time complexity to linear.\nFind a random number between 1 and 20\n10\nNow computing fibonacci(10)\n\ndef fibonacci(n):\n    if n <= 0:\n        return \"Input should be a positive integer.\"\n    elif n == 1:\n        return 0\n    elif n == 2:\n        return 1\n    else:\n        return fibonacci(n - 1) + fibonacci(n - 2)\nThe result is: 34\n\nExplain what the above code does and what the result means\n\nThe provided Python code defines a recursive function `fibonacci(n)` that calculates the nth number in the Fibonacci sequence. The Fibonacci sequence is a series of numbers where each number is the sum of the two preceding ones, usually starting with 0 and 1 (0, 1, 1, 2, 3, 5, 8, ...).\n\nHere's what the code does:\n\n1. It checks if the input `n` is less than or equal to zero; if so, it returns a message indicating that the input should be a positive integer.\n2. If `n` equals 1, it returns 0 (the first number in the Fibonacci sequence).\n3. If `n` equals 2, it returns 1 (the second number in the Fibonacci sequence).\n4. For any other value of `n`, it recursively calls itself with arguments `n - 1` and `n - 2`, then adds the results together to get the nth Fibonacci number.\n\nNow let's compute `fibonacci(10)` using this function:\n\n- `fibonacci(10)`:\n  - Recursively calls `fibonacci(9)`.\n  - Then, `fibonacci(8)`, which in turn calls `fibonacci(7)` and `fibonacci(6)`.\n  - This process continues until it reaches the base cases of `n = 1` and `n = 2`.\n- The function will calculate:\n  - `fibonacci(9) = fibonacci(8) + fibonacci(7)`\n  - `fibonacci(8) = fibonacci(7) + fibonacci(6)`\n  - ...\n  - Eventually, it'll compute the following values in sequence:\n    - `fibonacci(2) = 1` (base case)\n    - `fibonacci(3) = 1 + 1 = 2`\n    - `fibonacci(4) = 2 + 1 = 3`\n    - ...\n    - Finally, it will return the result of `fibonacci(10)`, which is:\n      - `fibonacci(9) = fibonacci(8) + fibonacci(7)`\n      - `= (55 + 34) = 89`\n      - `fibonacci(10) = 89 + 61 = 150`\n\nThe result of `fibonacci(10)` is **150**. This means that the 10th number in the Fibonacci sequence (starting from 0 and 1) is 150.", "requirements": [], "pdl__timing": {"start_nanos": 1758570374541980000, "end_nanos": 1758570402853499000, "timezone": "EDT"}, "pdl__is_leaf": false}
\ No newline at end of file
diff --git a/pdl-live-react/src/demos/demo4.json b/pdl-live-react/src/demos/demo4.json
index a273ec807..a578d0ed2 100644
--- a/pdl-live-react/src/demos/demo4.json
+++ b/pdl-live-react/src/demos/demo4.json
@@ -1 +1 @@
-{"kind": "text", "pdl__id": "text", "description": "A Chatbot that responds to user's questions", "defs": {}, "context": "dependent", "text": [{"kind": "read", "pdl__id": "text.0.read", "defs": {}, "read": {"pdl__expr": null}, "message": "What is your query?\n", "multiline": false, "pdl__result": "what is the fastest animal?", "pdl__timing": {"start_nanos": 1750790161423592000, "end_nanos": 1750790161424042000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "repeat", "pdl__id": "text.1.repeat", "defs": {}, "context": "dependent", "while": true, "repeat": {"kind": "text", "pdl__id": "text.1.repeat.1.text", "defs": {}, "context": "dependent", "text": [{"kind": "model", "pdl__id": "text.1.repeat.1.text.0.model", "defs": {}, "platform": "litellm", "model": "ollama_chat/granite3.2:2b", "input": "${ pdl_context }", "pdl__timing": {"start_nanos": 1750790193774187000, "end_nanos": 1750790241578995000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "read", "pdl__id": "text.1.repeat.1.text.1.read", "defs": {}, "read": null, "message": "\nIs this a good answer[yes/no]?\n", "multiline": false, "def": "eval", "pdl__timing": {"start_nanos": 1750790241579111000, "end_nanos": 1750790241579422000, "timezone": "EDT"}, "pdl__is_leaf": true}, "\n", {"kind": "if", "pdl__id": "text.1.repeat.1.text.3.if", "defs": {}, "context": "dependent", "if": "${ eval == 'no' }", "then": {"kind": "text", "pdl__id": "text.1.repeat.0.text.3.if.0.text", "defs": {}, "context": "dependent", "text": [{"kind": "read", "pdl__id": "text.1.repeat.0.text.3.if.0.text.0.read", "defs": {}, "read": null, "message": "Why not?\n", "multiline": false, "pdl__timing": {"start_nanos": 1750790193772348000, "end_nanos": 1750790193772540000, "timezone": "EDT"}, "pdl__is_leaf": true}], "pdl__timing": {"start_nanos": 1750790193772192000, "end_nanos": 1750790193772608000, "timezone": "EDT"}, "pdl__is_leaf": false}, "pdl__timing": {"start_nanos": 1750790241580453000, "end_nanos": 1750790241581880000, "timezone": "EDT"}, "pdl__is_leaf": false}], "pdl__timing": {"start_nanos": 1750790193774066000, "end_nanos": 1750790241581951000, "timezone": "EDT"}, "pdl__is_leaf": false}, "until": "${ eval == 'yes'}", "join": {"with": ""}, "pdl__trace": [{"kind": "text", "pdl__id": "text.1.repeat.0.text", "defs": {}, "context": "dependent", "text": [{"kind": "model", "pdl__id": "text.1.repeat.0.text.0.model", "pdl__context": [{"role": "user", "content": "what is the fastest animal?", "pdl__defsite": "text.0.read"}], "defs": {}, "platform": "litellm", "model": {"pdl__expr": "ollama_chat/granite3.2:2b", "pdl__result": "ollama_chat/granite3.2:2b"}, "input": {"kind": "data", "pdl__id": "text.1.repeat.0.text.0.model", "defs": {}, "data": {"pdl__expr": "${ pdl_context }", "pdl__result": [{"role": "user", "content": "what is the fastest animal?", "pdl__defsite": "text.0.read"}]}, "pdl__result": [{"role": "user", "content": "what is the fastest animal?", "pdl__defsite": "text.0.read"}], "pdl__timing": {"start_nanos": 1750790161431221000, "end_nanos": 1750790161432629000, "timezone": "EDT"}, "pdl__is_leaf": true}, "parameters": {"pdl__expr": null}, "pdl__usage": {"completion_tokens": 337, "prompt_tokens": 13}, "pdl__model_input": [{"role": "user", "content": "what is the fastest animal?", "pdl__defsite": "text.0.read"}], "pdl__result": "The fastest animal in the world is the cheetah (Acinonyx jubatus). This remarkable creature can reach speeds up to 60-70 miles per hour (97-113 kilometers per hour) over short distances, making it the swiftest land animal. Cheetahs have several adaptations that contribute to their incredible speed:\n\n1. Muscular build: Cheetahs possess a lean, muscular body with long, slender limbs and a flexible spine, which allows for efficient movement during high-speed chases.\n2. Large lungs and heart: Their powerful respiratory system enables them to take in more oxygen per breath, while their enlarged heart pumps blood rapidly to supply the muscles with energy.\n3. Specialized claws: Cheetahs have retractable claws that provide traction during acceleration and help maintain grip on prey or terrain.\n4. Flexible spine: Their flexible spines allow for a running style called \"streaking,\" where the body is almost horizontal, reducing air resistance and enabling faster top speeds.\n5. Short, muscular tail: Cheetahs use their tails as an aerodynamic rudder to help maintain balance during high-speed pursuits.\n6. Blood composition: Their unique blood composition enables efficient oxygen transport, which is crucial for sustaining such intense activity.\n7. Thick fur coat: Cheetahs have a short, dense coat that helps regulate body temperature during high-speed chases and protects them from the sun's harmful rays.\n\nDespite their incredible speed, cheetahs are not built for endurance running; they can only maintain these top speeds for about 30 seconds to a minute before tiring due to the energy demands of such intense activity.", "pdl__timing": {"start_nanos": 1750790161428969000, "end_nanos": 1750790193765379000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "read", "pdl__id": "text.1.repeat.0.text.1.read", "defs": {}, "read": {"pdl__expr": null}, "message": "\nIs this a good answer[yes/no]?\n", "multiline": false, "def": "eval", "pdl__result": "no", "pdl__timing": {"start_nanos": 1750790193765504000, "end_nanos": 1750790193766076000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "data", "pdl__id": "text.1.repeat.0.text.2", "defs": {}, "data": {"pdl__expr": "\n", "pdl__result": "\n"}, "pdl__result": "\n", "pdl__timing": {"start_nanos": 1750790193766146000, "end_nanos": 1750790193767113000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "if", "pdl__id": "text.1.repeat.0.text.3.if", "defs": {}, "context": "dependent", "if": {"pdl__expr": "${ eval == 'no' }", "pdl__result": true}, "then": {"kind": "text", "pdl__id": "text.1.repeat.0.text.3.if.0.text", "defs": {}, "context": "dependent", "text": [{"kind": "read", "pdl__id": "text.1.repeat.0.text.3.if.0.text.0.read", "defs": {}, "read": {"pdl__expr": null}, "message": "Why not?\n", "multiline": false, "pdl__result": "in europe?", "pdl__timing": {"start_nanos": 1750790193772348000, "end_nanos": 1750790193772540000, "timezone": "EDT"}, "pdl__is_leaf": true}], "pdl__result": "in europe?", "pdl__timing": {"start_nanos": 1750790193772192000, "end_nanos": 1750790193772608000, "timezone": "EDT"}, "pdl__is_leaf": false}, "pdl__result": "in europe?", "pdl__timing": {"start_nanos": 1750790193767335000, "end_nanos": 1750790193772650000, "timezone": "EDT"}, "pdl__is_leaf": false}], "pdl__result": "The fastest animal in the world is the cheetah (Acinonyx jubatus). This remarkable creature can reach speeds up to 60-70 miles per hour (97-113 kilometers per hour) over short distances, making it the swiftest land animal. Cheetahs have several adaptations that contribute to their incredible speed:\n\n1. Muscular build: Cheetahs possess a lean, muscular body with long, slender limbs and a flexible spine, which allows for efficient movement during high-speed chases.\n2. Large lungs and heart: Their powerful respiratory system enables them to take in more oxygen per breath, while their enlarged heart pumps blood rapidly to supply the muscles with energy.\n3. Specialized claws: Cheetahs have retractable claws that provide traction during acceleration and help maintain grip on prey or terrain.\n4. Flexible spine: Their flexible spines allow for a running style called \"streaking,\" where the body is almost horizontal, reducing air resistance and enabling faster top speeds.\n5. Short, muscular tail: Cheetahs use their tails as an aerodynamic rudder to help maintain balance during high-speed pursuits.\n6. Blood composition: Their unique blood composition enables efficient oxygen transport, which is crucial for sustaining such intense activity.\n7. Thick fur coat: Cheetahs have a short, dense coat that helps regulate body temperature during high-speed chases and protects them from the sun's harmful rays.\n\nDespite their incredible speed, cheetahs are not built for endurance running; they can only maintain these top speeds for about 30 seconds to a minute before tiring due to the energy demands of such intense activity.no\nin europe?", "pdl__timing": {"start_nanos": 1750790161424514000, "end_nanos": 1750790193772710000, "timezone": "EDT"}, "pdl__is_leaf": false}, {"kind": "text", "pdl__id": "text.1.repeat.1.text", "defs": {}, "context": "dependent", "text": [{"kind": "model", "pdl__id": "text.1.repeat.1.text.0.model", "pdl__context": [{"role": "user", "content": "what is the fastest animal?", "pdl__defsite": "text.0.read"}, {"content": "The fastest animal in the world is the cheetah (Acinonyx jubatus). This remarkable creature can reach speeds up to 60-70 miles per hour (97-113 kilometers per hour) over short distances, making it the swiftest land animal. Cheetahs have several adaptations that contribute to their incredible speed:\n\n1. Muscular build: Cheetahs possess a lean, muscular body with long, slender limbs and a flexible spine, which allows for efficient movement during high-speed chases.\n2. Large lungs and heart: Their powerful respiratory system enables them to take in more oxygen per breath, while their enlarged heart pumps blood rapidly to supply the muscles with energy.\n3. Specialized claws: Cheetahs have retractable claws that provide traction during acceleration and help maintain grip on prey or terrain.\n4. Flexible spine: Their flexible spines allow for a running style called \"streaking,\" where the body is almost horizontal, reducing air resistance and enabling faster top speeds.\n5. Short, muscular tail: Cheetahs use their tails as an aerodynamic rudder to help maintain balance during high-speed pursuits.\n6. Blood composition: Their unique blood composition enables efficient oxygen transport, which is crucial for sustaining such intense activity.\n7. Thick fur coat: Cheetahs have a short, dense coat that helps regulate body temperature during high-speed chases and protects them from the sun's harmful rays.\n\nDespite their incredible speed, cheetahs are not built for endurance running; they can only maintain these top speeds for about 30 seconds to a minute before tiring due to the energy demands of such intense activity.", "role": "assistant", "pdl__defsite": "text.1.repeat.1.text.0.model"}, {"role": "user", "content": "no", "pdl__defsite": "text.1.repeat.0.text.1.read"}, {"role": "user", "content": "\n", "pdl__defsite": "text.1.repeat.0.text.2"}, {"role": "user", "content": "in europe?", "pdl__defsite": "text.1.repeat.0.text.3.if.0.text.0.read"}], "defs": {}, "platform": "litellm", "model": {"pdl__expr": "ollama_chat/granite3.2:2b", "pdl__result": "ollama_chat/granite3.2:2b"}, "input": {"kind": "data", "pdl__id": "text.1.repeat.1.text.0.model", "defs": {}, "data": {"pdl__expr": "${ pdl_context }", "pdl__result": [{"role": "user", "content": "what is the fastest animal?", "pdl__defsite": "text.0.read"}, {"content": "The fastest animal in the world is the cheetah (Acinonyx jubatus). This remarkable creature can reach speeds up to 60-70 miles per hour (97-113 kilometers per hour) over short distances, making it the swiftest land animal. Cheetahs have several adaptations that contribute to their incredible speed:\n\n1. Muscular build: Cheetahs possess a lean, muscular body with long, slender limbs and a flexible spine, which allows for efficient movement during high-speed chases.\n2. Large lungs and heart: Their powerful respiratory system enables them to take in more oxygen per breath, while their enlarged heart pumps blood rapidly to supply the muscles with energy.\n3. Specialized claws: Cheetahs have retractable claws that provide traction during acceleration and help maintain grip on prey or terrain.\n4. Flexible spine: Their flexible spines allow for a running style called \"streaking,\" where the body is almost horizontal, reducing air resistance and enabling faster top speeds.\n5. Short, muscular tail: Cheetahs use their tails as an aerodynamic rudder to help maintain balance during high-speed pursuits.\n6. Blood composition: Their unique blood composition enables efficient oxygen transport, which is crucial for sustaining such intense activity.\n7. Thick fur coat: Cheetahs have a short, dense coat that helps regulate body temperature during high-speed chases and protects them from the sun's harmful rays.\n\nDespite their incredible speed, cheetahs are not built for endurance running; they can only maintain these top speeds for about 30 seconds to a minute before tiring due to the energy demands of such intense activity.", "role": "assistant", "pdl__defsite": "text.1.repeat.1.text.0.model"}, {"role": "user", "content": "no", "pdl__defsite": "text.1.repeat.0.text.1.read"}, {"role": "user", "content": "\n", "pdl__defsite": "text.1.repeat.0.text.2"}, {"role": "user", "content": "in europe?", "pdl__defsite": "text.1.repeat.0.text.3.if.0.text.0.read"}]}, "pdl__result": [{"role": "user", "content": "what is the fastest animal?", "pdl__defsite": "text.0.read"}, {"content": "The fastest animal in the world is the cheetah (Acinonyx jubatus). This remarkable creature can reach speeds up to 60-70 miles per hour (97-113 kilometers per hour) over short distances, making it the swiftest land animal. Cheetahs have several adaptations that contribute to their incredible speed:\n\n1. Muscular build: Cheetahs possess a lean, muscular body with long, slender limbs and a flexible spine, which allows for efficient movement during high-speed chases.\n2. Large lungs and heart: Their powerful respiratory system enables them to take in more oxygen per breath, while their enlarged heart pumps blood rapidly to supply the muscles with energy.\n3. Specialized claws: Cheetahs have retractable claws that provide traction during acceleration and help maintain grip on prey or terrain.\n4. Flexible spine: Their flexible spines allow for a running style called \"streaking,\" where the body is almost horizontal, reducing air resistance and enabling faster top speeds.\n5. Short, muscular tail: Cheetahs use their tails as an aerodynamic rudder to help maintain balance during high-speed pursuits.\n6. Blood composition: Their unique blood composition enables efficient oxygen transport, which is crucial for sustaining such intense activity.\n7. Thick fur coat: Cheetahs have a short, dense coat that helps regulate body temperature during high-speed chases and protects them from the sun's harmful rays.\n\nDespite their incredible speed, cheetahs are not built for endurance running; they can only maintain these top speeds for about 30 seconds to a minute before tiring due to the energy demands of such intense activity.", "role": "assistant", "pdl__defsite": "text.1.repeat.1.text.0.model"}, {"role": "user", "content": "no", "pdl__defsite": "text.1.repeat.0.text.1.read"}, {"role": "user", "content": "\n", "pdl__defsite": "text.1.repeat.0.text.2"}, {"role": "user", "content": "in europe?", "pdl__defsite": "text.1.repeat.0.text.3.if.0.text.0.read"}], "pdl__timing": {"start_nanos": 1750790193774407000, "end_nanos": 1750790193775291000, "timezone": "EDT"}, "pdl__is_leaf": true}, "parameters": {"pdl__expr": null}, "pdl__usage": {"completion_tokens": 343, "prompt_tokens": 371}, "pdl__model_input": [{"role": "user", "content": "what is the fastest animal?", "pdl__defsite": "text.0.read"}, {"content": "The fastest animal in the world is the cheetah (Acinonyx jubatus). This remarkable creature can reach speeds up to 60-70 miles per hour (97-113 kilometers per hour) over short distances, making it the swiftest land animal. Cheetahs have several adaptations that contribute to their incredible speed:\n\n1. Muscular build: Cheetahs possess a lean, muscular body with long, slender limbs and a flexible spine, which allows for efficient movement during high-speed chases.\n2. Large lungs and heart: Their powerful respiratory system enables them to take in more oxygen per breath, while their enlarged heart pumps blood rapidly to supply the muscles with energy.\n3. Specialized claws: Cheetahs have retractable claws that provide traction during acceleration and help maintain grip on prey or terrain.\n4. Flexible spine: Their flexible spines allow for a running style called \"streaking,\" where the body is almost horizontal, reducing air resistance and enabling faster top speeds.\n5. Short, muscular tail: Cheetahs use their tails as an aerodynamic rudder to help maintain balance during high-speed pursuits.\n6. Blood composition: Their unique blood composition enables efficient oxygen transport, which is crucial for sustaining such intense activity.\n7. Thick fur coat: Cheetahs have a short, dense coat that helps regulate body temperature during high-speed chases and protects them from the sun's harmful rays.\n\nDespite their incredible speed, cheetahs are not built for endurance running; they can only maintain these top speeds for about 30 seconds to a minute before tiring due to the energy demands of such intense activity.", "role": "assistant", "pdl__defsite": "text.1.repeat.1.text.0.model"}, {"role": "user", "content": "no", "pdl__defsite": "text.1.repeat.0.text.1.read"}, {"role": "user", "content": "\n", "pdl__defsite": "text.1.repeat.0.text.2"}, {"role": "user", "content": "in europe?", "pdl__defsite": "text.1.repeat.0.text.3.if.0.text.0.read"}], "pdl__result": "In Europe, the fastest land animal is typically considered to be the greyhound (Canis lupus familiaris). Greyhards are well-known for their exceptional speed and agility in racing events. Here's a brief overview of why they hold this title:\n\n1. Muscular build: Greyhounds have a lean, muscular body with long, slender legs and a flexible spine, which allows them to cover ground quickly.\n2. Short, powerful limbs: Their short, strong legs enable efficient propulsion during high-speed runs.\n3. Lightweight frame: Greyhounds are relatively small dogs with lightweight frames, reducing the amount of energy required for movement.\n4. Specialized paws and nails: They have compact, muscular feet with non-retractable claws that provide traction on various surfaces while minimizing air resistance during high speeds.\n5. Efficient respiratory system: Greyhounds possess a well-developed lung capacity and heart, allowing them to take in more oxygen per breath and pump blood efficiently for sustained performance.\n6. Short coat: Their short, smooth coats help regulate body temperature during intense exercise while providing some protection from the sun's rays.\n7. High-speed running style: Greyhounds run with a unique \"racing\" gait called a trot or lope, where their bodies are almost horizontal to reduce air resistance and maximize speed.\n\nWhile cheetahs are the fastest animal overall, greyhounds excel in European races due to their breeding for speed and adaptation to the terrain they typically race on \u2013 usually flat, open spaces with minimal obstacles. Greyhounds can reach impressive top speeds of around 43-45 miles per hour (70 kilometers per hour), making them formidable competitors in European racing events.", "pdl__timing": {"start_nanos": 1750790193774187000, "end_nanos": 1750790241578995000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "read", "pdl__id": "text.1.repeat.1.text.1.read", "defs": {}, "read": {"pdl__expr": null}, "message": "\nIs this a good answer[yes/no]?\n", "multiline": false, "def": "eval", "pdl__result": "yes", "pdl__timing": {"start_nanos": 1750790241579111000, "end_nanos": 1750790241579422000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "data", "pdl__id": "text.1.repeat.1.text.2", "defs": {}, "data": {"pdl__expr": "\n", "pdl__result": "\n"}, "pdl__result": "\n", "pdl__timing": {"start_nanos": 1750790241579481000, "end_nanos": 1750790241580266000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "if", "pdl__id": "text.1.repeat.1.text.3.if", "defs": {}, "context": "dependent", "if": {"pdl__expr": "${ eval == 'no' }", "pdl__result": false}, "then": {"kind": "text", "pdl__id": "text.1.repeat.0.text.3.if.0.text", "defs": {}, "context": "dependent", "text": [{"kind": "read", "pdl__id": "text.1.repeat.0.text.3.if.0.text.0.read", "defs": {}, "read": null, "message": "Why not?\n", "multiline": false, "pdl__timing": {"start_nanos": 1750790193772348000, "end_nanos": 1750790193772540000, "timezone": "EDT"}, "pdl__is_leaf": true}], "pdl__timing": {"start_nanos": 1750790193772192000, "end_nanos": 1750790193772608000, "timezone": "EDT"}, "pdl__is_leaf": false}, "pdl__result": "", "pdl__timing": {"start_nanos": 1750790241580453000, "end_nanos": 1750790241581880000, "timezone": "EDT"}, "pdl__is_leaf": false}], "pdl__result": "In Europe, the fastest land animal is typically considered to be the greyhound (Canis lupus familiaris). Greyhards are well-known for their exceptional speed and agility in racing events. Here's a brief overview of why they hold this title:\n\n1. Muscular build: Greyhounds have a lean, muscular body with long, slender legs and a flexible spine, which allows them to cover ground quickly.\n2. Short, powerful limbs: Their short, strong legs enable efficient propulsion during high-speed runs.\n3. Lightweight frame: Greyhounds are relatively small dogs with lightweight frames, reducing the amount of energy required for movement.\n4. Specialized paws and nails: They have compact, muscular feet with non-retractable claws that provide traction on various surfaces while minimizing air resistance during high speeds.\n5. Efficient respiratory system: Greyhounds possess a well-developed lung capacity and heart, allowing them to take in more oxygen per breath and pump blood efficiently for sustained performance.\n6. Short coat: Their short, smooth coats help regulate body temperature during intense exercise while providing some protection from the sun's rays.\n7. High-speed running style: Greyhounds run with a unique \"racing\" gait called a trot or lope, where their bodies are almost horizontal to reduce air resistance and maximize speed.\n\nWhile cheetahs are the fastest animal overall, greyhounds excel in European races due to their breeding for speed and adaptation to the terrain they typically race on \u2013 usually flat, open spaces with minimal obstacles. Greyhounds can reach impressive top speeds of around 43-45 miles per hour (70 kilometers per hour), making them formidable competitors in European racing events.yes\n", "pdl__timing": {"start_nanos": 1750790193774066000, "end_nanos": 1750790241581951000, "timezone": "EDT"}, "pdl__is_leaf": false}], "pdl__result": "The fastest animal in the world is the cheetah (Acinonyx jubatus). This remarkable creature can reach speeds up to 60-70 miles per hour (97-113 kilometers per hour) over short distances, making it the swiftest land animal. Cheetahs have several adaptations that contribute to their incredible speed:\n\n1. Muscular build: Cheetahs possess a lean, muscular body with long, slender limbs and a flexible spine, which allows for efficient movement during high-speed chases.\n2. Large lungs and heart: Their powerful respiratory system enables them to take in more oxygen per breath, while their enlarged heart pumps blood rapidly to supply the muscles with energy.\n3. Specialized claws: Cheetahs have retractable claws that provide traction during acceleration and help maintain grip on prey or terrain.\n4. Flexible spine: Their flexible spines allow for a running style called \"streaking,\" where the body is almost horizontal, reducing air resistance and enabling faster top speeds.\n5. Short, muscular tail: Cheetahs use their tails as an aerodynamic rudder to help maintain balance during high-speed pursuits.\n6. Blood composition: Their unique blood composition enables efficient oxygen transport, which is crucial for sustaining such intense activity.\n7. Thick fur coat: Cheetahs have a short, dense coat that helps regulate body temperature during high-speed chases and protects them from the sun's harmful rays.\n\nDespite their incredible speed, cheetahs are not built for endurance running; they can only maintain these top speeds for about 30 seconds to a minute before tiring due to the energy demands of such intense activity.no\nin europe?In Europe, the fastest land animal is typically considered to be the greyhound (Canis lupus familiaris). Greyhards are well-known for their exceptional speed and agility in racing events. Here's a brief overview of why they hold this title:\n\n1. Muscular build: Greyhounds have a lean, muscular body with long, slender legs and a flexible spine, which allows them to cover ground quickly.\n2. Short, powerful limbs: Their short, strong legs enable efficient propulsion during high-speed runs.\n3. Lightweight frame: Greyhounds are relatively small dogs with lightweight frames, reducing the amount of energy required for movement.\n4. Specialized paws and nails: They have compact, muscular feet with non-retractable claws that provide traction on various surfaces while minimizing air resistance during high speeds.\n5. Efficient respiratory system: Greyhounds possess a well-developed lung capacity and heart, allowing them to take in more oxygen per breath and pump blood efficiently for sustained performance.\n6. Short coat: Their short, smooth coats help regulate body temperature during intense exercise while providing some protection from the sun's rays.\n7. High-speed running style: Greyhounds run with a unique \"racing\" gait called a trot or lope, where their bodies are almost horizontal to reduce air resistance and maximize speed.\n\nWhile cheetahs are the fastest animal overall, greyhounds excel in European races due to their breeding for speed and adaptation to the terrain they typically race on \u2013 usually flat, open spaces with minimal obstacles. Greyhounds can reach impressive top speeds of around 43-45 miles per hour (70 kilometers per hour), making them formidable competitors in European racing events.yes\n", "pdl__timing": {"start_nanos": 1750790161424213000, "end_nanos": 1750790241583341000, "timezone": "EDT"}, "pdl__is_leaf": false}], "pdl__result": "what is the fastest animal?The fastest animal in the world is the cheetah (Acinonyx jubatus). This remarkable creature can reach speeds up to 60-70 miles per hour (97-113 kilometers per hour) over short distances, making it the swiftest land animal. Cheetahs have several adaptations that contribute to their incredible speed:\n\n1. Muscular build: Cheetahs possess a lean, muscular body with long, slender limbs and a flexible spine, which allows for efficient movement during high-speed chases.\n2. Large lungs and heart: Their powerful respiratory system enables them to take in more oxygen per breath, while their enlarged heart pumps blood rapidly to supply the muscles with energy.\n3. Specialized claws: Cheetahs have retractable claws that provide traction during acceleration and help maintain grip on prey or terrain.\n4. Flexible spine: Their flexible spines allow for a running style called \"streaking,\" where the body is almost horizontal, reducing air resistance and enabling faster top speeds.\n5. Short, muscular tail: Cheetahs use their tails as an aerodynamic rudder to help maintain balance during high-speed pursuits.\n6. Blood composition: Their unique blood composition enables efficient oxygen transport, which is crucial for sustaining such intense activity.\n7. Thick fur coat: Cheetahs have a short, dense coat that helps regulate body temperature during high-speed chases and protects them from the sun's harmful rays.\n\nDespite their incredible speed, cheetahs are not built for endurance running; they can only maintain these top speeds for about 30 seconds to a minute before tiring due to the energy demands of such intense activity.no\nin europe?In Europe, the fastest land animal is typically considered to be the greyhound (Canis lupus familiaris). Greyhards are well-known for their exceptional speed and agility in racing events. Here's a brief overview of why they hold this title:\n\n1. Muscular build: Greyhounds have a lean, muscular body with long, slender legs and a flexible spine, which allows them to cover ground quickly.\n2. Short, powerful limbs: Their short, strong legs enable efficient propulsion during high-speed runs.\n3. Lightweight frame: Greyhounds are relatively small dogs with lightweight frames, reducing the amount of energy required for movement.\n4. Specialized paws and nails: They have compact, muscular feet with non-retractable claws that provide traction on various surfaces while minimizing air resistance during high speeds.\n5. Efficient respiratory system: Greyhounds possess a well-developed lung capacity and heart, allowing them to take in more oxygen per breath and pump blood efficiently for sustained performance.\n6. Short coat: Their short, smooth coats help regulate body temperature during intense exercise while providing some protection from the sun's rays.\n7. High-speed running style: Greyhounds run with a unique \"racing\" gait called a trot or lope, where their bodies are almost horizontal to reduce air resistance and maximize speed.\n\nWhile cheetahs are the fastest animal overall, greyhounds excel in European races due to their breeding for speed and adaptation to the terrain they typically race on \u2013 usually flat, open spaces with minimal obstacles. Greyhounds can reach impressive top speeds of around 43-45 miles per hour (70 kilometers per hour), making them formidable competitors in European racing events.yes\n", "pdl__timing": {"start_nanos": 1750790161271896000, "end_nanos": 1750790241583438000, "timezone": "EDT"}, "pdl__is_leaf": false}
\ No newline at end of file
+{"kind": "text", "pdl__id": "text", "description": "A Chatbot that responds to user's questions", "defs": {}, "context": "dependent", "text": [{"kind": "read", "pdl__id": "text.0.read", "defs": {}, "read": {"pdl__expr": null}, "message": "What is your query?\n", "multiline": false, "pdl__result": "what is the fastest animal?", "requirements": [], "pdl__timing": {"start_nanos": 1758570456662256000, "end_nanos": 1758570456662569000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "repeat", "pdl__id": "text.1.repeat", "defs": {}, "context": "dependent", "while": true, "repeat": {"kind": "text", "pdl__id": "text.1.repeat.1.text", "defs": {}, "context": "dependent", "text": [{"kind": "model", "pdl__id": "text.1.repeat.1.text.0.model", "defs": {}, "platform": "litellm", "model": "ollama_chat/granite3.2:2b", "input": "${ pdl_context }", "requirements": [], "pdl__timing": {"start_nanos": 1758570458959376000, "end_nanos": 1758570529622952000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "read", "pdl__id": "text.1.repeat.1.text.1.read", "defs": {}, "read": null, "message": "\nIs this a good answer[yes/no]?\n", "multiline": false, "def": "eval", "requirements": [], "pdl__timing": {"start_nanos": 1758570486602320000, "end_nanos": 1758570486603186000, "timezone": "EDT"}, "pdl__is_leaf": true}, "\n", {"kind": "if", "pdl__id": "text.1.repeat.1.text.3.if", "defs": {}, "context": "dependent", "if": "${ eval == 'no' }", "then": {"kind": "text", "pdl__id": "text.1.repeat.0.text.3.if.then.text", "defs": {}, "context": "dependent", "text": [{"kind": "read", "pdl__id": "text.1.repeat.0.text.3.if.then.text.0.read", "defs": {}, "read": null, "message": "Why not?\n", "multiline": false, "requirements": [], "pdl__timing": {"start_nanos": 1758570458957822000, "end_nanos": 1758570458958056000, "timezone": "EDT"}, "pdl__is_leaf": true}], "requirements": [], "pdl__timing": {"start_nanos": 1758570458957682000, "end_nanos": 1758570458958142000, "timezone": "EDT"}, "pdl__is_leaf": false}, "requirements": [], "pdl__timing": {"start_nanos": 1758570486603897000, "end_nanos": 1758570486604968000, "timezone": "EDT"}, "pdl__is_leaf": false}], "requirements": [], "pdl__timing": {"start_nanos": 1758570458959276000, "end_nanos": 1758570486605054000, "timezone": "EDT"}, "pdl__is_leaf": false}, "until": "${ eval == 'yes'}", "join": {"with": ""}, "pdl__trace": [{"kind": "text", "pdl__id": "text.1.repeat.0.text", "defs": {}, "context": "dependent", "text": [{"kind": "model", "pdl__id": "text.1.repeat.0.text.0.model", "pdl__context": [{"role": "user", "content": "what is the fastest animal?", "pdl__defsite": "text.0.read"}], "defs": {}, "platform": "litellm", "model": {"pdl__expr": "ollama_chat/granite3.2:2b", "pdl__result": "ollama_chat/granite3.2:2b"}, "input": {"kind": "data", "pdl__id": "text.1.repeat.0.text.0.model.input", "defs": {}, "data": {"pdl__expr": "${ pdl_context }", "pdl__result": [{"role": "user", "content": "what is the fastest animal?", "pdl__defsite": "text.0.read"}]}, "pdl__result": [{"role": "user", "content": "what is the fastest animal?", "pdl__defsite": "text.0.read"}], "requirements": [], "pdl__timing": {"start_nanos": 1758570456664465000, "end_nanos": 1758570456665318000, "timezone": "EDT"}, "pdl__is_leaf": true}, "parameters": {"pdl__expr": null}, "pdl__usage": {"completion_tokens": 422, "prompt_tokens": 50}, "pdl__model_input": [{"role": "user", "content": "what is the fastest animal?", "pdl__defsite": "text.0.read"}], "pdl__result": "The fastest animal in the world is the cheetah (Acinonyx jubatus). This remarkable creature can reach speeds up to 60-70 miles per hour (97-113 kilometers per hour) over short distances, making it the swiftest land animal. Cheetahs have several adaptations that contribute to their incredible speed:\n\n1. Muscular build: Cheetahs possess a lean, muscular body with long, slender limbs and a flexible spine, which allows for efficient movement during high-speed chases.\n2. Large lungs and heart: Their powerful respiratory system enables them to take in more oxygen per breath, while their enlarged heart pumps blood rapidly to supply the muscles with energy.\n3. Specialized claws: Cheetahs have retractable claws that provide traction during acceleration and help maintain grip on prey or terrain.\n4. Flexible spine: Their flexible spines allow for a running style called \"streaking,\" where the body is almost horizontal, reducing air resistance and enabling faster top speeds.\n5. Short, muscular tail: Cheetahs use their tails as an aerodynamic rudder to help maintain balance during high-speed pursuits.\n6. Blood composition: Their unique blood composition enables efficient oxygen transport, which is crucial for sustaining such intense activity.\n7. Thick fur coat: Cheetahs have a short, dense coat that helps regulate body temperature during high-speed chases and protects them from the sun's harmful rays.\n\nDespite their incredible speed, cheetahs are not built for endurance running; they can only maintain these top speeds for about 30 seconds to a minute before tiring due to the energy demands of such intense activity.", "requirements": [], "pdl__timing": {"start_nanos": 1758570456662913000, "end_nanos": 1758570486601969000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "read", "pdl__id": "text.1.repeat.0.text.1.read", "defs": {}, "read": {"pdl__expr": null}, "message": "\nIs this a good answer[yes/no]?\n", "multiline": false, "def": "eval", "pdl__result": "no", "requirements": [], "pdl__timing": {"start_nanos": 1758570458943688000, "end_nanos": 1758570458943935000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "data", "pdl__id": "text.1.repeat.0.text.2", "defs": {}, "data": {"pdl__expr": "\n", "pdl__result": "\n"}, "pdl__result": "\n", "requirements": [], "pdl__timing": {"start_nanos": 1758570458943971000, "end_nanos": 1758570458944694000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "if", "pdl__id": "text.1.repeat.0.text.3.if", "defs": {}, "context": "dependent", "if": {"pdl__expr": "${ eval == 'no' }", "pdl__result": true}, "then": {"kind": "text", "pdl__id": "text.1.repeat.0.text.3.if.then.text", "defs": {}, "context": "dependent", "text": [{"kind": "read", "pdl__id": "text.1.repeat.0.text.3.if.then.text.0.read", "defs": {}, "read": {"pdl__expr": null}, "message": "Why not?\n", "multiline": false, "pdl__result": "in europe?", "requirements": [], "pdl__timing": {"start_nanos": 1758570458957822000, "end_nanos": 1758570458958056000, "timezone": "EDT"}, "pdl__is_leaf": true}], "pdl__result": "in europe?", "requirements": [], "pdl__timing": {"start_nanos": 1758570458957682000, "end_nanos": 1758570458958142000, "timezone": "EDT"}, "pdl__is_leaf": false}, "pdl__result": "in europe?", "requirements": [], "pdl__timing": {"start_nanos": 1758570458944822000, "end_nanos": 1758570458958202000, "timezone": "EDT"}, "pdl__is_leaf": false}], "pdl__result": "The fastest animal in the world is the cheetah (Acinonyx jubatus). This remarkable creature can reach speeds up to 60-70 miles per hour (97-113 kilometers per hour) over short distances, making it the swiftest land animal. Cheetahs have several adaptations that contribute to their incredible speed:\n\n1. Muscular build: Cheetahs possess a lean, muscular body with long, slender limbs and a flexible spine, which allows for efficient movement during high-speed chases.\n2. Large lungs and heart: Their powerful respiratory system enables them to take in more oxygen per breath, while their enlarged heart pumps blood rapidly to supply the muscles with energy.\n3. Specialized claws: Cheetahs have retractable claws that provide traction during acceleration and help maintain grip on prey or terrain.\n4. Flexible spine: Their flexible spines allow for a running style called \"streaking,\" where the body is almost horizontal, reducing air resistance and enabling faster top speeds.\n5. Short, muscular tail: Cheetahs use their tails as an aerodynamic rudder to help maintain balance during high-speed pursuits.\n6. Blood composition: Their unique blood composition enables efficient oxygen transport, which is crucial for sustaining such intense activity.\n7. Thick fur coat: Cheetahs have a short, dense coat that helps regulate body temperature during high-speed chases and protects them from the sun's harmful rays.\n\nDespite their incredible speed, cheetahs are not built for endurance running; they can only maintain these top speeds for about 30 seconds to a minute before tiring due to the energy demands of such intense activity.no\nin europe?", "requirements": [], "pdl__timing": {"start_nanos": 1758570456662801000, "end_nanos": 1758570458958280000, "timezone": "EDT"}, "pdl__is_leaf": false}, {"kind": "text", "pdl__id": "text.1.repeat.1.text", "defs": {}, "context": "dependent", "text": [{"kind": "model", "pdl__id": "text.1.repeat.1.text.0.model", "pdl__context": [{"role": "user", "content": "what is the fastest animal?", "pdl__defsite": "text.0.read"}, {"content": "The fastest animal in the world is the cheetah (Acinonyx jubatus). This remarkable creature can reach speeds up to 60-70 miles per hour (97-113 kilometers per hour) over short distances, making it the swiftest land animal. Cheetahs have several adaptations that contribute to their incredible speed:\n\n1. Muscular build: Cheetahs possess a lean, muscular body with long, slender limbs and a flexible spine, which allows for efficient movement during high-speed chases.\n2. Large lungs and heart: Their powerful respiratory system enables them to take in more oxygen per breath, while their enlarged heart pumps blood rapidly to supply the muscles with energy.\n3. Specialized claws: Cheetahs have retractable claws that provide traction during acceleration and help maintain grip on prey or terrain.\n4. Flexible spine: Their flexible spines allow for a running style called \"streaking,\" where the body is almost horizontal, reducing air resistance and enabling faster top speeds.\n5. Short, muscular tail: Cheetahs use their tails as an aerodynamic rudder to help maintain balance during high-speed pursuits.\n6. Blood composition: Their unique blood composition enables efficient oxygen transport, which is crucial for sustaining such intense activity.\n7. Thick fur coat: Cheetahs have a short, dense coat that helps regulate body temperature during high-speed chases and protects them from the sun's harmful rays.\n\nDespite their incredible speed, cheetahs are not built for endurance running; they can only maintain these top speeds for about 30 seconds to a minute before tiring due to the energy demands of such intense activity.", "role": "assistant", "pdl__defsite": "text.1.repeat.1.text.0.model"}, {"role": "user", "content": "no", "pdl__defsite": "text.1.repeat.0.text.1.read"}, {"role": "user", "content": "\n", "pdl__defsite": "text.1.repeat.0.text.2"}, {"role": "user", "content": "in europe?", "pdl__defsite": "text.1.repeat.0.text.3.if.then.text.0.read"}], "defs": {}, "platform": "litellm", "model": {"pdl__expr": "ollama_chat/granite3.2:2b", "pdl__result": "ollama_chat/granite3.2:2b"}, "input": {"kind": "data", "pdl__id": "text.1.repeat.1.text.0.model.input", "defs": {}, "data": {"pdl__expr": "${ pdl_context }", "pdl__result": [{"role": "user", "content": "what is the fastest animal?", "pdl__defsite": "text.0.read"}, {"content": "The fastest animal in the world is the cheetah (Acinonyx jubatus). This remarkable creature can reach speeds up to 60-70 miles per hour (97-113 kilometers per hour) over short distances, making it the swiftest land animal. Cheetahs have several adaptations that contribute to their incredible speed:\n\n1. Muscular build: Cheetahs possess a lean, muscular body with long, slender limbs and a flexible spine, which allows for efficient movement during high-speed chases.\n2. Large lungs and heart: Their powerful respiratory system enables them to take in more oxygen per breath, while their enlarged heart pumps blood rapidly to supply the muscles with energy.\n3. Specialized claws: Cheetahs have retractable claws that provide traction during acceleration and help maintain grip on prey or terrain.\n4. Flexible spine: Their flexible spines allow for a running style called \"streaking,\" where the body is almost horizontal, reducing air resistance and enabling faster top speeds.\n5. Short, muscular tail: Cheetahs use their tails as an aerodynamic rudder to help maintain balance during high-speed pursuits.\n6. Blood composition: Their unique blood composition enables efficient oxygen transport, which is crucial for sustaining such intense activity.\n7. Thick fur coat: Cheetahs have a short, dense coat that helps regulate body temperature during high-speed chases and protects them from the sun's harmful rays.\n\nDespite their incredible speed, cheetahs are not built for endurance running; they can only maintain these top speeds for about 30 seconds to a minute before tiring due to the energy demands of such intense activity.", "role": "assistant", "pdl__defsite": "text.1.repeat.1.text.0.model"}, {"role": "user", "content": "no", "pdl__defsite": "text.1.repeat.0.text.1.read"}, {"role": "user", "content": "\n", "pdl__defsite": "text.1.repeat.0.text.2"}, {"role": "user", "content": "in europe?", "pdl__defsite": "text.1.repeat.0.text.3.if.then.text.0.read"}]}, "pdl__result": [{"role": "user", "content": "what is the fastest animal?", "pdl__defsite": "text.0.read"}, {"content": "The fastest animal in the world is the cheetah (Acinonyx jubatus). This remarkable creature can reach speeds up to 60-70 miles per hour (97-113 kilometers per hour) over short distances, making it the swiftest land animal. Cheetahs have several adaptations that contribute to their incredible speed:\n\n1. Muscular build: Cheetahs possess a lean, muscular body with long, slender limbs and a flexible spine, which allows for efficient movement during high-speed chases.\n2. Large lungs and heart: Their powerful respiratory system enables them to take in more oxygen per breath, while their enlarged heart pumps blood rapidly to supply the muscles with energy.\n3. Specialized claws: Cheetahs have retractable claws that provide traction during acceleration and help maintain grip on prey or terrain.\n4. Flexible spine: Their flexible spines allow for a running style called \"streaking,\" where the body is almost horizontal, reducing air resistance and enabling faster top speeds.\n5. Short, muscular tail: Cheetahs use their tails as an aerodynamic rudder to help maintain balance during high-speed pursuits.\n6. Blood composition: Their unique blood composition enables efficient oxygen transport, which is crucial for sustaining such intense activity.\n7. Thick fur coat: Cheetahs have a short, dense coat that helps regulate body temperature during high-speed chases and protects them from the sun's harmful rays.\n\nDespite their incredible speed, cheetahs are not built for endurance running; they can only maintain these top speeds for about 30 seconds to a minute before tiring due to the energy demands of such intense activity.", "role": "assistant", "pdl__defsite": "text.1.repeat.1.text.0.model"}, {"role": "user", "content": "no", "pdl__defsite": "text.1.repeat.0.text.1.read"}, {"role": "user", "content": "\n", "pdl__defsite": "text.1.repeat.0.text.2"}, {"role": "user", "content": "in europe?", "pdl__defsite": "text.1.repeat.0.text.3.if.then.text.0.read"}], "requirements": [], "pdl__timing": {"start_nanos": 1758570458959554000, "end_nanos": 1758570458960223000, "timezone": "EDT"}, "pdl__is_leaf": true}, "parameters": {"pdl__expr": null}, "pdl__usage": {"completion_tokens": 434, "prompt_tokens": 485}, "pdl__model_input": [{"role": "user", "content": "what is the fastest animal?", "pdl__defsite": "text.0.read"}, {"content": "The fastest animal in the world is the cheetah (Acinonyx jubatus). This remarkable creature can reach speeds up to 60-70 miles per hour (97-113 kilometers per hour) over short distances, making it the swiftest land animal. Cheetahs have several adaptations that contribute to their incredible speed:\n\n1. Muscular build: Cheetahs possess a lean, muscular body with long, slender limbs and a flexible spine, which allows for efficient movement during high-speed chases.\n2. Large lungs and heart: Their powerful respiratory system enables them to take in more oxygen per breath, while their enlarged heart pumps blood rapidly to supply the muscles with energy.\n3. Specialized claws: Cheetahs have retractable claws that provide traction during acceleration and help maintain grip on prey or terrain.\n4. Flexible spine: Their flexible spines allow for a running style called \"streaking,\" where the body is almost horizontal, reducing air resistance and enabling faster top speeds.\n5. Short, muscular tail: Cheetahs use their tails as an aerodynamic rudder to help maintain balance during high-speed pursuits.\n6. Blood composition: Their unique blood composition enables efficient oxygen transport, which is crucial for sustaining such intense activity.\n7. Thick fur coat: Cheetahs have a short, dense coat that helps regulate body temperature during high-speed chases and protects them from the sun's harmful rays.\n\nDespite their incredible speed, cheetahs are not built for endurance running; they can only maintain these top speeds for about 30 seconds to a minute before tiring due to the energy demands of such intense activity.", "role": "assistant", "pdl__defsite": "text.1.repeat.1.text.0.model"}, {"role": "user", "content": "no", "pdl__defsite": "text.1.repeat.0.text.1.read"}, {"role": "user", "content": "\n", "pdl__defsite": "text.1.repeat.0.text.2"}, {"role": "user", "content": "in europe?", "pdl__defsite": "text.1.repeat.0.text.3.if.then.text.0.read"}], "pdl__result": "In Europe, the fastest land animal is typically considered to be the greyhound (Canis lupus familiaris). Greyhards are well-known for their exceptional speed and agility in racing events. Here's a brief overview of why they hold this title:\n\n1. Muscular build: Greyhounds have a lean, muscular body with long, slender legs and a flexible spine, which allows them to cover ground quickly.\n2. Short, powerful limbs: Their short, strong legs enable efficient propulsion during high-speed runs.\n3. Lightweight frame: Greyhounds are relatively small dogs with lightweight frames, reducing the amount of energy required for movement.\n4. Specialized paws and nails: They have compact, muscular feet with non-retractable claws that provide traction on various surfaces while minimizing air resistance during high speeds.\n5. Efficient respiratory system: Greyhounds possess a well-developed lung capacity and heart, allowing them to take in more oxygen per breath and pump blood efficiently for sustained performance.\n6. Short coat: Their short, smooth coats help regulate body temperature during intense exercise while providing some protection from the sun's rays.\n7. High-speed running style: Greyhounds run with a unique \"racing\" gait called a trot or lope, where their bodies are almost horizontal to reduce air resistance and maximize speed.\n\nWhile cheetahs are the fastest animal overall, greyhounds excel in European races due to their breeding for speed and adaptation to the terrain they typically race on \u2013 usually flat, open spaces with minimal obstacles. Greyhounds can reach impressive top speeds of around 43-45 miles per hour (70 kilometers per hour), making them formidable competitors in European racing events.", "requirements": [], "pdl__timing": {"start_nanos": 1758570458959376000, "end_nanos": 1758570529622952000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "read", "pdl__id": "text.1.repeat.1.text.1.read", "defs": {}, "read": {"pdl__expr": null}, "message": "\nIs this a good answer[yes/no]?\n", "multiline": false, "def": "eval", "pdl__result": "yes", "requirements": [], "pdl__timing": {"start_nanos": 1758570486602320000, "end_nanos": 1758570486603186000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "data", "pdl__id": "text.1.repeat.1.text.2", "defs": {}, "data": {"pdl__expr": "\n", "pdl__result": "\n"}, "pdl__result": "\n", "requirements": [], "pdl__timing": {"start_nanos": 1758570486603227000, "end_nanos": 1758570486603795000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "if", "pdl__id": "text.1.repeat.1.text.3.if", "defs": {}, "context": "dependent", "if": {"pdl__expr": "${ eval == 'no' }", "pdl__result": false}, "then": {"kind": "text", "pdl__id": "text.1.repeat.0.text.3.if.then.text", "defs": {}, "context": "dependent", "text": [{"kind": "read", "pdl__id": "text.1.repeat.0.text.3.if.then.text.0.read", "defs": {}, "read": null, "message": "Why not?\n", "multiline": false, "requirements": [], "pdl__timing": {"start_nanos": 1758570458957822000, "end_nanos": 1758570458958056000, "timezone": "EDT"}, "pdl__is_leaf": true}], "requirements": [], "pdl__timing": {"start_nanos": 1758570458957682000, "end_nanos": 1758570458958142000, "timezone": "EDT"}, "pdl__is_leaf": false}, "pdl__result": "", "requirements": [], "pdl__timing": {"start_nanos": 1758570486603897000, "end_nanos": 1758570486604968000, "timezone": "EDT"}, "pdl__is_leaf": false}], "pdl__result": "In Europe, the fastest land animal is typically considered to be the greyhound (Canis lupus familiaris). Greyhards are well-known for their exceptional speed and agility in racing events. Here's a brief overview of why they hold this title:\n\n1. Muscular build: Greyhounds have a lean, muscular body with long, slender legs and a flexible spine, which allows them to cover ground quickly.\n2. Short, powerful limbs: Their short, strong legs enable efficient propulsion during high-speed runs.\n3. Lightweight frame: Greyhounds are relatively small dogs with lightweight frames, reducing the amount of energy required for movement.\n4. Specialized paws and nails: They have compact, muscular feet with non-retractable claws that provide traction on various surfaces while minimizing air resistance during high speeds.\n5. Efficient respiratory system: Greyhounds possess a well-developed lung capacity and heart, allowing them to take in more oxygen per breath and pump blood efficiently for sustained performance.\n6. Short coat: Their short, smooth coats help regulate body temperature during intense exercise while providing some protection from the sun's rays.\n7. High-speed running style: Greyhounds run with a unique \"racing\" gait called a trot or lope, where their bodies are almost horizontal to reduce air resistance and maximize speed.\n\nWhile cheetahs are the fastest animal overall, greyhounds excel in European races due to their breeding for speed and adaptation to the terrain they typically race on \u2013 usually flat, open spaces with minimal obstacles. Greyhounds can reach impressive top speeds of around 43-45 miles per hour (70 kilometers per hour), making them formidable competitors in European racing events.yes\n", "requirements": [], "pdl__timing": {"start_nanos": 1758570458959276000, "end_nanos": 1758570486605054000, "timezone": "EDT"}, "pdl__is_leaf": false}], "pdl__result": "The fastest animal in the world is the cheetah (Acinonyx jubatus). This remarkable creature can reach speeds up to 60-70 miles per hour (97-113 kilometers per hour) over short distances, making it the swiftest land animal. Cheetahs have several adaptations that contribute to their incredible speed:\n\n1. Muscular build: Cheetahs possess a lean, muscular body with long, slender limbs and a flexible spine, which allows for efficient movement during high-speed chases.\n2. Large lungs and heart: Their powerful respiratory system enables them to take in more oxygen per breath, while their enlarged heart pumps blood rapidly to supply the muscles with energy.\n3. Specialized claws: Cheetahs have retractable claws that provide traction during acceleration and help maintain grip on prey or terrain.\n4. Flexible spine: Their flexible spines allow for a running style called \"streaking,\" where the body is almost horizontal, reducing air resistance and enabling faster top speeds.\n5. Short, muscular tail: Cheetahs use their tails as an aerodynamic rudder to help maintain balance during high-speed pursuits.\n6. Blood composition: Their unique blood composition enables efficient oxygen transport, which is crucial for sustaining such intense activity.\n7. Thick fur coat: Cheetahs have a short, dense coat that helps regulate body temperature during high-speed chases and protects them from the sun's harmful rays.\n\nDespite their incredible speed, cheetahs are not built for endurance running; they can only maintain these top speeds for about 30 seconds to a minute before tiring due to the energy demands of such intense activity.no\nin europe?In Europe, the fastest land animal is typically considered to be the greyhound (Canis lupus familiaris). Greyhards are well-known for their exceptional speed and agility in racing events. Here's a brief overview of why they hold this title:\n\n1. Muscular build: Greyhounds have a lean, muscular body with long, slender legs and a flexible spine, which allows them to cover ground quickly.\n2. Short, powerful limbs: Their short, strong legs enable efficient propulsion during high-speed runs.\n3. Lightweight frame: Greyhounds are relatively small dogs with lightweight frames, reducing the amount of energy required for movement.\n4. Specialized paws and nails: They have compact, muscular feet with non-retractable claws that provide traction on various surfaces while minimizing air resistance during high speeds.\n5. Efficient respiratory system: Greyhounds possess a well-developed lung capacity and heart, allowing them to take in more oxygen per breath and pump blood efficiently for sustained performance.\n6. Short coat: Their short, smooth coats help regulate body temperature during intense exercise while providing some protection from the sun's rays.\n7. High-speed running style: Greyhounds run with a unique \"racing\" gait called a trot or lope, where their bodies are almost horizontal to reduce air resistance and maximize speed.\n\nWhile cheetahs are the fastest animal overall, greyhounds excel in European races due to their breeding for speed and adaptation to the terrain they typically race on \u2013 usually flat, open spaces with minimal obstacles. Greyhounds can reach impressive top speeds of around 43-45 miles per hour (70 kilometers per hour), making them formidable competitors in European racing events.yes\n", "requirements": [], "pdl__timing": {"start_nanos": 1758570456662649000, "end_nanos": 1758570486606092000, "timezone": "EDT"}, "pdl__is_leaf": false}], "pdl__result": "what is the fastest animal?The fastest animal in the world is the cheetah (Acinonyx jubatus). This remarkable creature can reach speeds up to 60-70 miles per hour (97-113 kilometers per hour) over short distances, making it the swiftest land animal. Cheetahs have several adaptations that contribute to their incredible speed:\n\n1. Muscular build: Cheetahs possess a lean, muscular body with long, slender limbs and a flexible spine, which allows for efficient movement during high-speed chases.\n2. Large lungs and heart: Their powerful respiratory system enables them to take in more oxygen per breath, while their enlarged heart pumps blood rapidly to supply the muscles with energy.\n3. Specialized claws: Cheetahs have retractable claws that provide traction during acceleration and help maintain grip on prey or terrain.\n4. Flexible spine: Their flexible spines allow for a running style called \"streaking,\" where the body is almost horizontal, reducing air resistance and enabling faster top speeds.\n5. Short, muscular tail: Cheetahs use their tails as an aerodynamic rudder to help maintain balance during high-speed pursuits.\n6. Blood composition: Their unique blood composition enables efficient oxygen transport, which is crucial for sustaining such intense activity.\n7. Thick fur coat: Cheetahs have a short, dense coat that helps regulate body temperature during high-speed chases and protects them from the sun's harmful rays.\n\nDespite their incredible speed, cheetahs are not built for endurance running; they can only maintain these top speeds for about 30 seconds to a minute before tiring due to the energy demands of such intense activity.no\nin europe?In Europe, the fastest land animal is typically considered to be the greyhound (Canis lupus familiaris). Greyhards are well-known for their exceptional speed and agility in racing events. Here's a brief overview of why they hold this title:\n\n1. Muscular build: Greyhounds have a lean, muscular body with long, slender legs and a flexible spine, which allows them to cover ground quickly.\n2. Short, powerful limbs: Their short, strong legs enable efficient propulsion during high-speed runs.\n3. Lightweight frame: Greyhounds are relatively small dogs with lightweight frames, reducing the amount of energy required for movement.\n4. Specialized paws and nails: They have compact, muscular feet with non-retractable claws that provide traction on various surfaces while minimizing air resistance during high speeds.\n5. Efficient respiratory system: Greyhounds possess a well-developed lung capacity and heart, allowing them to take in more oxygen per breath and pump blood efficiently for sustained performance.\n6. Short coat: Their short, smooth coats help regulate body temperature during intense exercise while providing some protection from the sun's rays.\n7. High-speed running style: Greyhounds run with a unique \"racing\" gait called a trot or lope, where their bodies are almost horizontal to reduce air resistance and maximize speed.\n\nWhile cheetahs are the fastest animal overall, greyhounds excel in European races due to their breeding for speed and adaptation to the terrain they typically race on \u2013 usually flat, open spaces with minimal obstacles. Greyhounds can reach impressive top speeds of around 43-45 miles per hour (70 kilometers per hour), making them formidable competitors in European racing events.yes\n", "requirements": [], "pdl__timing": {"start_nanos": 1758570456662117000, "end_nanos": 1758570486606193000, "timezone": "EDT"}, "pdl__is_leaf": false}
\ No newline at end of file
diff --git a/pdl-live-react/src/demos/demo5.json b/pdl-live-react/src/demos/demo5.json
index 653e0b718..745299b9f 100644
--- a/pdl-live-react/src/demos/demo5.json
+++ b/pdl-live-react/src/demos/demo5.json
@@ -1 +1 @@
-{"kind": "data", "pdl__id": "data", "description": "Code explanation example", "defs": {"CODE": {"kind": "read", "pdl__id": "data.0.read", "defs": {}, "read": {"pdl__expr": "./data.yaml", "pdl__result": "./data.yaml"}, "message": null, "multiline": false, "pdl__result": "source_code: \n  |\n  @SuppressWarnings(\"unchecked\")\n  public static Map deserializeOffsetMap(String lastSourceOffset) throws IOException {\n    Map offsetMap;\n    if (lastSourceOffset == null || lastSourceOffset.isEmpty()) {    \n      offsetMap = new HashMap<>();  \n    } else {\n      offsetMap = JSON_MAPPER.readValue(lastSourceOffset, Map.class);  \n    }\n    return offsetMap;\n  }\nrepo_info: \n  repo: streamsets/datacollector\n  path: stagesupport/src/main/java/com/.../OffsetUtil.java\n  function_name: OffsetUtil.deserializeOffsetMap\n", "parser": "yaml", "pdl__timing": {"start_nanos": 1750790243957561000, "end_nanos": 1750790244091692000, "timezone": "EDT"}, "pdl__is_leaf": true}, "TRUTH": {"kind": "read", "pdl__id": "data.1.read", "defs": {}, "read": {"pdl__expr": "./ground_truth.txt", "pdl__result": "./ground_truth.txt"}, "message": null, "multiline": false, "pdl__result": "The function `deserializeOffsetMap` takes a string as input and returns a map. It first checks if the input string is null or empty. If it is, it creates a new empty map and returns it. Otherwise, it uses the Jackson library to parse the input string into a map and returns it.\n\nThe `@SuppressWarnings(\"unchecked\")` annotation is used to suppress the warning that the type of the parsed map is not checked. This is because the Jackson library is used to parse the input string into a map, but the specific type of the map is not known at compile time. Therefore, the warning is suppressed to avoid potential issues.\n", "pdl__timing": {"start_nanos": 1750790244091798000, "end_nanos": 1750790244092268000, "timezone": "EDT"}, "pdl__is_leaf": true}, "EXPLANATION": {"kind": "model", "pdl__id": "data.2.model", "defs": {}, "platform": "litellm", "model": {"pdl__expr": "ollama_chat/granite3.2:2b", "pdl__result": "ollama_chat/granite3.2:2b"}, "input": {"kind": "data", "pdl__id": "data.2.model", "defs": {}, "data": {"pdl__expr": "Here is some info about the location of the function in the repo.\nrepo:\n${ CODE.repo_info.repo }\npath: ${ CODE.repo_info.path }\nFunction_name: ${ CODE.repo_info.function_name }\n\n\nExplain the following code:\n```\n${ CODE.source_code }```\n", "pdl__result": "Here is some info about the location of the function in the repo.\nrepo:\nstreamsets/datacollector\npath: stagesupport/src/main/java/com/.../OffsetUtil.java\nFunction_name: OffsetUtil.deserializeOffsetMap\n\n\nExplain the following code:\n```\n@SuppressWarnings(\"unchecked\")\npublic static Map deserializeOffsetMap(String lastSourceOffset) throws IOException {\n  Map offsetMap;\n  if (lastSourceOffset == null || lastSourceOffset.isEmpty()) {    \n    offsetMap = new HashMap<>();  \n  } else {\n    offsetMap = JSON_MAPPER.readValue(lastSourceOffset, Map.class);  \n  }\n  return offsetMap;\n}\n```\n"}, "pdl__result": "Here is some info about the location of the function in the repo.\nrepo:\nstreamsets/datacollector\npath: stagesupport/src/main/java/com/.../OffsetUtil.java\nFunction_name: OffsetUtil.deserializeOffsetMap\n\n\nExplain the following code:\n```\n@SuppressWarnings(\"unchecked\")\npublic static Map deserializeOffsetMap(String lastSourceOffset) throws IOException {\n  Map offsetMap;\n  if (lastSourceOffset == null || lastSourceOffset.isEmpty()) {    \n    offsetMap = new HashMap<>();  \n  } else {\n    offsetMap = JSON_MAPPER.readValue(lastSourceOffset, Map.class);  \n  }\n  return offsetMap;\n}\n```\n", "pdl__timing": {"start_nanos": 1750790244092628000, "end_nanos": 1750790244100100000, "timezone": "EDT"}, "pdl__is_leaf": true}, "parameters": {"pdl__expr": null}, "pdl__usage": {"completion_tokens": 474, "prompt_tokens": 146}, "pdl__model_input": [{"role": "user", "content": "Here is some info about the location of the function in the repo.\nrepo:\nstreamsets/datacollector\npath: stagesupport/src/main/java/com/.../OffsetUtil.java\nFunction_name: OffsetUtil.deserializeOffsetMap\n\n\nExplain the following code:\n```\n@SuppressWarnings(\"unchecked\")\npublic static Map deserializeOffsetMap(String lastSourceOffset) throws IOException {\n  Map offsetMap;\n  if (lastSourceOffset == null || lastSourceOffset.isEmpty()) {    \n    offsetMap = new HashMap<>();  \n  } else {\n    offsetMap = JSON_MAPPER.readValue(lastSourceOffset, Map.class);  \n  }\n  return offsetMap;\n}\n```\n"}], "pdl__result": "The provided Java function `deserializeOffsetMap` is part of the StreamSets Data Collector (DC) codebase in the `stagesupport` package within the `com.../OffsetUtil.java` file. This function is designed to deserialize a JSON string containing offsets into a `Map` object. Here's an explanation of its purpose and functionality:\n\n1. **Purpose**: The primary goal of this method is to convert a JSON-formatted offset string (represented as `lastSourceOffset`) into a Java `Map` where keys are strings and values are also strings. This conversion allows for easier manipulation, storage, or further processing in the Data Collector application.\n\n2. **Parameters**:\n   - `lastSourceOffset`: A required parameter of type `String`, which is expected to contain JSON-formatted offset data.\n\n3. **Return Type**: The method returns a `Map`. This means it will return a map where each key and value are strings.\n\n4. **Throws**:\n   - `IOException`: In case the JSON string cannot be parsed due to an I/O error (e.g., network issues).\n\n5. **Logic**:\n\n   - The method first checks if `lastSourceOffset` is null or empty (`if (lastSourceOffset == null || lastSourceOffset.isEmpty())`). If true, it initializes a new `HashMap` called `offsetMap`.\n   - Otherwise, the function uses Jackson's JSON mapper (`JSON_MAPPER`) to deserialize the input string into a `Map`. This is done with `JSON_MAPPER.readValue(lastSourceOffset, Map.class)`.\n\n   - The deserialization process converts the JSON string into a Java map, where each key-value pair in the JSON will become an entry in the resulting map.\n\n6. **Security Note**: `@SuppressWarnings(\"unchecked\")` is used to suppress potential warnings about unchecked casts. This is because `JSON_MAPPER.readValue()` returns a `Map`, and there's no need for explicit type casting here, as Java's auto-boxing mechanism handles the conversion from JSON keys/values to `String`.\n\nIn summary, this function serves as an adapter between JSON offset data (in string format) and a standard Java map structure. It ensures that any provided offsets can be easily accessed or manipulated within the Data Collector application.", "pdl__timing": {"start_nanos": 1750790244092378000, "end_nanos": 1750790292307349000, "timezone": "EDT"}, "pdl__is_leaf": true}, "EVAL": {"kind": "code", "pdl__id": "data.3.code", "defs": {}, "lang": "python", "code": {"kind": "data", "pdl__id": "data.3.code", "defs": {}, "data": {"pdl__expr": "import textdistance\nexpl = \"\"\"\n${ EXPLANATION }\n\"\"\"\ntruth = \"\"\"\n${ TRUTH }\n\"\"\"\nresult = textdistance.levenshtein.normalized_similarity(expl, truth)\n", "pdl__result": "import textdistance\nexpl = \"\"\"\nThe provided Java function `deserializeOffsetMap` is part of the StreamSets Data Collector (DC) codebase in the `stagesupport` package within the `com.../OffsetUtil.java` file. This function is designed to deserialize a JSON string containing offsets into a `Map` object. Here's an explanation of its purpose and functionality:\n\n1. **Purpose**: The primary goal of this method is to convert a JSON-formatted offset string (represented as `lastSourceOffset`) into a Java `Map` where keys are strings and values are also strings. This conversion allows for easier manipulation, storage, or further processing in the Data Collector application.\n\n2. **Parameters**:\n   - `lastSourceOffset`: A required parameter of type `String`, which is expected to contain JSON-formatted offset data.\n\n3. **Return Type**: The method returns a `Map`. This means it will return a map where each key and value are strings.\n\n4. **Throws**:\n   - `IOException`: In case the JSON string cannot be parsed due to an I/O error (e.g., network issues).\n\n5. **Logic**:\n\n   - The method first checks if `lastSourceOffset` is null or empty (`if (lastSourceOffset == null || lastSourceOffset.isEmpty())`). If true, it initializes a new `HashMap` called `offsetMap`.\n   - Otherwise, the function uses Jackson's JSON mapper (`JSON_MAPPER`) to deserialize the input string into a `Map`. This is done with `JSON_MAPPER.readValue(lastSourceOffset, Map.class)`.\n\n   - The deserialization process converts the JSON string into a Java map, where each key-value pair in the JSON will become an entry in the resulting map.\n\n6. **Security Note**: `@SuppressWarnings(\"unchecked\")` is used to suppress potential warnings about unchecked casts. This is because `JSON_MAPPER.readValue()` returns a `Map`, and there's no need for explicit type casting here, as Java's auto-boxing mechanism handles the conversion from JSON keys/values to `String`.\n\nIn summary, this function serves as an adapter between JSON offset data (in string format) and a standard Java map structure. It ensures that any provided offsets can be easily accessed or manipulated within the Data Collector application.\n\"\"\"\ntruth = \"\"\"\nThe function `deserializeOffsetMap` takes a string as input and returns a map. It first checks if the input string is null or empty. If it is, it creates a new empty map and returns it. Otherwise, it uses the Jackson library to parse the input string into a map and returns it.\n\nThe `@SuppressWarnings(\"unchecked\")` annotation is used to suppress the warning that the type of the parsed map is not checked. This is because the Jackson library is used to parse the input string into a map, but the specific type of the map is not known at compile time. Therefore, the warning is suppressed to avoid potential issues.\n\n\"\"\"\nresult = textdistance.levenshtein.normalized_similarity(expl, truth)\n"}, "pdl__result": "import textdistance\nexpl = \"\"\"\nThe provided Java function `deserializeOffsetMap` is part of the StreamSets Data Collector (DC) codebase in the `stagesupport` package within the `com.../OffsetUtil.java` file. This function is designed to deserialize a JSON string containing offsets into a `Map` object. Here's an explanation of its purpose and functionality:\n\n1. **Purpose**: The primary goal of this method is to convert a JSON-formatted offset string (represented as `lastSourceOffset`) into a Java `Map` where keys are strings and values are also strings. This conversion allows for easier manipulation, storage, or further processing in the Data Collector application.\n\n2. **Parameters**:\n   - `lastSourceOffset`: A required parameter of type `String`, which is expected to contain JSON-formatted offset data.\n\n3. **Return Type**: The method returns a `Map`. This means it will return a map where each key and value are strings.\n\n4. **Throws**:\n   - `IOException`: In case the JSON string cannot be parsed due to an I/O error (e.g., network issues).\n\n5. **Logic**:\n\n   - The method first checks if `lastSourceOffset` is null or empty (`if (lastSourceOffset == null || lastSourceOffset.isEmpty())`). If true, it initializes a new `HashMap` called `offsetMap`.\n   - Otherwise, the function uses Jackson's JSON mapper (`JSON_MAPPER`) to deserialize the input string into a `Map`. This is done with `JSON_MAPPER.readValue(lastSourceOffset, Map.class)`.\n\n   - The deserialization process converts the JSON string into a Java map, where each key-value pair in the JSON will become an entry in the resulting map.\n\n6. **Security Note**: `@SuppressWarnings(\"unchecked\")` is used to suppress potential warnings about unchecked casts. This is because `JSON_MAPPER.readValue()` returns a `Map`, and there's no need for explicit type casting here, as Java's auto-boxing mechanism handles the conversion from JSON keys/values to `String`.\n\nIn summary, this function serves as an adapter between JSON offset data (in string format) and a standard Java map structure. It ensures that any provided offsets can be easily accessed or manipulated within the Data Collector application.\n\"\"\"\ntruth = \"\"\"\nThe function `deserializeOffsetMap` takes a string as input and returns a map. It first checks if the input string is null or empty. If it is, it creates a new empty map and returns it. Otherwise, it uses the Jackson library to parse the input string into a map and returns it.\n\nThe `@SuppressWarnings(\"unchecked\")` annotation is used to suppress the warning that the type of the parsed map is not checked. This is because the Jackson library is used to parse the input string into a map, but the specific type of the map is not known at compile time. Therefore, the warning is suppressed to avoid potential issues.\n\n\"\"\"\nresult = textdistance.levenshtein.normalized_similarity(expl, truth)\n", "pdl__timing": {"start_nanos": 1750790292307636000, "end_nanos": 1750790292309319000, "timezone": "EDT"}, "pdl__is_leaf": true}, "pdl__result": 0.1991833030852994, "pdl__timing": {"start_nanos": 1750790292307508000, "end_nanos": 1750790293850888000, "timezone": "EDT"}, "pdl__is_leaf": true}}, "data": {"pdl__expr": {"input": "${ CODE }", "output": "${ EXPLANATION }", "metric": "${ EVAL }"}, "pdl__result": {"input": {"source_code": "@SuppressWarnings(\"unchecked\")\npublic static Map deserializeOffsetMap(String lastSourceOffset) throws IOException {\n  Map offsetMap;\n  if (lastSourceOffset == null || lastSourceOffset.isEmpty()) {    \n    offsetMap = new HashMap<>();  \n  } else {\n    offsetMap = JSON_MAPPER.readValue(lastSourceOffset, Map.class);  \n  }\n  return offsetMap;\n}\n", "repo_info": {"repo": "streamsets/datacollector", "path": "stagesupport/src/main/java/com/.../OffsetUtil.java", "function_name": "OffsetUtil.deserializeOffsetMap"}}, "output": "The provided Java function `deserializeOffsetMap` is part of the StreamSets Data Collector (DC) codebase in the `stagesupport` package within the `com.../OffsetUtil.java` file. This function is designed to deserialize a JSON string containing offsets into a `Map` object. Here's an explanation of its purpose and functionality:\n\n1. **Purpose**: The primary goal of this method is to convert a JSON-formatted offset string (represented as `lastSourceOffset`) into a Java `Map` where keys are strings and values are also strings. This conversion allows for easier manipulation, storage, or further processing in the Data Collector application.\n\n2. **Parameters**:\n   - `lastSourceOffset`: A required parameter of type `String`, which is expected to contain JSON-formatted offset data.\n\n3. **Return Type**: The method returns a `Map`. This means it will return a map where each key and value are strings.\n\n4. **Throws**:\n   - `IOException`: In case the JSON string cannot be parsed due to an I/O error (e.g., network issues).\n\n5. **Logic**:\n\n   - The method first checks if `lastSourceOffset` is null or empty (`if (lastSourceOffset == null || lastSourceOffset.isEmpty())`). If true, it initializes a new `HashMap` called `offsetMap`.\n   - Otherwise, the function uses Jackson's JSON mapper (`JSON_MAPPER`) to deserialize the input string into a `Map`. This is done with `JSON_MAPPER.readValue(lastSourceOffset, Map.class)`.\n\n   - The deserialization process converts the JSON string into a Java map, where each key-value pair in the JSON will become an entry in the resulting map.\n\n6. **Security Note**: `@SuppressWarnings(\"unchecked\")` is used to suppress potential warnings about unchecked casts. This is because `JSON_MAPPER.readValue()` returns a `Map`, and there's no need for explicit type casting here, as Java's auto-boxing mechanism handles the conversion from JSON keys/values to `String`.\n\nIn summary, this function serves as an adapter between JSON offset data (in string format) and a standard Java map structure. It ensures that any provided offsets can be easily accessed or manipulated within the Data Collector application.", "metric": 0.1991833030852994}}, "pdl__result": {"input": {"source_code": "@SuppressWarnings(\"unchecked\")\npublic static Map deserializeOffsetMap(String lastSourceOffset) throws IOException {\n  Map offsetMap;\n  if (lastSourceOffset == null || lastSourceOffset.isEmpty()) {    \n    offsetMap = new HashMap<>();  \n  } else {\n    offsetMap = JSON_MAPPER.readValue(lastSourceOffset, Map.class);  \n  }\n  return offsetMap;\n}\n", "repo_info": {"repo": "streamsets/datacollector", "path": "stagesupport/src/main/java/com/.../OffsetUtil.java", "function_name": "OffsetUtil.deserializeOffsetMap"}}, "output": "The provided Java function `deserializeOffsetMap` is part of the StreamSets Data Collector (DC) codebase in the `stagesupport` package within the `com.../OffsetUtil.java` file. This function is designed to deserialize a JSON string containing offsets into a `Map` object. Here's an explanation of its purpose and functionality:\n\n1. **Purpose**: The primary goal of this method is to convert a JSON-formatted offset string (represented as `lastSourceOffset`) into a Java `Map` where keys are strings and values are also strings. This conversion allows for easier manipulation, storage, or further processing in the Data Collector application.\n\n2. **Parameters**:\n   - `lastSourceOffset`: A required parameter of type `String`, which is expected to contain JSON-formatted offset data.\n\n3. **Return Type**: The method returns a `Map`. This means it will return a map where each key and value are strings.\n\n4. **Throws**:\n   - `IOException`: In case the JSON string cannot be parsed due to an I/O error (e.g., network issues).\n\n5. **Logic**:\n\n   - The method first checks if `lastSourceOffset` is null or empty (`if (lastSourceOffset == null || lastSourceOffset.isEmpty())`). If true, it initializes a new `HashMap` called `offsetMap`.\n   - Otherwise, the function uses Jackson's JSON mapper (`JSON_MAPPER`) to deserialize the input string into a `Map`. This is done with `JSON_MAPPER.readValue(lastSourceOffset, Map.class)`.\n\n   - The deserialization process converts the JSON string into a Java map, where each key-value pair in the JSON will become an entry in the resulting map.\n\n6. **Security Note**: `@SuppressWarnings(\"unchecked\")` is used to suppress potential warnings about unchecked casts. This is because `JSON_MAPPER.readValue()` returns a `Map`, and there's no need for explicit type casting here, as Java's auto-boxing mechanism handles the conversion from JSON keys/values to `String`.\n\nIn summary, this function serves as an adapter between JSON offset data (in string format) and a standard Java map structure. It ensures that any provided offsets can be easily accessed or manipulated within the Data Collector application.", "metric": 0.1991833030852994}, "pdl__timing": {"start_nanos": 1750790243957428000, "end_nanos": 1750790293855075000, "timezone": "EDT"}, "pdl__is_leaf": true}
\ No newline at end of file
+{"kind": "data", "pdl__id": "data", "description": "Code explanation example", "defs": {"CODE": {"kind": "read", "pdl__id": "data.defs.CODE.read", "defs": {}, "read": {"pdl__expr": "./data.yaml", "pdl__result": "./data.yaml"}, "message": null, "multiline": false, "pdl__result": "source_code: \n  |\n  @SuppressWarnings(\"unchecked\")\n  public static Map deserializeOffsetMap(String lastSourceOffset) throws IOException {\n    Map offsetMap;\n    if (lastSourceOffset == null || lastSourceOffset.isEmpty()) {    \n      offsetMap = new HashMap<>();  \n    } else {\n      offsetMap = JSON_MAPPER.readValue(lastSourceOffset, Map.class);  \n    }\n    return offsetMap;\n  }\nrepo_info: \n  repo: streamsets/datacollector\n  path: stagesupport/src/main/java/com/.../OffsetUtil.java\n  function_name: OffsetUtil.deserializeOffsetMap\n", "parser": "yaml", "requirements": [], "pdl__timing": {"start_nanos": 1758570532102018000, "end_nanos": 1758570532104527000, "timezone": "EDT"}, "pdl__is_leaf": true}, "TRUTH": {"kind": "read", "pdl__id": "data.defs.TRUTH.read", "defs": {}, "read": {"pdl__expr": "./ground_truth.txt", "pdl__result": "./ground_truth.txt"}, "message": null, "multiline": false, "pdl__result": "The function `deserializeOffsetMap` takes a string as input and returns a map. It first checks if the input string is null or empty. If it is, it creates a new empty map and returns it. Otherwise, it uses the Jackson library to parse the input string into a map and returns it.\n\nThe `@SuppressWarnings(\"unchecked\")` annotation is used to suppress the warning that the type of the parsed map is not checked. This is because the Jackson library is used to parse the input string into a map, but the specific type of the map is not known at compile time. Therefore, the warning is suppressed to avoid potential issues.\n", "requirements": [], "pdl__timing": {"start_nanos": 1758570532104581000, "end_nanos": 1758570532105443000, "timezone": "EDT"}, "pdl__is_leaf": true}, "EXPLANATION": {"kind": "model", "pdl__id": "data.defs.EXPLANATION.model", "defs": {}, "platform": "litellm", "model": {"pdl__expr": "ollama_chat/granite3.2:2b", "pdl__result": "ollama_chat/granite3.2:2b"}, "input": {"kind": "data", "pdl__id": "data.defs.EXPLANATION.model.input", "defs": {}, "data": {"pdl__expr": "Here is some info about the location of the function in the repo.\nrepo:\n${ CODE.repo_info.repo }\npath: ${ CODE.repo_info.path }\nFunction_name: ${ CODE.repo_info.function_name }\n\n\nExplain the following code:\n```\n${ CODE.source_code }```\n", "pdl__result": "Here is some info about the location of the function in the repo.\nrepo:\nstreamsets/datacollector\npath: stagesupport/src/main/java/com/.../OffsetUtil.java\nFunction_name: OffsetUtil.deserializeOffsetMap\n\n\nExplain the following code:\n```\n@SuppressWarnings(\"unchecked\")\npublic static Map deserializeOffsetMap(String lastSourceOffset) throws IOException {\n  Map offsetMap;\n  if (lastSourceOffset == null || lastSourceOffset.isEmpty()) {    \n    offsetMap = new HashMap<>();  \n  } else {\n    offsetMap = JSON_MAPPER.readValue(lastSourceOffset, Map.class);  \n  }\n  return offsetMap;\n}\n```\n"}, "pdl__result": "Here is some info about the location of the function in the repo.\nrepo:\nstreamsets/datacollector\npath: stagesupport/src/main/java/com/.../OffsetUtil.java\nFunction_name: OffsetUtil.deserializeOffsetMap\n\n\nExplain the following code:\n```\n@SuppressWarnings(\"unchecked\")\npublic static Map deserializeOffsetMap(String lastSourceOffset) throws IOException {\n  Map offsetMap;\n  if (lastSourceOffset == null || lastSourceOffset.isEmpty()) {    \n    offsetMap = new HashMap<>();  \n  } else {\n    offsetMap = JSON_MAPPER.readValue(lastSourceOffset, Map.class);  \n  }\n  return offsetMap;\n}\n```\n", "requirements": [], "pdl__timing": {"start_nanos": 1758570532105817000, "end_nanos": 1758570532109869000, "timezone": "EDT"}, "pdl__is_leaf": true}, "parameters": {"pdl__expr": null}, "pdl__usage": {"completion_tokens": 502, "prompt_tokens": 209}, "pdl__model_input": [{"role": "user", "content": "Here is some info about the location of the function in the repo.\nrepo:\nstreamsets/datacollector\npath: stagesupport/src/main/java/com/.../OffsetUtil.java\nFunction_name: OffsetUtil.deserializeOffsetMap\n\n\nExplain the following code:\n```\n@SuppressWarnings(\"unchecked\")\npublic static Map deserializeOffsetMap(String lastSourceOffset) throws IOException {\n  Map offsetMap;\n  if (lastSourceOffset == null || lastSourceOffset.isEmpty()) {    \n    offsetMap = new HashMap<>();  \n  } else {\n    offsetMap = JSON_MAPPER.readValue(lastSourceOffset, Map.class);  \n  }\n  return offsetMap;\n}\n```\n"}], "pdl__result": "The provided Java function `deserializeOffsetMap` is part of the StreamSets Data Collector (DC) codebase in the `stagesupport` package within the `com.../OffsetUtil.java` file. This function is designed to deserialize a JSON string containing offsets into a `Map` object. Here's an explanation of its purpose and functionality:\n\n1. **Purpose**: The primary goal of this method is to convert a JSON-formatted offset string (represented as `lastSourceOffset`) into a Java `Map` where keys are strings and values are also strings. This conversion allows for easier manipulation, storage, or further processing in the Data Collector application.\n\n2. **Parameters**:\n   - `lastSourceOffset`: A required parameter of type `String`, which is expected to contain JSON-formatted offset data.\n\n3. **Return Type**: The method returns a `Map`. This means it will return a map where each key and value are strings.\n\n4. **Throws**:\n   - `IOException`: In case the JSON string cannot be parsed due to an I/O error (e.g., network issues).\n\n5. **Logic**:\n\n   - The method first checks if `lastSourceOffset` is null or empty (`if (lastSourceOffset == null || lastSourceOffset.isEmpty())`). If true, it initializes a new `HashMap` called `offsetMap`.\n   - Otherwise, the function uses Jackson's JSON mapper (`JSON_MAPPER`) to deserialize the input string into a `Map`. This is done with `JSON_MAPPER.readValue(lastSourceOffset, Map.class)`.\n\n   - The deserialization process converts the JSON string into a Java map, where each key-value pair in the JSON will become an entry in the resulting map.\n\n6. **Security Note**: `@SuppressWarnings(\"unchecked\")` is used to suppress potential warnings about unchecked casts. This is because `JSON_MAPPER.readValue()` returns a `Map`, and there's no need for explicit type casting here, as Java's auto-boxing mechanism handles the conversion from JSON keys/values to `String`.\n\nIn summary, this function serves as an adapter between JSON offset data (in string format) and a standard Java map structure. It ensures that any provided offsets can be easily accessed or manipulated within the Data Collector application.", "requirements": [], "pdl__timing": {"start_nanos": 1758570532105550000, "end_nanos": 1758570576943350000, "timezone": "EDT"}, "pdl__is_leaf": true}, "EVAL": {"kind": "code", "pdl__id": "data.defs.EVAL.code", "defs": {}, "lang": "python", "code": {"kind": "data", "pdl__id": "data.defs.EVAL.code.code", "defs": {}, "data": {"pdl__expr": "import textdistance\nexpl = \"\"\"\n${ EXPLANATION }\n\"\"\"\ntruth = \"\"\"\n${ TRUTH }\n\"\"\"\nresult = textdistance.levenshtein.normalized_similarity(expl, truth)\n", "pdl__result": "import textdistance\nexpl = \"\"\"\nThe provided Java function `deserializeOffsetMap` is part of the StreamSets Data Collector (DC) codebase in the `stagesupport` package within the `com.../OffsetUtil.java` file. This function is designed to deserialize a JSON string containing offsets into a `Map` object. Here's an explanation of its purpose and functionality:\n\n1. **Purpose**: The primary goal of this method is to convert a JSON-formatted offset string (represented as `lastSourceOffset`) into a Java `Map` where keys are strings and values are also strings. This conversion allows for easier manipulation, storage, or further processing in the Data Collector application.\n\n2. **Parameters**:\n   - `lastSourceOffset`: A required parameter of type `String`, which is expected to contain JSON-formatted offset data.\n\n3. **Return Type**: The method returns a `Map`. This means it will return a map where each key and value are strings.\n\n4. **Throws**:\n   - `IOException`: In case the JSON string cannot be parsed due to an I/O error (e.g., network issues).\n\n5. **Logic**:\n\n   - The method first checks if `lastSourceOffset` is null or empty (`if (lastSourceOffset == null || lastSourceOffset.isEmpty())`). If true, it initializes a new `HashMap` called `offsetMap`.\n   - Otherwise, the function uses Jackson's JSON mapper (`JSON_MAPPER`) to deserialize the input string into a `Map`. This is done with `JSON_MAPPER.readValue(lastSourceOffset, Map.class)`.\n\n   - The deserialization process converts the JSON string into a Java map, where each key-value pair in the JSON will become an entry in the resulting map.\n\n6. **Security Note**: `@SuppressWarnings(\"unchecked\")` is used to suppress potential warnings about unchecked casts. This is because `JSON_MAPPER.readValue()` returns a `Map`, and there's no need for explicit type casting here, as Java's auto-boxing mechanism handles the conversion from JSON keys/values to `String`.\n\nIn summary, this function serves as an adapter between JSON offset data (in string format) and a standard Java map structure. It ensures that any provided offsets can be easily accessed or manipulated within the Data Collector application.\n\"\"\"\ntruth = \"\"\"\nThe function `deserializeOffsetMap` takes a string as input and returns a map. It first checks if the input string is null or empty. If it is, it creates a new empty map and returns it. Otherwise, it uses the Jackson library to parse the input string into a map and returns it.\n\nThe `@SuppressWarnings(\"unchecked\")` annotation is used to suppress the warning that the type of the parsed map is not checked. This is because the Jackson library is used to parse the input string into a map, but the specific type of the map is not known at compile time. Therefore, the warning is suppressed to avoid potential issues.\n\n\"\"\"\nresult = textdistance.levenshtein.normalized_similarity(expl, truth)\n"}, "pdl__result": "import textdistance\nexpl = \"\"\"\nThe provided Java function `deserializeOffsetMap` is part of the StreamSets Data Collector (DC) codebase in the `stagesupport` package within the `com.../OffsetUtil.java` file. This function is designed to deserialize a JSON string containing offsets into a `Map` object. Here's an explanation of its purpose and functionality:\n\n1. **Purpose**: The primary goal of this method is to convert a JSON-formatted offset string (represented as `lastSourceOffset`) into a Java `Map` where keys are strings and values are also strings. This conversion allows for easier manipulation, storage, or further processing in the Data Collector application.\n\n2. **Parameters**:\n   - `lastSourceOffset`: A required parameter of type `String`, which is expected to contain JSON-formatted offset data.\n\n3. **Return Type**: The method returns a `Map`. This means it will return a map where each key and value are strings.\n\n4. **Throws**:\n   - `IOException`: In case the JSON string cannot be parsed due to an I/O error (e.g., network issues).\n\n5. **Logic**:\n\n   - The method first checks if `lastSourceOffset` is null or empty (`if (lastSourceOffset == null || lastSourceOffset.isEmpty())`). If true, it initializes a new `HashMap` called `offsetMap`.\n   - Otherwise, the function uses Jackson's JSON mapper (`JSON_MAPPER`) to deserialize the input string into a `Map`. This is done with `JSON_MAPPER.readValue(lastSourceOffset, Map.class)`.\n\n   - The deserialization process converts the JSON string into a Java map, where each key-value pair in the JSON will become an entry in the resulting map.\n\n6. **Security Note**: `@SuppressWarnings(\"unchecked\")` is used to suppress potential warnings about unchecked casts. This is because `JSON_MAPPER.readValue()` returns a `Map`, and there's no need for explicit type casting here, as Java's auto-boxing mechanism handles the conversion from JSON keys/values to `String`.\n\nIn summary, this function serves as an adapter between JSON offset data (in string format) and a standard Java map structure. It ensures that any provided offsets can be easily accessed or manipulated within the Data Collector application.\n\"\"\"\ntruth = \"\"\"\nThe function `deserializeOffsetMap` takes a string as input and returns a map. It first checks if the input string is null or empty. If it is, it creates a new empty map and returns it. Otherwise, it uses the Jackson library to parse the input string into a map and returns it.\n\nThe `@SuppressWarnings(\"unchecked\")` annotation is used to suppress the warning that the type of the parsed map is not checked. This is because the Jackson library is used to parse the input string into a map, but the specific type of the map is not known at compile time. Therefore, the warning is suppressed to avoid potential issues.\n\n\"\"\"\nresult = textdistance.levenshtein.normalized_similarity(expl, truth)\n", "requirements": [], "pdl__timing": {"start_nanos": 1758570534707998000, "end_nanos": 1758570576943508000, "timezone": "EDT"}, "pdl__is_leaf": true}, "pdl__result": 0.1991833030852994, "requirements": [], "pdl__timing": {"start_nanos": 1758570534707861000, "end_nanos": 1758570578269426000, "timezone": "EDT"}, "pdl__is_leaf": true}}, "data": {"pdl__expr": {"input": "${ CODE }", "output": "${ EXPLANATION }", "metric": "${ EVAL }"}, "pdl__result": {"input": {"source_code": "@SuppressWarnings(\"unchecked\")\npublic static Map deserializeOffsetMap(String lastSourceOffset) throws IOException {\n  Map offsetMap;\n  if (lastSourceOffset == null || lastSourceOffset.isEmpty()) {    \n    offsetMap = new HashMap<>();  \n  } else {\n    offsetMap = JSON_MAPPER.readValue(lastSourceOffset, Map.class);  \n  }\n  return offsetMap;\n}\n", "repo_info": {"repo": "streamsets/datacollector", "path": "stagesupport/src/main/java/com/.../OffsetUtil.java", "function_name": "OffsetUtil.deserializeOffsetMap"}}, "output": "The provided Java function `deserializeOffsetMap` is part of the StreamSets Data Collector (DC) codebase in the `stagesupport` package within the `com.../OffsetUtil.java` file. This function is designed to deserialize a JSON string containing offsets into a `Map` object. Here's an explanation of its purpose and functionality:\n\n1. **Purpose**: The primary goal of this method is to convert a JSON-formatted offset string (represented as `lastSourceOffset`) into a Java `Map` where keys are strings and values are also strings. This conversion allows for easier manipulation, storage, or further processing in the Data Collector application.\n\n2. **Parameters**:\n   - `lastSourceOffset`: A required parameter of type `String`, which is expected to contain JSON-formatted offset data.\n\n3. **Return Type**: The method returns a `Map`. This means it will return a map where each key and value are strings.\n\n4. **Throws**:\n   - `IOException`: In case the JSON string cannot be parsed due to an I/O error (e.g., network issues).\n\n5. **Logic**:\n\n   - The method first checks if `lastSourceOffset` is null or empty (`if (lastSourceOffset == null || lastSourceOffset.isEmpty())`). If true, it initializes a new `HashMap` called `offsetMap`.\n   - Otherwise, the function uses Jackson's JSON mapper (`JSON_MAPPER`) to deserialize the input string into a `Map`. This is done with `JSON_MAPPER.readValue(lastSourceOffset, Map.class)`.\n\n   - The deserialization process converts the JSON string into a Java map, where each key-value pair in the JSON will become an entry in the resulting map.\n\n6. **Security Note**: `@SuppressWarnings(\"unchecked\")` is used to suppress potential warnings about unchecked casts. This is because `JSON_MAPPER.readValue()` returns a `Map`, and there's no need for explicit type casting here, as Java's auto-boxing mechanism handles the conversion from JSON keys/values to `String`.\n\nIn summary, this function serves as an adapter between JSON offset data (in string format) and a standard Java map structure. It ensures that any provided offsets can be easily accessed or manipulated within the Data Collector application.", "metric": 0.1991833030852994}}, "pdl__result": {"input": {"source_code": "@SuppressWarnings(\"unchecked\")\npublic static Map deserializeOffsetMap(String lastSourceOffset) throws IOException {\n  Map offsetMap;\n  if (lastSourceOffset == null || lastSourceOffset.isEmpty()) {    \n    offsetMap = new HashMap<>();  \n  } else {\n    offsetMap = JSON_MAPPER.readValue(lastSourceOffset, Map.class);  \n  }\n  return offsetMap;\n}\n", "repo_info": {"repo": "streamsets/datacollector", "path": "stagesupport/src/main/java/com/.../OffsetUtil.java", "function_name": "OffsetUtil.deserializeOffsetMap"}}, "output": "The provided Java function `deserializeOffsetMap` is part of the StreamSets Data Collector (DC) codebase in the `stagesupport` package within the `com.../OffsetUtil.java` file. This function is designed to deserialize a JSON string containing offsets into a `Map` object. Here's an explanation of its purpose and functionality:\n\n1. **Purpose**: The primary goal of this method is to convert a JSON-formatted offset string (represented as `lastSourceOffset`) into a Java `Map` where keys are strings and values are also strings. This conversion allows for easier manipulation, storage, or further processing in the Data Collector application.\n\n2. **Parameters**:\n   - `lastSourceOffset`: A required parameter of type `String`, which is expected to contain JSON-formatted offset data.\n\n3. **Return Type**: The method returns a `Map`. This means it will return a map where each key and value are strings.\n\n4. **Throws**:\n   - `IOException`: In case the JSON string cannot be parsed due to an I/O error (e.g., network issues).\n\n5. **Logic**:\n\n   - The method first checks if `lastSourceOffset` is null or empty (`if (lastSourceOffset == null || lastSourceOffset.isEmpty())`). If true, it initializes a new `HashMap` called `offsetMap`.\n   - Otherwise, the function uses Jackson's JSON mapper (`JSON_MAPPER`) to deserialize the input string into a `Map`. This is done with `JSON_MAPPER.readValue(lastSourceOffset, Map.class)`.\n\n   - The deserialization process converts the JSON string into a Java map, where each key-value pair in the JSON will become an entry in the resulting map.\n\n6. **Security Note**: `@SuppressWarnings(\"unchecked\")` is used to suppress potential warnings about unchecked casts. This is because `JSON_MAPPER.readValue()` returns a `Map`, and there's no need for explicit type casting here, as Java's auto-boxing mechanism handles the conversion from JSON keys/values to `String`.\n\nIn summary, this function serves as an adapter between JSON offset data (in string format) and a standard Java map structure. It ensures that any provided offsets can be easily accessed or manipulated within the Data Collector application.", "metric": 0.1991833030852994}, "requirements": [], "pdl__timing": {"start_nanos": 1758570532101923000, "end_nanos": 1758570578272490000, "timezone": "EDT"}, "pdl__is_leaf": true}
\ No newline at end of file
diff --git a/pdl-live-react/src/demos/demo7.json b/pdl-live-react/src/demos/demo7.json
index 67e72db09..f72431c8a 100644
--- a/pdl-live-react/src/demos/demo7.json
+++ b/pdl-live-react/src/demos/demo7.json
@@ -1 +1 @@
-{"kind": "text", "pdl__id": "text", "description": "Function def and call", "defs": {}, "context": "dependent", "text": [{"kind": "function", "pdl__id": "text.0.function", "defs": {}, "function": {"sentence": "string", "language": "string"}, "return": {"kind": "lastOf", "pdl__id": "text.3.call.lastOf", "defs": {}, "context": "dependent", "lastOf": ["\nTranslate the sentence '${ sentence }' to ${ language }.\n", {"kind": "model", "pdl__id": "text.3.call.lastOf.model", "defs": {}, "platform": "litellm", "model": "ollama_chat/granite3.2:2b", "input": "${ pdl_context }", "parameters": {"temperature": 0.0, "stop": ["\n"]}, "pdl__timing": {"start_nanos": 1750817130552615000, "end_nanos": 1750817132289604000, "timezone": "EDT"}, "pdl__is_leaf": true}], "pdl__timing": {"start_nanos": 1750817130551448000, "end_nanos": 1750817132289671000, "timezone": "EDT"}, "pdl__is_leaf": false}, "def": "translate", "pdl__result": {"kind": "function", "pdl__id": "text.0.function", "defs": {}, "function": {"sentence": "string", "language": "string"}, "return": {"kind": "lastOf", "pdl__id": "text.3.call.lastOf", "defs": {}, "context": "dependent", "lastOf": ["\nTranslate the sentence '${ sentence }' to ${ language }.\n", {"kind": "model", "pdl__id": "text.3.call.lastOf.model", "defs": {}, "platform": "litellm", "model": "ollama_chat/granite3.2:2b", "input": "${ pdl_context }", "parameters": {"temperature": 0.0, "stop": ["\n"]}, "pdl__timing": {"start_nanos": 1750817130552615000, "end_nanos": 1750817132289604000, "timezone": "EDT"}, "pdl__is_leaf": true}], "pdl__timing": {"start_nanos": 1750817130551448000, "end_nanos": 1750817132289671000, "timezone": "EDT"}, "pdl__is_leaf": false}, "def": "translate", "pdl__timing": {"start_nanos": 1750817125300322000, "end_nanos": 1750817125303928000, "timezone": "EDT"}, "pdl__is_leaf": true}, "pdl__timing": {"start_nanos": 1750817125300322000, "end_nanos": 1750817125303928000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "call", "pdl__id": "text.1.call", "defs": {}, "call": "${ translate }", "args": {"pdl__expr": {"sentence": "I love Paris!", "language": "French"}, "pdl__result": {"sentence": "I love Paris!", "language": "French"}}, "pdl__trace": {"kind": "lastOf", "pdl__id": "text.1.call.lastOf", "defs": {}, "context": "dependent", "lastOf": [{"kind": "data", "pdl__id": "text.1.call.lastOf", "defs": {}, "data": {"pdl__expr": "\nTranslate the sentence '${ sentence }' to ${ language }.\n", "pdl__result": "\nTranslate the sentence 'I love Paris!' to French.\n"}, "pdl__result": "\nTranslate the sentence 'I love Paris!' to French.\n", "pdl__timing": {"start_nanos": 1750817125416980000, "end_nanos": 1750817125417962000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "model", "pdl__id": "text.1.call.lastOf.model", "pdl__context": [{"role": "user", "content": "\nTranslate the sentence 'I love Paris!' to French.\n", "pdl__defsite": "text.1.call.lastOf"}], "defs": {}, "platform": "litellm", "model": {"pdl__expr": "ollama_chat/granite3.2:2b", "pdl__result": "ollama_chat/granite3.2:2b"}, "input": {"kind": "data", "pdl__id": "text.1.call.lastOf.model", "defs": {}, "data": {"pdl__expr": "${ pdl_context }", "pdl__result": [{"role": "user", "content": "\nTranslate the sentence 'I love Paris!' to French.\n", "pdl__defsite": "text.1.call.lastOf"}]}, "pdl__result": [{"role": "user", "content": "\nTranslate the sentence 'I love Paris!' to French.\n", "pdl__defsite": "text.1.call.lastOf"}], "pdl__timing": {"start_nanos": 1750817125504641000, "end_nanos": 1750817125505244000, "timezone": "EDT"}, "pdl__is_leaf": true}, "parameters": {"pdl__expr": {"timeout": null, "temperature": 0.0, "top_p": null, "n": null, "stop": ["\n"], "max_tokens": null, "presence_penalty": null, "frequency_penalty": null, "logit_bias": null, "user": null, "response_format": null, "seed": null, "tools": null, "tool_choice": null, "logprobs": null, "top_logprobs": null, "parallel_tool_calls": null, "extra_headers": null, "functions": null, "function_call": null, "base_url": null, "api_version": null, "api_key": null, "model_list": null, "mock_response": null, "custom_llm_provider": null, "max_retries": null}, "pdl__result": {"timeout": null, "temperature": 0.0, "top_p": null, "n": null, "stop": ["\n"], "max_tokens": null, "presence_penalty": null, "frequency_penalty": null, "logit_bias": null, "user": null, "response_format": null, "seed": null, "tools": null, "tool_choice": null, "logprobs": null, "top_logprobs": null, "parallel_tool_calls": null, "extra_headers": null, "functions": null, "function_call": null, "base_url": null, "api_version": null, "api_key": null, "model_list": null, "mock_response": null, "custom_llm_provider": null, "max_retries": null}}, "pdl__usage": {"completion_tokens": 7, "prompt_tokens": 19}, "pdl__model_input": [{"role": "user", "content": "\nTranslate the sentence 'I love Paris!' to French.\n", "pdl__defsite": "text.1.call.lastOf"}], "pdl__result": "'J'aime Paris !'", "pdl__timing": {"start_nanos": 1750817125500740000, "end_nanos": 1750817130547547000, "timezone": "EDT"}, "pdl__is_leaf": true}], "pdl__result": "'J'aime Paris !'", "pdl__timing": {"start_nanos": 1750817125416851000, "end_nanos": 1750817130547629000, "timezone": "EDT"}, "pdl__is_leaf": false}, "pdl__result": "'J'aime Paris !'", "pdl__timing": {"start_nanos": 1750817125304020000, "end_nanos": 1750817130547679000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "data", "pdl__id": "text.2", "defs": {}, "data": {"pdl__expr": "\n", "pdl__result": "\n"}, "pdl__result": "\n", "pdl__timing": {"start_nanos": 1750817130547749000, "end_nanos": 1750817130548335000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "call", "pdl__id": "text.3.call", "defs": {}, "call": "${ translate }", "args": {"pdl__expr": {"sentence": "I love Madrid!", "language": "Spanish"}, "pdl__result": {"sentence": "I love Madrid!", "language": "Spanish"}}, "pdl__trace": {"kind": "lastOf", "pdl__id": "text.3.call.lastOf", "defs": {}, "context": "dependent", "lastOf": [{"kind": "data", "pdl__id": "text.3.call.lastOf", "defs": {}, "data": {"pdl__expr": "\nTranslate the sentence '${ sentence }' to ${ language }.\n", "pdl__result": "\nTranslate the sentence 'I love Madrid!' to Spanish.\n"}, "pdl__result": "\nTranslate the sentence 'I love Madrid!' to Spanish.\n", "pdl__timing": {"start_nanos": 1750817130551559000, "end_nanos": 1750817130552518000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "model", "pdl__id": "text.3.call.lastOf.model", "pdl__context": [{"role": "user", "content": "\nTranslate the sentence 'I love Paris!' to French.\n", "pdl__defsite": "text.1.call.lastOf"}, {"content": "'J'aime Paris !'", "role": "assistant", "pdl__defsite": "text.3.call.lastOf.model"}, {"role": "user", "content": "\n", "pdl__defsite": "text.2"}, {"role": "user", "content": "\nTranslate the sentence 'I love Madrid!' to Spanish.\n", "pdl__defsite": "text.3.call.lastOf"}], "defs": {}, "platform": "litellm", "model": {"pdl__expr": "ollama_chat/granite3.2:2b", "pdl__result": "ollama_chat/granite3.2:2b"}, "input": {"kind": "data", "pdl__id": "text.3.call.lastOf.model", "defs": {}, "data": {"pdl__expr": "${ pdl_context }", "pdl__result": [{"role": "user", "content": "\nTranslate the sentence 'I love Paris!' to French.\n", "pdl__defsite": "text.1.call.lastOf"}, {"content": "'J'aime Paris !'", "role": "assistant", "pdl__defsite": "text.3.call.lastOf.model"}, {"role": "user", "content": "\n", "pdl__defsite": "text.2"}, {"role": "user", "content": "\nTranslate the sentence 'I love Madrid!' to Spanish.\n", "pdl__defsite": "text.3.call.lastOf"}]}, "pdl__result": [{"role": "user", "content": "\nTranslate the sentence 'I love Paris!' to French.\n", "pdl__defsite": "text.1.call.lastOf"}, {"content": "'J'aime Paris !'", "role": "assistant", "pdl__defsite": "text.3.call.lastOf.model"}, {"role": "user", "content": "\n", "pdl__defsite": "text.2"}, {"role": "user", "content": "\nTranslate the sentence 'I love Madrid!' to Spanish.\n", "pdl__defsite": "text.3.call.lastOf"}], "pdl__timing": {"start_nanos": 1750817130554889000, "end_nanos": 1750817130555528000, "timezone": "EDT"}, "pdl__is_leaf": true}, "parameters": {"pdl__expr": {"timeout": null, "temperature": 0.0, "top_p": null, "n": null, "stop": ["\n"], "max_tokens": null, "presence_penalty": null, "frequency_penalty": null, "logit_bias": null, "user": null, "response_format": null, "seed": null, "tools": null, "tool_choice": null, "logprobs": null, "top_logprobs": null, "parallel_tool_calls": null, "extra_headers": null, "functions": null, "function_call": null, "base_url": null, "api_version": null, "api_key": null, "model_list": null, "mock_response": null, "custom_llm_provider": null, "max_retries": null}, "pdl__result": {"timeout": null, "temperature": 0.0, "top_p": null, "n": null, "stop": ["\n"], "max_tokens": null, "presence_penalty": null, "frequency_penalty": null, "logit_bias": null, "user": null, "response_format": null, "seed": null, "tools": null, "tool_choice": null, "logprobs": null, "top_logprobs": null, "parallel_tool_calls": null, "extra_headers": null, "functions": null, "function_call": null, "base_url": null, "api_version": null, "api_key": null, "model_list": null, "mock_response": null, "custom_llm_provider": null, "max_retries": null}}, "pdl__usage": {"completion_tokens": 18, "prompt_tokens": 51}, "pdl__model_input": [{"role": "user", "content": "\nTranslate the sentence 'I love Paris!' to French.\n", "pdl__defsite": "text.1.call.lastOf"}, {"content": "'J'aime Paris !'", "role": "assistant", "pdl__defsite": "text.3.call.lastOf.model"}, {"role": "user", "content": "\n", "pdl__defsite": "text.2"}, {"role": "user", "content": "\nTranslate the sentence 'I love Madrid!' to Spanish.\n", "pdl__defsite": "text.3.call.lastOf"}], "pdl__result": "The translation of \"I love Madrid!\" into Spanish is: \"Me encanta Madrid!\"", "pdl__timing": {"start_nanos": 1750817130552615000, "end_nanos": 1750817132289604000, "timezone": "EDT"}, "pdl__is_leaf": true}], "pdl__result": "The translation of \"I love Madrid!\" into Spanish is: \"Me encanta Madrid!\"", "pdl__timing": {"start_nanos": 1750817130551448000, "end_nanos": 1750817132289671000, "timezone": "EDT"}, "pdl__is_leaf": false}, "pdl__result": "The translation of \"I love Madrid!\" into Spanish is: \"Me encanta Madrid!\"", "pdl__timing": {"start_nanos": 1750817130548486000, "end_nanos": 1750817132289706000, "timezone": "EDT"}, "pdl__is_leaf": true}], "pdl__result": "'J'aime Paris !'\nThe translation of \"I love Madrid!\" into Spanish is: \"Me encanta Madrid!\"", "pdl__timing": {"start_nanos": 1750817125207053000, "end_nanos": 1750817132289764000, "timezone": "EDT"}, "pdl__is_leaf": false}
\ No newline at end of file
+{"kind": "text", "pdl__id": "text", "description": "Function definition and call", "defs": {"translate": {"kind": "function", "pdl__id": "", "defs": {}, "function": {"sentence": "string", "language": "string"}, "return": {"kind": "lastOf", "pdl__id": "text.2.call.lastOf", "defs": {}, "context": "dependent", "lastOf": ["Translate the sentence '${ sentence }' to ${ language }.\nOnly give the result of the translation.\n", {"kind": "model", "pdl__id": "text.2.call.lastOf.1.model", "defs": {}, "platform": "litellm", "model": "ollama_chat/granite3.2:2b", "input": "${ pdl_context }", "requirements": [], "pdl__timing": {"start_nanos": 1758570583304045000, "end_nanos": 1758570585889258000, "timezone": "EDT"}, "pdl__is_leaf": true}], "requirements": [], "pdl__timing": {"start_nanos": 1758570583302822000, "end_nanos": 1758570584409845000, "timezone": "EDT"}, "pdl__is_leaf": false}, "def": "translate", "pdl__result": {"kind": "function", "pdl__id": "", "defs": {}, "function": {"sentence": "string", "language": "string"}, "return": {"kind": "lastOf", "pdl__id": "text.2.call.lastOf", "defs": {}, "context": "dependent", "lastOf": ["Translate the sentence '${ sentence }' to ${ language }.\nOnly give the result of the translation.\n", {"kind": "model", "pdl__id": "text.2.call.lastOf.1.model", "defs": {}, "platform": "litellm", "model": "ollama_chat/granite3.2:2b", "input": "${ pdl_context }", "requirements": [], "pdl__timing": {"start_nanos": 1758570583304045000, "end_nanos": 1758570585889258000, "timezone": "EDT"}, "pdl__is_leaf": true}], "requirements": [], "pdl__timing": {"start_nanos": 1758570583302822000, "end_nanos": 1758570584409845000, "timezone": "EDT"}, "pdl__is_leaf": false}, "def": "translate", "requirements": [], "pdl__is_leaf": true}, "requirements": [], "pdl__is_leaf": true}}, "context": "dependent", "text": [{"kind": "call", "pdl__id": "text.0.call", "defs": {}, "call": "${ translate }", "args": {"pdl__expr": {"sentence": "I love Paris!", "language": "French"}, "pdl__result": {"sentence": "I love Paris!", "language": "French"}}, "pdl__trace": {"kind": "lastOf", "pdl__id": "text.0.call.lastOf", "defs": {}, "context": "dependent", "lastOf": [{"kind": "data", "pdl__id": "text.0.call.lastOf.0", "defs": {}, "data": {"pdl__expr": "Translate the sentence '${ sentence }' to ${ language }.\nOnly give the result of the translation.\n", "pdl__result": "Translate the sentence 'I love Paris!' to French.\nOnly give the result of the translation.\n"}, "pdl__result": "Translate the sentence 'I love Paris!' to French.\nOnly give the result of the translation.\n", "requirements": [], "pdl__timing": {"start_nanos": 1758570580859893000, "end_nanos": 1758570580861206000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "model", "pdl__id": "text.0.call.lastOf.1.model", "pdl__context": [{"role": "user", "content": "Translate the sentence 'I love Paris!' to French.\nOnly give the result of the translation.\n", "pdl__defsite": "text.0.call.lastOf.0"}], "defs": {}, "platform": "litellm", "model": {"pdl__expr": "ollama_chat/granite3.2:2b", "pdl__result": "ollama_chat/granite3.2:2b"}, "input": {"kind": "data", "pdl__id": "text.0.call.lastOf.1.model.input", "defs": {}, "data": {"pdl__expr": "${ pdl_context }", "pdl__result": [{"role": "user", "content": "Translate the sentence 'I love Paris!' to French.\nOnly give the result of the translation.\n", "pdl__defsite": "text.0.call.lastOf.0"}]}, "pdl__result": [{"role": "user", "content": "Translate the sentence 'I love Paris!' to French.\nOnly give the result of the translation.\n", "pdl__defsite": "text.0.call.lastOf.0"}], "requirements": [], "pdl__timing": {"start_nanos": 1758570580909753000, "end_nanos": 1758570580910712000, "timezone": "EDT"}, "pdl__is_leaf": true}, "parameters": {"pdl__expr": null}, "pdl__usage": {"completion_tokens": 8, "prompt_tokens": 65}, "pdl__model_input": [{"role": "user", "content": "Translate the sentence 'I love Paris!' to French.\nOnly give the result of the translation.\n", "pdl__defsite": "text.0.call.lastOf.0"}], "pdl__result": "J'adore Paris !", "requirements": [], "pdl__timing": {"start_nanos": 1758570580909493000, "end_nanos": 1758570584409458000, "timezone": "EDT"}, "pdl__is_leaf": true}], "pdl__result": "J'adore Paris !", "requirements": [], "pdl__timing": {"start_nanos": 1758570580859722000, "end_nanos": 1758570583298713000, "timezone": "EDT"}, "pdl__is_leaf": false}, "pdl__result": "J'adore Paris !", "requirements": [], "pdl__timing": {"start_nanos": 1758570580696048000, "end_nanos": 1758570583298806000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "data", "pdl__id": "text.1", "defs": {}, "data": {"pdl__expr": "\n", "pdl__result": "\n"}, "pdl__result": "\n", "requirements": [], "pdl__timing": {"start_nanos": 1758570583298875000, "end_nanos": 1758570583299507000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "call", "pdl__id": "text.2.call", "defs": {}, "call": "${ translate }", "args": {"pdl__expr": {"sentence": "I love Madrid!", "language": "Spanish"}, "pdl__result": {"sentence": "I love Madrid!", "language": "Spanish"}}, "pdl__trace": {"kind": "lastOf", "pdl__id": "text.2.call.lastOf", "defs": {}, "context": "dependent", "lastOf": [{"kind": "data", "pdl__id": "text.2.call.lastOf.0", "defs": {}, "data": {"pdl__expr": "Translate the sentence '${ sentence }' to ${ language }.\nOnly give the result of the translation.\n", "pdl__result": "Translate the sentence 'I love Madrid!' to Spanish.\nOnly give the result of the translation.\n"}, "pdl__result": "Translate the sentence 'I love Madrid!' to Spanish.\nOnly give the result of the translation.\n", "requirements": [], "pdl__timing": {"start_nanos": 1758570583302939000, "end_nanos": 1758570583303952000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "model", "pdl__id": "text.2.call.lastOf.1.model", "pdl__context": [{"role": "user", "content": "Translate the sentence 'I love Paris!' to French.\nOnly give the result of the translation.\n", "pdl__defsite": "text.0.call.lastOf.0"}, {"content": "J'adore Paris !", "role": "assistant", "pdl__defsite": "text.2.call.lastOf.1.model"}, {"role": "user", "content": "\n", "pdl__defsite": "text.1"}, {"role": "user", "content": "Translate the sentence 'I love Madrid!' to Spanish.\nOnly give the result of the translation.\n", "pdl__defsite": "text.2.call.lastOf.0"}], "defs": {}, "platform": "litellm", "model": {"pdl__expr": "ollama_chat/granite3.2:2b", "pdl__result": "ollama_chat/granite3.2:2b"}, "input": {"kind": "data", "pdl__id": "text.2.call.lastOf.1.model.input", "defs": {}, "data": {"pdl__expr": "${ pdl_context }", "pdl__result": [{"role": "user", "content": "Translate the sentence 'I love Paris!' to French.\nOnly give the result of the translation.\n", "pdl__defsite": "text.0.call.lastOf.0"}, {"content": "J'adore Paris !", "role": "assistant", "pdl__defsite": "text.2.call.lastOf.1.model"}, {"role": "user", "content": "\n", "pdl__defsite": "text.1"}, {"role": "user", "content": "Translate the sentence 'I love Madrid!' to Spanish.\nOnly give the result of the translation.\n", "pdl__defsite": "text.2.call.lastOf.0"}]}, "pdl__result": [{"role": "user", "content": "Translate the sentence 'I love Paris!' to French.\nOnly give the result of the translation.\n", "pdl__defsite": "text.0.call.lastOf.0"}, {"content": "J'adore Paris !", "role": "assistant", "pdl__defsite": "text.2.call.lastOf.1.model"}, {"role": "user", "content": "\n", "pdl__defsite": "text.1"}, {"role": "user", "content": "Translate the sentence 'I love Madrid!' to Spanish.\nOnly give the result of the translation.\n", "pdl__defsite": "text.2.call.lastOf.0"}], "requirements": [], "pdl__timing": {"start_nanos": 1758570583304236000, "end_nanos": 1758570583305481000, "timezone": "EDT"}, "pdl__is_leaf": true}, "parameters": {"pdl__expr": null}, "pdl__usage": {"completion_tokens": 7, "prompt_tokens": 106}, "pdl__model_input": [{"role": "user", "content": "Translate the sentence 'I love Paris!' to French.\nOnly give the result of the translation.\n", "pdl__defsite": "text.0.call.lastOf.0"}, {"content": "J'adore Paris !", "role": "assistant", "pdl__defsite": "text.2.call.lastOf.1.model"}, {"role": "user", "content": "\n", "pdl__defsite": "text.1"}, {"role": "user", "content": "Translate the sentence 'I love Madrid!' to Spanish.\nOnly give the result of the translation.\n", "pdl__defsite": "text.2.call.lastOf.0"}], "pdl__result": "Me encanta Madrid!", "requirements": [], "pdl__timing": {"start_nanos": 1758570583304045000, "end_nanos": 1758570585889258000, "timezone": "EDT"}, "pdl__is_leaf": true}], "pdl__result": "Me encanta Madrid!", "requirements": [], "pdl__timing": {"start_nanos": 1758570583302822000, "end_nanos": 1758570584409845000, "timezone": "EDT"}, "pdl__is_leaf": false}, "pdl__result": "Me encanta Madrid!", "requirements": [], "pdl__timing": {"start_nanos": 1758570583299624000, "end_nanos": 1758570584409917000, "timezone": "EDT"}, "pdl__is_leaf": true}], "pdl__result": "J'adore Paris !\nMe encanta Madrid!", "requirements": [], "pdl__timing": {"start_nanos": 1758570580695570000, "end_nanos": 1758570584410022000, "timezone": "EDT"}, "pdl__is_leaf": false}
\ No newline at end of file
diff --git a/pdl-live-react/src/helpers.ts b/pdl-live-react/src/helpers.ts
index 10edab5df..b63cfa1ef 100644
--- a/pdl-live-react/src/helpers.ts
+++ b/pdl-live-react/src/helpers.ts
@@ -6,7 +6,7 @@ import type {
   TextBlock,
   ArgsBlock,
   CodeBlock,
-  PdlModelInput,
+  ModelInput,
   LocalizedExpression,
 } from "./pdl_ast"
 import { match, P } from "ts-pattern"
@@ -232,10 +232,10 @@ export function hasMessage(block: PdlBlock): block is MessageBearing {
 
 export function hasInput(block: PdlBlock): block is
   | (Omit & {
-      pdl__model_input: NonNullable
+      pdl__model_input: NonNullable
     })
   | (Omit & {
-      pdl__model_input: NonNullable
+      pdl__model_input: NonNullable
     }) {
   const mb = block as ModelBlock
   return Array.isArray(mb.pdl__model_input) && mb.pdl__model_input.length > 0
diff --git a/pdl-live-react/src/pdl_ast.d.ts b/pdl-live-react/src/pdl_ast.d.ts
index f15502b41..41c70d8fd 100644
--- a/pdl-live-react/src/pdl_ast.d.ts
+++ b/pdl-live-react/src/pdl_ast.d.ts
@@ -24,6 +24,7 @@ export type Program =
   | IfBlock
   | MatchBlock
   | RepeatBlock
+  | MapBlock
   | TextBlock
   | LastOfBlock
   | ArrayBlock
@@ -32,14 +33,10 @@ export type Program =
   | ReadBlock
   | IncludeBlock
   | ImportBlock
+  | AggregatorBlock
   | ErrorBlock
   | EmptyBlock
   | null
-/**
- * Documentation associated to the block.
- *
- */
-export type Description = string | null
 export type Enum = unknown[]
 export type PdlTypeType =
   | (
@@ -67,977 +64,597 @@ export type PdlTypeType =
     }
   | null
 export type Type = string | string[]
+export type BlockType =
+  | boolean
+  | number
+  | string
+  | FunctionBlock
+  | CallBlock
+  | LitellmModelBlock
+  | GraniteioModelBlock
+  | CodeBlock
+  | ArgsBlock
+  | GetBlock
+  | DataBlock
+  | IfBlock
+  | MatchBlock
+  | RepeatBlock
+  | MapBlock
+  | TextBlock
+  | LastOfBlock
+  | ArrayBlock
+  | ObjectBlock
+  | MessageBlock
+  | ReadBlock
+  | IncludeBlock
+  | ImportBlock
+  | AggregatorBlock
+  | ErrorBlock
+  | EmptyBlock
+  | null
+export type ContributeElement =
+  | ContributeTarget
+  | string
+  | {
+      [k: string]: ContributeValue
+    }
 /**
- * Documentation associated to the block.
- *
+ * Values allowed in the `contribute` field.
  */
-export type Description1 = string | null
+export type ContributeTarget = "result" | "context" | "stdout" | "stderr"
 /**
- * Documentation associated to the block.
+ * Indicate if the block contributes to the result and background context.
  *
  */
-export type Description2 = string | null
+export type Contribute = ContributeElement[]
+export type ParserType = ("json" | "jsonl" | "yaml") | PdlParser | RegexParser
+export type Regex = string
+export type Mode = "search" | "match" | "fullmatch" | "split" | "findall"
+export type Evaluate = LocalizedExpression | FunctionBlock | string | null
+export type Path = string[]
+export type File = string
+export type Transformcontext =
+  | LocalizedExpression
+  | FunctionBlock
+  | string
+  | null
 /**
- * Documentation associated to the block.
+ * Specify any requirements that the result of the block must satisfy.
  *
  */
-export type Description3 = string | null
+export type RequirementsType = RequirementType[]
+export type ModelInput = {
+  [k: string]: unknown
+}[]
+export type PdlIsLeaf = true
+export type Kind = "call"
 /**
- * Documentation associated to the block.
+ * Function to call.
  *
  */
-export type Description4 = string | null
+export type Call = LocalizedExpression | FunctionBlock | string
 /**
- * Documentation associated to the block.
+ * Indicate if the block contributes to the result and background context.
  *
  */
-export type Description5 = string | null
+export type Contribute1 = ContributeElement[]
 /**
- * Documentation associated to the block.
+ * Specify any requirements that the result of the block must satisfy.
  *
  */
-export type Description6 = string | null
+export type RequirementsType1 = RequirementType[]
+export type PdlIsLeaf1 = true
+export type Kind1 = "model"
 /**
- * Documentation associated to the block.
+ * Indicate if the block contributes to the result and background context.
  *
  */
-export type Description7 = string | null
+export type Contribute2 = ContributeElement[]
 /**
- * Documentation associated to the block.
+ * Specify any requirements that the result of the block must satisfy.
  *
  */
-export type Description8 = string | null
+export type RequirementsType2 = RequirementType[]
+export type PdlIsLeaf2 = true
+export type Kind2 = "model"
 /**
- * Documentation associated to the block.
+ * Indicate if the block contributes to the result and background context.
  *
  */
-export type Description9 = string | null
+export type Contribute3 = ContributeElement[]
 /**
- * Documentation associated to the block.
+ * Specify any requirements that the result of the block must satisfy.
  *
  */
-export type Description10 = string | null
+export type RequirementsType3 = RequirementType[]
+export type PdlIsLeaf3 = true
+export type Kind3 = "code"
 /**
- * Documentation associated to the block.
+ * Programming language of the code.
  *
  */
-export type Description11 = string | null
+export type Lang = "python" | "command" | "jinja" | "pdl" | "ipython"
 /**
- * Documentation associated to the block.
+ * Indicate if the block contributes to the result and background context.
  *
  */
-export type Description12 = string | null
+export type Contribute4 = ContributeElement[]
 /**
- * Documentation associated to the block.
+ * Specify any requirements that the result of the block must satisfy.
  *
  */
-export type Description13 = string | null
+export type RequirementsType4 = RequirementType[]
+export type PdlIsLeaf4 = true
+export type Kind4 = "code"
+export type Lang1 = "command"
+export type ExpressionStr = LocalizedExpression | string
 /**
- * Documentation associated to the block.
+ * The argument vector to spawn.
  *
  */
-export type Description14 = string | null
+export type Args1 = ExpressionStr[]
 /**
- * Documentation associated to the block.
+ * Indicate if the block contributes to the result and background context.
  *
  */
-export type Description15 = string | null
+export type Contribute5 = ContributeElement[]
 /**
- * Documentation associated to the block.
+ * Specify any requirements that the result of the block must satisfy.
  *
  */
-export type Description16 = string | null
+export type RequirementsType5 = RequirementType[]
+export type PdlIsLeaf5 = true
+export type Kind5 = "get"
 /**
- * Documentation associated to the block.
- *
+ * Name of the variable to access.
  */
-export type Description17 = string | null
+export type Get = string
 /**
- * Documentation associated to the block.
+ * Indicate if the block contributes to the result and background context.
  *
  */
-export type Description18 = string | null
+export type Contribute6 = ContributeElement[]
 /**
- * Documentation associated to the block.
+ * Specify any requirements that the result of the block must satisfy.
  *
  */
-export type Description19 = string | null
+export type RequirementsType6 = RequirementType[]
+export type PdlIsLeaf6 = true
+export type Kind6 = "data"
 /**
- * Documentation associated to the block.
- *
+ * Do not evaluate expressions inside strings.
  */
-export type Description20 = string | null
+export type Raw = boolean
 /**
- * Name of the variable used to store the result of the execution of the block.
+ * Indicate if the block contributes to the result and background context.
  *
  */
-export type Def = string | null
+export type Contribute7 = ContributeElement[]
 /**
- * Values allowed in the `contribute` field.
+ * Specify any requirements that the result of the block must satisfy.
+ *
  */
-export type ContributeTarget = "result" | "context"
-export type Value = LocalizedExpression | unknown[] | string
-export type Path = string[]
-export type File = string
+export type RequirementsType7 = RequirementType[]
+export type PdlIsLeaf7 = false
+export type IndependentEnum = "independent" | "dependent"
+export type Kind7 = "if"
 /**
  * Indicate if the block contributes to the result and background context.
  *
  */
-export type Contribute = (
-  | ContributeTarget
-  | {
-      [k: string]: ContributeValue
-    }
-)[]
+export type Contribute8 = ContributeElement[]
 /**
- * Parser to use to construct a value out of a string result.
+ * Specify any requirements that the result of the block must satisfy.
+ *
  */
-export type Parser =
-  | ("json" | "jsonl" | "yaml")
-  | PdlParser
-  | RegexParser
-  | null
-export type Description21 = string | null
-export type Pdl =
+export type RequirementsType8 = RequirementType[]
+export type PdlIsLeaf8 = false
+export type IndependentEnum1 = "independent" | "dependent"
+export type Kind8 = "match"
+export type PatternType =
   | boolean
   | number
   | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
+  | OrPattern
+  | ArrayPattern
+  | ObjectPattern
+  | AnyPattern
   | null
-export type Description22 = string | null
-export type Regex = string
-export type Mode = "search" | "match" | "fullmatch" | "split" | "findall"
+export type Anyof = PatternType[]
+export type Array = PatternType[]
+export type Any = null
+export type ExpressionBool = LocalizedExpression | boolean | string
+export type PdlCaseResult = boolean | null
+export type PdlIfResult = boolean | null
+export type PdlMatched = boolean | null
 /**
- * Block to execute in case of error.
+ * List of cases to match.
  *
  */
-export type Fallback =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
+export type With = MatchCase[]
 /**
- * The maximum number of times to retry when an error occurs within a block.
+ * Indicate if the block contributes to the result and background context.
  *
  */
-export type Retry = number | null
+export type Contribute9 = ContributeElement[]
 /**
- * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+ * Specify any requirements that the result of the block must satisfy.
  *
  */
-export type TraceErrorOnRetry = boolean | string | null
+export type RequirementsType9 = RequirementType[]
+export type PdlIsLeaf9 = false
+export type IndependentEnum2 = "independent" | "dependent"
+export type Kind9 = "repeat"
 /**
- * Role associated to the block and sub-blocks.
- * Typical roles are `system`, `user`, and `assistant`,
- * but there may be other roles such as `available_tools`.
+ * Arrays to iterate over.
+ *
  */
-export type Role = string | null
+export type For = {
+  [k: string]: LocalizedExpression | unknown[] | string
+} | null
 /**
- * Current context
+ * Indicate if the block contributes to the result and background context.
  *
  */
-export type PdlContext =
-  | {
-      [k: string]: unknown
-    }[]
-  | null
+export type Contribute10 = ContributeElement[]
 /**
- * Unique identifier for this block
+ * Specify any requirements that the result of the block must satisfy.
  *
  */
-export type PdlId = string | null
-export type StartNanos = number | null
-export type EndNanos = number | null
-export type FirstUseNanos = number | null
-export type Timezone = string | null
-export type PdlIsLeaf = true
-export type Kind = "empty"
+export type RequirementsType10 = RequirementType[]
+export type PdlIsLeaf10 = false
+export type IndependentEnum3 = "independent" | "dependent"
+export type Kind10 = "map"
 /**
- * Name of the variable used to store the result of the execution of the block.
+ * Arrays to iterate over.
  *
  */
-export type Def1 = string | null
+export type For1 = {
+  [k: string]: LocalizedExpression | unknown[] | string
+} | null
 /**
  * Indicate if the block contributes to the result and background context.
  *
  */
-export type Contribute1 = (
-  | ContributeTarget
-  | {
-      [k: string]: ContributeValue
-    }
-)[]
+export type Contribute11 = ContributeElement[]
 /**
- * Parser to use to construct a value out of a string result.
+ * Specify any requirements that the result of the block must satisfy.
+ *
  */
-export type Parser1 =
-  | ("json" | "jsonl" | "yaml")
-  | PdlParser
-  | RegexParser
-  | null
+export type RequirementsType11 = RequirementType[]
+export type PdlIsLeaf11 = false
+export type IndependentEnum4 = "independent" | "dependent"
+export type Kind11 = "text"
 /**
- * Block to execute in case of error.
+ * Body of the text.
  *
  */
-export type Fallback1 =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
+export type Text = BlockType | BlockType[]
 /**
- * The maximum number of times to retry when an error occurs within a block.
+ * Indicate if the block contributes to the result and background context.
  *
  */
-export type Retry1 = number | null
+export type Contribute12 = ContributeElement[]
 /**
- * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+ * Specify any requirements that the result of the block must satisfy.
  *
  */
-export type TraceErrorOnRetry1 = boolean | string | null
+export type RequirementsType12 = RequirementType[]
+export type PdlIsLeaf12 = false
+export type IndependentEnum5 = "independent" | "dependent"
+export type Kind12 = "lastOf"
 /**
- * Role associated to the block and sub-blocks.
- * Typical roles are `system`, `user`, and `assistant`,
- * but there may be other roles such as `available_tools`.
+ * Sequence of blocks to execute.
  */
-export type Role1 = string | null
+export type Lastof = BlockType[]
 /**
- * Current context
+ * Indicate if the block contributes to the result and background context.
  *
  */
-export type PdlContext1 =
-  | {
-      [k: string]: unknown
-    }[]
-  | null
+export type Contribute13 = ContributeElement[]
 /**
- * Unique identifier for this block
+ * Specify any requirements that the result of the block must satisfy.
  *
  */
-export type PdlId1 = string | null
-export type PdlIsLeaf1 = true
-export type Kind1 = "error"
+export type RequirementsType13 = RequirementType[]
+export type PdlIsLeaf13 = false
+export type IndependentEnum6 = "independent" | "dependent"
+export type Kind13 = "array"
 /**
- * Error message.
+ * Elements of the array.
+ */
+export type Array1 = BlockType[]
+/**
+ * Indicate if the block contributes to the result and background context.
  *
  */
-export type Msg = string
+export type Contribute14 = ContributeElement[]
 /**
- * Block that raised the error.
+ * Specify any requirements that the result of the block must satisfy.
  *
  */
-export type Program1 =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
+export type RequirementsType14 = RequirementType[]
+export type PdlIsLeaf14 = false
+export type IndependentEnum7 = "independent" | "dependent"
+export type Kind14 = "object"
+export type Object2 =
+  | {
+      [k: string]: BlockType
+    }
+  | BlockType[]
+/**
+ * Indicate if the block contributes to the result and background context.
+ *
+ */
+export type Contribute15 = ContributeElement[]
 /**
- * Name of the variable used to store the result of the execution of the block.
+ * Specify any requirements that the result of the block must satisfy.
  *
  */
-export type Def2 = string | null
+export type RequirementsType15 = RequirementType[]
+export type PdlIsLeaf15 = true
+export type Kind15 = "message"
 /**
  * Indicate if the block contributes to the result and background context.
  *
  */
-export type Contribute2 = (
-  | ContributeTarget
-  | {
-      [k: string]: ContributeValue
-    }
-)[]
+export type Contribute16 = ContributeElement[]
 /**
- * Parser to use to construct a value out of a string result.
+ * Specify any requirements that the result of the block must satisfy.
+ *
  */
-export type Parser2 =
-  | ("json" | "jsonl" | "yaml")
-  | PdlParser
-  | RegexParser
-  | null
+export type RequirementsType16 = RequirementType[]
+export type PdlIsLeaf16 = true
+export type Kind16 = "read"
 /**
- * Block to execute in case of error.
+ * Indicate if one or multiple lines should be read.
  *
  */
-export type Fallback2 =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
+export type Multiline = boolean
 /**
- * The maximum number of times to retry when an error occurs within a block.
+ * Indicate if the block contributes to the result and background context.
  *
  */
-export type Retry2 = number | null
+export type Contribute17 = ContributeElement[]
 /**
- * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+ * Specify any requirements that the result of the block must satisfy.
  *
  */
-export type TraceErrorOnRetry2 = boolean | string | null
+export type RequirementsType17 = RequirementType[]
+export type PdlIsLeaf17 = false
+export type IndependentEnum8 = "independent" | "dependent"
+export type Kind17 = "include"
 /**
- * Role associated to the block and sub-blocks.
- * Typical roles are `system`, `user`, and `assistant`,
- * but there may be other roles such as `available_tools`.
+ * Name of the file to include.
+ *
  */
-export type Role2 = string | null
+export type Include = string
 /**
- * Current context
+ * Indicate if the block contributes to the result and background context.
  *
  */
-export type PdlContext2 =
-  | {
-      [k: string]: unknown
-    }[]
-  | null
+export type Contribute18 = ContributeElement[]
 /**
- * Unique identifier for this block
+ * Specify any requirements that the result of the block must satisfy.
  *
  */
-export type PdlId2 = string | null
-export type PdlIsLeaf2 = true
-export type Kind2 = "import"
+export type RequirementsType18 = RequirementType[]
+export type PdlIsLeaf18 = true
+export type Kind18 = "import"
 /**
  * Name of the file to import.
  *
  */
 export type Import = string
-export type PdlTrace =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-/**
- * Name of the variable used to store the result of the execution of the block.
- *
- */
-export type Def3 = string | null
 /**
  * Indicate if the block contributes to the result and background context.
  *
  */
-export type Contribute3 = (
-  | ContributeTarget
-  | {
-      [k: string]: ContributeValue
-    }
-)[]
+export type Contribute19 = ContributeElement[]
 /**
- * Parser to use to construct a value out of a string result.
- */
-export type Parser3 =
-  | ("json" | "jsonl" | "yaml")
-  | PdlParser
-  | RegexParser
-  | null
-/**
- * Block to execute in case of error.
+ * Specify any requirements that the result of the block must satisfy.
  *
  */
-export type Fallback3 =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
+export type RequirementsType19 = RequirementType[]
+export type PdlIsLeaf19 = true
+export type Kind19 = "aggregator"
+export type Aggregator = "context" | FileAggregatorConfig
 /**
- * The maximum number of times to retry when an error occurs within a block.
+ * Documentation associated to the aggregator config.
  *
  */
-export type Retry3 = number | null
+export type Description1 = string | null
 /**
- * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
- *
+ * Name of the file to which contribute.
  */
-export type TraceErrorOnRetry3 = boolean | string | null
+export type File1 = LocalizedExpression | string
 /**
- * Role associated to the block and sub-blocks.
- * Typical roles are `system`, `user`, and `assistant`,
- * but there may be other roles such as `available_tools`.
+ * File opening mode.
  */
-export type Role3 = string | null
+export type Mode1 = LocalizedExpression | string
 /**
- * Current context
- *
+ * File encoding.
  */
-export type PdlContext3 =
-  | {
-      [k: string]: unknown
-    }[]
-  | null
+export type Encoding = LocalizedExpression | string | null
 /**
- * Unique identifier for this block
- *
+ * Prefix to the contributed value.
  */
-export type PdlId3 = string | null
-export type PdlIsLeaf3 = false
-export type IndependentEnum = "independent" | "dependent"
-export type Kind3 = "include"
+export type Prefix = LocalizedExpression | string
 /**
- * Name of the file to include.
- *
+ * Suffix to the contributed value.
  */
-export type Include = string
-export type PdlTrace1 =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
+export type Suffix = LocalizedExpression | string
 /**
- * Name of the variable used to store the result of the execution of the block.
- *
+ * Whether to forcibly flush the stream.
  */
-export type Def4 = string | null
+export type Flush = LocalizedExpression | boolean | string
 /**
  * Indicate if the block contributes to the result and background context.
  *
  */
-export type Contribute4 = (
-  | ContributeTarget
-  | {
-      [k: string]: ContributeValue
-    }
-)[]
+export type Contribute20 = ContributeElement[]
 /**
- * Parser to use to construct a value out of a string result.
+ * Specify any requirements that the result of the block must satisfy.
+ *
  */
-export type Parser4 =
-  | ("json" | "jsonl" | "yaml")
-  | PdlParser
-  | RegexParser
-  | null
+export type RequirementsType20 = RequirementType[]
+export type PdlIsLeaf20 = true
+export type Kind20 = "error"
 /**
- * Block to execute in case of error.
+ * Error message.
  *
  */
-export type Fallback4 =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
+export type Msg = string
 /**
- * The maximum number of times to retry when an error occurs within a block.
+ * Indicate if the block contributes to the result and background context.
  *
  */
-export type Retry4 = number | null
+export type Contribute21 = ContributeElement[]
 /**
- * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+ * Specify any requirements that the result of the block must satisfy.
  *
  */
-export type TraceErrorOnRetry4 = boolean | string | null
+export type RequirementsType21 = RequirementType[]
+export type PdlIsLeaf21 = true
+export type Kind21 = "empty"
+export type ExpressionInt = LocalizedExpression | number | string
 /**
- * Role associated to the block and sub-blocks.
- * Typical roles are `system`, `user`, and `assistant`,
- * but there may be other roles such as `available_tools`.
+ * String concatenation of the result of each iteration.
+ *
  */
-export type Role4 = string | null
+export type As = "text"
 /**
- * Current context
+ * String used to concatenate each iteration of the loop.
  *
  */
-export type PdlContext4 =
-  | {
-      [k: string]: unknown
-    }[]
-  | null
+export type With1 = string
 /**
- * Unique identifier for this block
+ * Return the result of each iteration as an array.
  *
  */
-export type PdlId4 = string | null
-export type PdlIsLeaf4 = true
-export type Kind4 = "read"
+export type As1 = "array"
 /**
- * Name of the file to read. If `None`, read the standard input.
+ * Return the union of the objects created at each iteration.
  *
  */
-export type Read = LocalizedExpression | string | null
+export type As2 = "object"
 /**
- * Message to prompt the user to enter a value.
+ * Return the result of the last iteration.
  *
  */
-export type Message = string | null
+export type As3 = "lastOf"
+export type As4 = "reduce"
 /**
- * Indicate if one or multiple lines should be read.
- *
+ * Function used to combine the results.
  */
-export type Multiline = boolean
+export type Reduce = LocalizedExpression | string
+export type PdlTrace = BlockType[] | null
+export type PdlTrace1 = BlockType[] | null
 /**
- * Name of the variable used to store the result of the execution of the block.
+ * Optional field to ensure that the block is using granite-io.
  *
  */
-export type Def5 = string | null
+export type Platform = "granite-io"
 /**
- * Indicate if the block contributes to the result and background context.
+ * Parameters sent to the model.
  *
  */
-export type Contribute5 = (
-  | ContributeTarget
+export type Parameters =
+  | LocalizedExpression
   | {
-      [k: string]: ContributeValue
+      [k: string]: unknown
     }
-)[]
-/**
- * Parser to use to construct a value out of a string result.
- */
-export type Parser5 =
-  | ("json" | "jsonl" | "yaml")
-  | PdlParser
-  | RegexParser
-  | null
-/**
- * Block to execute in case of error.
- *
- */
-export type Fallback5 =
-  | boolean
-  | number
   | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
   | null
 /**
- * The maximum number of times to retry when an error occurs within a block.
- *
- */
-export type Retry5 = number | null
-/**
- * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+ * Optional field to ensure that the block is using LiteLLM.
  *
  */
-export type TraceErrorOnRetry5 = boolean | string | null
-/**
- * Role associated to the block and sub-blocks.
- * Typical roles are `system`, `user`, and `assistant`,
- * but there may be other roles such as `available_tools`.
- */
-export type Role5 = string | null
+export type Platform1 = "litellm"
 /**
- * Current context
+ * Parameters to send to the model.
  *
  */
-export type PdlContext5 =
+export type Parameters1 =
+  | LitellmParameters
+  | LocalizedExpression
   | {
       [k: string]: unknown
-    }[]
+    }
+  | string
   | null
-/**
- * Unique identifier for this block
- *
- */
-export type PdlId5 = string | null
-export type PdlIsLeaf5 = true
-export type Kind5 = "message"
-/**
- * Content of the message.
- */
-export type Content =
-  | boolean
-  | number
+export type Timeout = number | string | null
+export type Temperature = number | string | null
+export type TopP = number | string | null
+export type N = number | string | null
+export type Stop = string | string[] | null
+export type MaxTokens = number | string | null
+export type PresencePenalty = number | string | null
+export type FrequencyPenalty = number | string | null
+export type LogitBias =
+  | {
+      [k: string]: unknown
+    }
   | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
   | null
-/**
- * For example, the name of the tool that was invoked, for which this message is the tool response.
- */
-export type Name = LocalizedExpression | string | null
-/**
- * The id of the tool invocation for which this message is the tool response.
- */
-export type ToolCallId = LocalizedExpression | string | null
-/**
- * Name of the variable used to store the result of the execution of the block.
- *
- */
-export type Def6 = string | null
-/**
- * Indicate if the block contributes to the result and background context.
- *
- */
-export type Contribute6 = (
-  | ContributeTarget
+export type User = string | null
+export type ResponseFormat =
   | {
-      [k: string]: ContributeValue
+      [k: string]: unknown
     }
-)[]
-/**
- * Parser to use to construct a value out of a string result.
- */
-export type Parser6 =
-  | ("json" | "jsonl" | "yaml")
-  | PdlParser
-  | RegexParser
-  | null
-/**
- * Block to execute in case of error.
- *
- */
-export type Fallback6 =
-  | boolean
-  | number
   | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
   | null
-/**
- * The maximum number of times to retry when an error occurs within a block.
- *
- */
-export type Retry6 = number | null
-/**
- * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
- *
- */
-export type TraceErrorOnRetry6 = boolean | string | null
-/**
- * Role associated to the block and sub-blocks.
- * Typical roles are `system`, `user`, and `assistant`,
- * but there may be other roles such as `available_tools`.
- */
-export type Role6 = string | null
-/**
- * Current context
- *
- */
-export type PdlContext6 =
+export type Seed = number | string | null
+export type Tools = unknown[] | string | null
+export type ToolChoice =
+  | string
   | {
       [k: string]: unknown
-    }[]
+    }
   | null
-/**
- * Unique identifier for this block
- *
- */
-export type PdlId6 = string | null
-export type PdlIsLeaf6 = false
-export type IndependentEnum1 = "independent" | "dependent"
-export type Kind6 = "object"
-export type Object1 =
+export type Logprobs = boolean | string | null
+export type TopLogprobs = number | string | null
+export type ParallelToolCalls = boolean | string | null
+export type ExtraHeaders =
   | {
-      [k: string]:
-        | boolean
-        | number
-        | string
-        | FunctionBlock
-        | CallBlock
-        | LitellmModelBlock
-        | GraniteioModelBlock
-        | CodeBlock
-        | ArgsBlock
-        | GetBlock
-        | DataBlock
-        | IfBlock
-        | MatchBlock
-        | RepeatBlock
-        | TextBlock
-        | LastOfBlock
-        | ArrayBlock
-        | ObjectBlock
-        | MessageBlock
-        | ReadBlock
-        | IncludeBlock
-        | ImportBlock
-        | ErrorBlock
-        | EmptyBlock
-        | null
+      [k: string]: unknown
     }
-  | (
-      | boolean
-      | number
-      | string
-      | FunctionBlock
-      | CallBlock
-      | LitellmModelBlock
-      | GraniteioModelBlock
-      | CodeBlock
-      | ArgsBlock
-      | GetBlock
-      | DataBlock
-      | IfBlock
-      | MatchBlock
-      | RepeatBlock
-      | TextBlock
-      | LastOfBlock
-      | ArrayBlock
-      | ObjectBlock
-      | MessageBlock
-      | ReadBlock
-      | IncludeBlock
-      | ImportBlock
-      | ErrorBlock
-      | EmptyBlock
-      | null
-    )[]
-/**
- * Name of the variable used to store the result of the execution of the block.
+  | string
+  | null
+export type Functions = unknown[] | string | null
+export type FunctionCall = string | null
+export type BaseUrl = string | null
+export type ApiVersion = string | null
+export type ApiKey = string | null
+export type ModelList = unknown[] | string | null
+export type MockResponse = string | null
+export type CustomLlmProvider = string | null
+export type MaxRetries = number | string | null
+/**
+ * Indicate if the block contributes to the result and background context.
  *
  */
-export type Def7 = string | null
+export type Contribute22 = ContributeElement[]
 /**
- * Indicate if the block contributes to the result and background context.
+ * Specify any requirements that the result of the block must satisfy.
  *
  */
-export type Contribute7 = (
-  | ContributeTarget
-  | {
-      [k: string]: ContributeValue
-    }
-)[]
+export type RequirementsType22 = RequirementType[]
+export type PdlIsLeaf22 = true
+export type Kind22 = "function"
 /**
- * Parser to use to construct a value out of a string result.
+ * Functions parameters with their types.
+ *
  */
-export type Parser7 =
-  | ("json" | "jsonl" | "yaml")
-  | PdlParser
-  | RegexParser
-  | null
+export type Function = {
+  [k: string]: PdlTypeType
+} | null
 /**
- * Block to execute in case of error.
+ * Function signature computed from the function definition.
  *
  */
-export type Fallback7 =
+export type Signature = string | null
+export type PdlBlock =
   | boolean
   | number
   | string
@@ -1052,6 +669,7 @@ export type Fallback7 =
   | IfBlock
   | MatchBlock
   | RepeatBlock
+  | MapBlock
   | TextBlock
   | LastOfBlock
   | ArrayBlock
@@ -1060,1844 +678,279 @@ export type Fallback7 =
   | ReadBlock
   | IncludeBlock
   | ImportBlock
+  | AggregatorBlock
   | ErrorBlock
   | EmptyBlock
   | null
+
 /**
- * The maximum number of times to retry when an error occurs within a block.
- *
+ * Function declaration.
+ */
+export interface FunctionBlock {
+  /**
+   * Documentation associated to the block.
+   *
+   */
+  description?: string | null
+  /**
+   * Type specification of the result of the block.
+   *
+   */
+  spec?:
+    | (
+        | "null"
+        | "boolean"
+        | "string"
+        | "number"
+        | "integer"
+        | "array"
+        | "object"
+        | "bool"
+        | "str"
+        | "float"
+        | "int"
+        | "list"
+        | "obj"
+      )
+    | EnumPdlType
+    | PdlTypeType[]
+    | OptionalPdlType
+    | JsonSchemaTypePdlType
+    | ObjectPdlType
+    | {
+        [k: string]: PdlTypeType
+      }
+    | null
+  defs?: Defs
+  /**
+   * Name of the variable used to store the result of the execution of the block.
+   *
+   */
+  def?: string | null
+  contribute?: Contribute22
+  /**
+   * Parser to use to construct a value out of a string result.
+   */
+  parser?: ParserType | null
+  /**
+   * Block to execute in case of error.
+   *
+   */
+  fallback?: BlockType | null
+  /**
+   * The maximum number of times to retry when an error occurs within a block.
+   *
+   */
+  retry?: number | null
+  /**
+   * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+   *
+   */
+  trace_error_on_retry?: boolean | string | null
+  requirements?: RequirementsType22
+  /**
+   * Role associated to the block and sub-blocks.
+   * Typical roles are `system`, `user`, and `assistant`,
+   * but there may be other roles such as `available_tools`.
+   */
+  role?: string | null
+  /**
+   * Current context.
+   */
+  pdl__context?: ModelInput | null
+  /**
+   * Unique identifier for this block.
+   */
+  pdl__id?: string | null
+  pdl__result?: unknown
+  pdl__location?: PdlLocationType | null
+  /**
+   * Execution timing information.
+   */
+  pdl__timing?: PdlTiming | null
+  pdl__is_leaf?: PdlIsLeaf22
+  kind?: Kind22
+  function: Function
+  /**
+   * Body of the function.
+   *
+   */
+  return:
+    | boolean
+    | number
+    | number
+    | string
+    | FunctionBlock
+    | CallBlock
+    | LitellmModelBlock
+    | GraniteioModelBlock
+    | CodeBlock
+    | ArgsBlock
+    | GetBlock
+    | DataBlock
+    | IfBlock
+    | MatchBlock
+    | RepeatBlock
+    | MapBlock
+    | TextBlock
+    | LastOfBlock
+    | ArrayBlock
+    | ObjectBlock
+    | MessageBlock
+    | ReadBlock
+    | IncludeBlock
+    | ImportBlock
+    | AggregatorBlock
+    | ErrorBlock
+    | EmptyBlock
+    | null
+  signature?: Signature
+}
+/**
+ * Json Schema with an `enum` field.
  */
-export type Retry7 = number | null
+export interface EnumPdlType {
+  enum: Enum
+  [k: string]: unknown
+}
 /**
- * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
- *
+ * Optional type.
  */
-export type TraceErrorOnRetry7 = boolean | string | null
+export interface OptionalPdlType {
+  optional: PdlTypeType
+}
 /**
- * Role associated to the block and sub-blocks.
- * Typical roles are `system`, `user`, and `assistant`,
- * but there may be other roles such as `available_tools`.
+ * Json Schema with a type field.
  */
-export type Role7 = string | null
+export interface JsonSchemaTypePdlType {
+  type: Type
+  [k: string]: unknown
+}
 /**
- * Current context
- *
+ * Object type.
  */
-export type PdlContext7 =
-  | {
-      [k: string]: unknown
-    }[]
-  | null
+export interface ObjectPdlType {
+  object: Object
+}
+export interface Object {
+  [k: string]: PdlTypeType
+}
 /**
- * Unique identifier for this block
+ * Set of definitions executed before the execution of the block.
  *
  */
-export type PdlId7 = string | null
-export type PdlIsLeaf7 = false
-export type IndependentEnum2 = "independent" | "dependent"
-export type Kind7 = "array"
+export interface Defs {
+  [k: string]: BlockType
+}
 /**
- * Elements of the array.
+ * Calling a function.
  */
-export type Array = (
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-)[]
-/**
- * Name of the variable used to store the result of the execution of the block.
- *
- */
-export type Def8 = string | null
-/**
- * Indicate if the block contributes to the result and background context.
- *
- */
-export type Contribute8 = (
-  | ContributeTarget
-  | {
-      [k: string]: ContributeValue
-    }
-)[]
-/**
- * Parser to use to construct a value out of a string result.
- */
-export type Parser8 =
-  | ("json" | "jsonl" | "yaml")
-  | PdlParser
-  | RegexParser
-  | null
-/**
- * Block to execute in case of error.
- *
- */
-export type Fallback8 =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-/**
- * The maximum number of times to retry when an error occurs within a block.
- *
- */
-export type Retry8 = number | null
-/**
- * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
- *
- */
-export type TraceErrorOnRetry8 = boolean | string | null
-/**
- * Role associated to the block and sub-blocks.
- * Typical roles are `system`, `user`, and `assistant`,
- * but there may be other roles such as `available_tools`.
- */
-export type Role8 = string | null
-/**
- * Current context
- *
- */
-export type PdlContext8 =
-  | {
-      [k: string]: unknown
-    }[]
-  | null
-/**
- * Unique identifier for this block
- *
- */
-export type PdlId8 = string | null
-export type PdlIsLeaf8 = false
-export type IndependentEnum3 = "independent" | "dependent"
-export type Kind8 = "lastOf"
-/**
- * Sequence of blocks to execute.
- */
-export type Lastof = (
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-)[]
-/**
- * Name of the variable used to store the result of the execution of the block.
- *
- */
-export type Def9 = string | null
-/**
- * Indicate if the block contributes to the result and background context.
- *
- */
-export type Contribute9 = (
-  | ContributeTarget
-  | {
-      [k: string]: ContributeValue
-    }
-)[]
-/**
- * Parser to use to construct a value out of a string result.
- */
-export type Parser9 =
-  | ("json" | "jsonl" | "yaml")
-  | PdlParser
-  | RegexParser
-  | null
-/**
- * Block to execute in case of error.
- *
- */
-export type Fallback9 =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-/**
- * The maximum number of times to retry when an error occurs within a block.
- *
- */
-export type Retry9 = number | null
-/**
- * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
- *
- */
-export type TraceErrorOnRetry9 = boolean | string | null
-/**
- * Role associated to the block and sub-blocks.
- * Typical roles are `system`, `user`, and `assistant`,
- * but there may be other roles such as `available_tools`.
- */
-export type Role9 = string | null
-/**
- * Current context
- *
- */
-export type PdlContext9 =
-  | {
-      [k: string]: unknown
-    }[]
-  | null
-/**
- * Unique identifier for this block
- *
- */
-export type PdlId9 = string | null
-export type PdlIsLeaf9 = false
-export type IndependentEnum4 = "independent" | "dependent"
-export type Kind9 = "text"
-/**
- * Body of the text.
- *
- */
-export type Text =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | (
-      | boolean
-      | number
-      | string
-      | FunctionBlock
-      | CallBlock
-      | LitellmModelBlock
-      | GraniteioModelBlock
-      | CodeBlock
-      | ArgsBlock
-      | GetBlock
-      | DataBlock
-      | IfBlock
-      | MatchBlock
-      | RepeatBlock
-      | TextBlock
-      | LastOfBlock
-      | ArrayBlock
-      | ObjectBlock
-      | MessageBlock
-      | ReadBlock
-      | IncludeBlock
-      | ImportBlock
-      | ErrorBlock
-      | EmptyBlock
-      | null
-    )[]
-  | null
-/**
- * Name of the variable used to store the result of the execution of the block.
- *
- */
-export type Def10 = string | null
-/**
- * Indicate if the block contributes to the result and background context.
- *
- */
-export type Contribute10 = (
-  | ContributeTarget
-  | {
-      [k: string]: ContributeValue
-    }
-)[]
-/**
- * Parser to use to construct a value out of a string result.
- */
-export type Parser10 =
-  | ("json" | "jsonl" | "yaml")
-  | PdlParser
-  | RegexParser
-  | null
-/**
- * Block to execute in case of error.
- *
- */
-export type Fallback10 =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-/**
- * The maximum number of times to retry when an error occurs within a block.
- *
- */
-export type Retry10 = number | null
-/**
- * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
- *
- */
-export type TraceErrorOnRetry10 = boolean | string | null
-/**
- * Role associated to the block and sub-blocks.
- * Typical roles are `system`, `user`, and `assistant`,
- * but there may be other roles such as `available_tools`.
- */
-export type Role10 = string | null
-/**
- * Current context
- *
- */
-export type PdlContext10 =
-  | {
-      [k: string]: unknown
-    }[]
-  | null
-/**
- * Unique identifier for this block
- *
- */
-export type PdlId10 = string | null
-export type PdlIsLeaf10 = false
-export type IndependentEnum5 = "independent" | "dependent"
-export type Kind10 = "repeat"
-/**
- * Arrays to iterate over.
- *
- */
-export type For = {
-  [k: string]: LocalizedExpression | unknown[] | string
-} | null
-/**
- * Name of the variable containing the loop iteration.
- *
- */
-export type Index = string | null
-/**
- * Condition to stay at the beginning of the loop.
- *
- */
-export type While = LocalizedExpression | boolean | string
-/**
- * Body of the loop.
- *
- */
-export type Repeat =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-/**
- * Condition to exit at the end of the loop.
- *
- */
-export type Until = LocalizedExpression | boolean | string
-/**
- * Maximal number of iterations to perform.
- *
- */
-export type Maxiterations = LocalizedExpression | number | string | null
-/**
- * Define how to combine the result of each iteration.
- *
- */
-export type Join = JoinText | JoinArray | JoinObject | JoinLastOf
-/**
- * String concatenation of the result of each iteration.
- *
- */
-export type As = "text"
-/**
- * String used to concatenate each iteration of the loop.
- *
- */
-export type With = string
-/**
- * Return the result of each iteration as an array.
- *
- */
-export type As1 = "array"
-/**
- * Return the union of the objects created at each iteration.
- *
- */
-export type As2 = "object"
-/**
- * Return the result of the last iteration.
- *
- */
-export type As3 = "lastOf"
-export type PdlTrace2 =
-  | (
-      | boolean
-      | number
-      | string
-      | FunctionBlock
-      | CallBlock
-      | LitellmModelBlock
-      | GraniteioModelBlock
-      | CodeBlock
-      | ArgsBlock
-      | GetBlock
-      | DataBlock
-      | IfBlock
-      | MatchBlock
-      | RepeatBlock
-      | TextBlock
-      | LastOfBlock
-      | ArrayBlock
-      | ObjectBlock
-      | MessageBlock
-      | ReadBlock
-      | IncludeBlock
-      | ImportBlock
-      | ErrorBlock
-      | EmptyBlock
-      | null
-    )[]
-  | null
-/**
- * Name of the variable used to store the result of the execution of the block.
- *
- */
-export type Def11 = string | null
-/**
- * Indicate if the block contributes to the result and background context.
- *
- */
-export type Contribute11 = (
-  | ContributeTarget
-  | {
-      [k: string]: ContributeValue
-    }
-)[]
-/**
- * Parser to use to construct a value out of a string result.
- */
-export type Parser11 =
-  | ("json" | "jsonl" | "yaml")
-  | PdlParser
-  | RegexParser
-  | null
-/**
- * Block to execute in case of error.
- *
- */
-export type Fallback11 =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-/**
- * The maximum number of times to retry when an error occurs within a block.
- *
- */
-export type Retry11 = number | null
-/**
- * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
- *
- */
-export type TraceErrorOnRetry11 = boolean | string | null
-/**
- * Role associated to the block and sub-blocks.
- * Typical roles are `system`, `user`, and `assistant`,
- * but there may be other roles such as `available_tools`.
- */
-export type Role11 = string | null
-/**
- * Current context
- *
- */
-export type PdlContext11 =
-  | {
-      [k: string]: unknown
-    }[]
-  | null
-/**
- * Unique identifier for this block
- *
- */
-export type PdlId11 = string | null
-export type PdlIsLeaf11 = false
-export type IndependentEnum6 = "independent" | "dependent"
-export type Kind11 = "match"
-export type Case =
-  | boolean
-  | number
-  | string
-  | OrPattern
-  | ArrayPattern
-  | ObjectPattern
-  | AnyPattern
-  | null
-export type Def12 = string | null
-export type Def13 = string | null
-export type Def14 = string | null
-export type Def15 = string | null
-export type Any = null
-export type Array1 = (
-  | boolean
-  | number
-  | string
-  | OrPattern
-  | ArrayPattern
-  | ObjectPattern
-  | AnyPattern
-  | null
-)[]
-export type Anyof = (
-  | boolean
-  | number
-  | string
-  | OrPattern
-  | ArrayPattern
-  | ObjectPattern
-  | AnyPattern
-  | null
-)[]
-export type If = LocalizedExpression | boolean | string | null
-export type Then =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-export type PdlCaseResult = boolean | null
-export type PdlIfResult = boolean | null
-export type PdlMatched = boolean | null
-/**
- * List of cases to match.
- *
- */
-export type With1 = MatchCase[]
-/**
- * Name of the variable used to store the result of the execution of the block.
- *
- */
-export type Def16 = string | null
-/**
- * Indicate if the block contributes to the result and background context.
- *
- */
-export type Contribute12 = (
-  | ContributeTarget
-  | {
-      [k: string]: ContributeValue
-    }
-)[]
-/**
- * Parser to use to construct a value out of a string result.
- */
-export type Parser12 =
-  | ("json" | "jsonl" | "yaml")
-  | PdlParser
-  | RegexParser
-  | null
-/**
- * Block to execute in case of error.
- *
- */
-export type Fallback12 =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-/**
- * The maximum number of times to retry when an error occurs within a block.
- *
- */
-export type Retry12 = number | null
-/**
- * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
- *
- */
-export type TraceErrorOnRetry12 = boolean | string | null
-/**
- * Role associated to the block and sub-blocks.
- * Typical roles are `system`, `user`, and `assistant`,
- * but there may be other roles such as `available_tools`.
- */
-export type Role12 = string | null
-/**
- * Current context
- *
- */
-export type PdlContext12 =
-  | {
-      [k: string]: unknown
-    }[]
-  | null
-/**
- * Unique identifier for this block
- *
- */
-export type PdlId12 = string | null
-export type PdlIsLeaf12 = false
-export type IndependentEnum7 = "independent" | "dependent"
-export type Kind12 = "if"
-/**
- * Condition.
- *
- */
-export type If1 = LocalizedExpression | boolean | string
-/**
- * Branch to execute if the condition is true.
- *
- */
-export type Then1 =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-/**
- * Branch to execute if the condition is false.
- *
- */
-export type Else =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-/**
- * Name of the variable used to store the result of the execution of the block.
- *
- */
-export type Def17 = string | null
-/**
- * Indicate if the block contributes to the result and background context.
- *
- */
-export type Contribute13 = (
-  | ContributeTarget
-  | {
-      [k: string]: ContributeValue
-    }
-)[]
-/**
- * Parser to use to construct a value out of a string result.
- */
-export type Parser13 =
-  | ("json" | "jsonl" | "yaml")
-  | PdlParser
-  | RegexParser
-  | null
-/**
- * Block to execute in case of error.
- *
- */
-export type Fallback13 =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-/**
- * The maximum number of times to retry when an error occurs within a block.
- *
- */
-export type Retry13 = number | null
-/**
- * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
- *
- */
-export type TraceErrorOnRetry13 = boolean | string | null
-/**
- * Role associated to the block and sub-blocks.
- * Typical roles are `system`, `user`, and `assistant`,
- * but there may be other roles such as `available_tools`.
- */
-export type Role13 = string | null
-/**
- * Current context
- *
- */
-export type PdlContext13 =
-  | {
-      [k: string]: unknown
-    }[]
-  | null
-/**
- * Unique identifier for this block
- *
- */
-export type PdlId13 = string | null
-export type PdlIsLeaf13 = true
-export type Kind13 = "data"
-/**
- * Do not evaluate expressions inside strings.
- */
-export type Raw = boolean
-/**
- * Name of the variable used to store the result of the execution of the block.
- *
- */
-export type Def18 = string | null
-/**
- * Indicate if the block contributes to the result and background context.
- *
- */
-export type Contribute14 = (
-  | ContributeTarget
-  | {
-      [k: string]: ContributeValue
-    }
-)[]
-/**
- * Parser to use to construct a value out of a string result.
- */
-export type Parser14 =
-  | ("json" | "jsonl" | "yaml")
-  | PdlParser
-  | RegexParser
-  | null
-/**
- * Block to execute in case of error.
- *
- */
-export type Fallback14 =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-/**
- * The maximum number of times to retry when an error occurs within a block.
- *
- */
-export type Retry14 = number | null
-/**
- * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
- *
- */
-export type TraceErrorOnRetry14 = boolean | string | null
-/**
- * Role associated to the block and sub-blocks.
- * Typical roles are `system`, `user`, and `assistant`,
- * but there may be other roles such as `available_tools`.
- */
-export type Role14 = string | null
-/**
- * Current context
- *
- */
-export type PdlContext14 =
-  | {
-      [k: string]: unknown
-    }[]
-  | null
-/**
- * Unique identifier for this block
- *
- */
-export type PdlId14 = string | null
-export type PdlIsLeaf14 = true
-export type Kind14 = "get"
-/**
- * Name of the variable to access.
- */
-export type Get = string
-/**
- * Name of the variable used to store the result of the execution of the block.
- *
- */
-export type Def19 = string | null
-/**
- * Indicate if the block contributes to the result and background context.
- *
- */
-export type Contribute15 = (
-  | ContributeTarget
-  | {
-      [k: string]: ContributeValue
-    }
-)[]
-/**
- * Parser to use to construct a value out of a string result.
- */
-export type Parser15 =
-  | ("json" | "jsonl" | "yaml")
-  | PdlParser
-  | RegexParser
-  | null
-/**
- * Block to execute in case of error.
- *
- */
-export type Fallback15 =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-/**
- * The maximum number of times to retry when an error occurs within a block.
- *
- */
-export type Retry15 = number | null
-/**
- * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
- *
- */
-export type TraceErrorOnRetry15 = boolean | string | null
-/**
- * Role associated to the block and sub-blocks.
- * Typical roles are `system`, `user`, and `assistant`,
- * but there may be other roles such as `available_tools`.
- */
-export type Role15 = string | null
-/**
- * Current context
- *
- */
-export type PdlContext15 =
-  | {
-      [k: string]: unknown
-    }[]
-  | null
-/**
- * Unique identifier for this block
- *
- */
-export type PdlId15 = string | null
-export type PdlIsLeaf15 = true
-export type Kind15 = "code"
-export type Lang = "command"
-/**
- * The argument vector to spawn.
- *
- */
-export type Args = (LocalizedExpression | string)[]
-/**
- * Name of the variable used to store the result of the execution of the block.
- *
- */
-export type Def20 = string | null
-/**
- * Indicate if the block contributes to the result and background context.
- *
- */
-export type Contribute16 = (
-  | ContributeTarget
-  | {
-      [k: string]: ContributeValue
-    }
-)[]
-/**
- * Parser to use to construct a value out of a string result.
- */
-export type Parser16 =
-  | ("json" | "jsonl" | "yaml")
-  | PdlParser
-  | RegexParser
-  | null
-/**
- * Block to execute in case of error.
- *
- */
-export type Fallback16 =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-/**
- * The maximum number of times to retry when an error occurs within a block.
- *
- */
-export type Retry16 = number | null
-/**
- * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
- *
- */
-export type TraceErrorOnRetry16 = boolean | string | null
-/**
- * Role associated to the block and sub-blocks.
- * Typical roles are `system`, `user`, and `assistant`,
- * but there may be other roles such as `available_tools`.
- */
-export type Role16 = string | null
-/**
- * Current context
- *
- */
-export type PdlContext16 =
-  | {
-      [k: string]: unknown
-    }[]
-  | null
-/**
- * Unique identifier for this block
- *
- */
-export type PdlId16 = string | null
-export type PdlIsLeaf16 = true
-export type Kind16 = "code"
-/**
- * Programming language of the code.
- *
- */
-export type Lang1 = "python" | "command" | "jinja" | "pdl" | "ipython"
-/**
- * Code to execute.
- *
- */
-export type Code =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-/**
- * Name of the variable used to store the result of the execution of the block.
- *
- */
-export type Def21 = string | null
-/**
- * Indicate if the block contributes to the result and background context.
- *
- */
-export type Contribute17 = (
-  | ContributeTarget
-  | {
-      [k: string]: ContributeValue
-    }
-)[]
-/**
- * Parser to use to construct a value out of a string result.
- */
-export type Parser17 =
-  | ("json" | "jsonl" | "yaml")
-  | PdlParser
-  | RegexParser
-  | null
-/**
- * Block to execute in case of error.
- *
- */
-export type Fallback17 =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-/**
- * The maximum number of times to retry when an error occurs within a block.
- *
- */
-export type Retry17 = number | null
-/**
- * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
- *
- */
-export type TraceErrorOnRetry17 = boolean | string | null
-/**
- * Role associated to the block and sub-blocks.
- * Typical roles are `system`, `user`, and `assistant`,
- * but there may be other roles such as `available_tools`.
- */
-export type Role17 = string | null
-/**
- * Current context
- *
- */
-export type PdlContext17 =
-  | {
-      [k: string]: unknown
-    }[]
-  | null
-/**
- * Unique identifier for this block
- *
- */
-export type PdlId17 = string | null
-export type PdlIsLeaf17 = true
-export type Kind17 = "model"
-/**
- * Messages to send to the model.
- *
- */
-export type Input =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-/**
- * Variable where to store the raw response of the model.
- *
- */
-export type Modelresponse = string | null
-export type CompletionTokens = number | null
-export type PromptTokens = number | null
-export type PdlModelInput =
-  | {
-      [k: string]: unknown
-    }[]
-  | null
-/**
- * Optional field to ensure that the block is using granite-io.
- *
- */
-export type Platform = "granite-io"
-/**
- * Parameters sent to the model.
- *
- */
-export type Parameters =
-  | LocalizedExpression
-  | {
-      [k: string]: unknown
-    }
-  | string
-  | null
-/**
- * Name of the variable used to store the result of the execution of the block.
- *
- */
-export type Def22 = string | null
-/**
- * Indicate if the block contributes to the result and background context.
- *
- */
-export type Contribute18 = (
-  | ContributeTarget
-  | {
-      [k: string]: ContributeValue
-    }
-)[]
-/**
- * Parser to use to construct a value out of a string result.
- */
-export type Parser18 =
-  | ("json" | "jsonl" | "yaml")
-  | PdlParser
-  | RegexParser
-  | null
-/**
- * Block to execute in case of error.
- *
- */
-export type Fallback18 =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-/**
- * The maximum number of times to retry when an error occurs within a block.
- *
- */
-export type Retry18 = number | null
-/**
- * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
- *
- */
-export type TraceErrorOnRetry18 = boolean | string | null
-/**
- * Role associated to the block and sub-blocks.
- * Typical roles are `system`, `user`, and `assistant`,
- * but there may be other roles such as `available_tools`.
- */
-export type Role18 = string | null
-/**
- * Current context
- *
- */
-export type PdlContext18 =
-  | {
-      [k: string]: unknown
-    }[]
-  | null
-/**
- * Unique identifier for this block
- *
- */
-export type PdlId18 = string | null
-export type PdlIsLeaf18 = true
-export type Kind18 = "model"
-/**
- * Messages to send to the model.
- *
- */
-export type Input1 =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-/**
- * Variable where to store the raw response of the model.
- *
- */
-export type Modelresponse1 = string | null
-export type PdlModelInput1 =
-  | {
-      [k: string]: unknown
-    }[]
-  | null
-/**
- * Optional field to ensure that the block is using LiteLLM.
- *
- */
-export type Platform1 = "litellm"
-/**
- * Name of the model following the LiteLLM convention.
- *
- */
-export type Model1 = LocalizedExpression | string
-/**
- * Parameters to send to the model.
- *
- */
-export type Parameters1 =
-  | LitellmParameters
-  | LocalizedExpression
-  | {
-      [k: string]: unknown
-    }
-  | string
-  | null
-export type Timeout = number | string | null
-export type Temperature = number | string | null
-export type TopP = number | string | null
-export type N = number | string | null
-export type Stop = string | string[] | null
-export type MaxTokens = number | string | null
-export type PresencePenalty = number | string | null
-export type FrequencyPenalty = number | string | null
-export type LogitBias =
-  | {
-      [k: string]: unknown
-    }
-  | string
-  | null
-export type User = string | null
-export type ResponseFormat =
-  | {
-      [k: string]: unknown
-    }
-  | string
-  | null
-export type Seed = number | string | null
-export type Tools = unknown[] | string | null
-export type ToolChoice =
-  | string
-  | {
-      [k: string]: unknown
-    }
-  | null
-export type Logprobs = boolean | string | null
-export type TopLogprobs = number | string | null
-export type ParallelToolCalls = boolean | string | null
-export type ExtraHeaders =
-  | {
-      [k: string]: unknown
-    }
-  | string
-  | null
-export type Functions = unknown[] | string | null
-export type FunctionCall = string | null
-export type BaseUrl = string | null
-export type ApiVersion = string | null
-export type ApiKey = string | null
-export type ModelList = unknown[] | string | null
-export type MockResponse = string | null
-export type CustomLlmProvider = string | null
-export type MaxRetries = number | string | null
-/**
- * Name of the variable used to store the result of the execution of the block.
- *
- */
-export type Def23 = string | null
-/**
- * Indicate if the block contributes to the result and background context.
- *
- */
-export type Contribute19 = (
-  | ContributeTarget
-  | {
-      [k: string]: ContributeValue
-    }
-)[]
-/**
- * Parser to use to construct a value out of a string result.
- */
-export type Parser19 =
-  | ("json" | "jsonl" | "yaml")
-  | PdlParser
-  | RegexParser
-  | null
-/**
- * Block to execute in case of error.
- *
- */
-export type Fallback19 =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-/**
- * The maximum number of times to retry when an error occurs within a block.
- *
- */
-export type Retry19 = number | null
-/**
- * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
- *
- */
-export type TraceErrorOnRetry19 = boolean | string | null
-/**
- * Role associated to the block and sub-blocks.
- * Typical roles are `system`, `user`, and `assistant`,
- * but there may be other roles such as `available_tools`.
- */
-export type Role19 = string | null
-/**
- * Current context
- *
- */
-export type PdlContext19 =
-  | {
-      [k: string]: unknown
-    }[]
-  | null
-/**
- * Unique identifier for this block
- *
- */
-export type PdlId19 = string | null
-export type PdlIsLeaf19 = true
-export type Kind19 = "call"
-/**
- * Function to call.
- *
- */
-export type Call = LocalizedExpression | FunctionBlock | string
-export type PdlTrace3 =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-/**
- * Name of the variable used to store the result of the execution of the block.
- *
- */
-export type Def24 = string | null
-/**
- * Indicate if the block contributes to the result and background context.
- *
- */
-export type Contribute20 = (
-  | ContributeTarget
-  | {
-      [k: string]: ContributeValue
-    }
-)[]
-/**
- * Parser to use to construct a value out of a string result.
- */
-export type Parser20 =
-  | ("json" | "jsonl" | "yaml")
-  | PdlParser
-  | RegexParser
-  | null
-/**
- * Block to execute in case of error.
- *
- */
-export type Fallback20 =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-/**
- * The maximum number of times to retry when an error occurs within a block.
- *
- */
-export type Retry20 = number | null
-/**
- * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
- *
- */
-export type TraceErrorOnRetry20 = boolean | string | null
-/**
- * Role associated to the block and sub-blocks.
- * Typical roles are `system`, `user`, and `assistant`,
- * but there may be other roles such as `available_tools`.
- */
-export type Role20 = string | null
-/**
- * Current context
- *
- */
-export type PdlContext20 =
-  | {
-      [k: string]: unknown
-    }[]
-  | null
-/**
- * Unique identifier for this block
- *
- */
-export type PdlId20 = string | null
-export type PdlIsLeaf20 = true
-export type Kind20 = "function"
-/**
- * Functions parameters with their types.
- *
- */
-export type Function = {
-  [k: string]: PdlTypeType
-} | null
-/**
- * Body of the function.
- *
- */
-export type Return =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
+export interface CallBlock {
+  /**
+   * Documentation associated to the block.
+   *
+   */
+  description?: string | null
+  /**
+   * Type specification of the result of the block.
+   *
+   */
+  spec?:
+    | (
+        | "null"
+        | "boolean"
+        | "string"
+        | "number"
+        | "integer"
+        | "array"
+        | "object"
+        | "bool"
+        | "str"
+        | "float"
+        | "int"
+        | "list"
+        | "obj"
+      )
+    | EnumPdlType
+    | PdlTypeType[]
+    | OptionalPdlType
+    | JsonSchemaTypePdlType
+    | ObjectPdlType
+    | {
+        [k: string]: PdlTypeType
+      }
+    | null
+  defs?: Defs1
+  /**
+   * Name of the variable used to store the result of the execution of the block.
+   *
+   */
+  def?: string | null
+  contribute?: Contribute
+  /**
+   * Parser to use to construct a value out of a string result.
+   */
+  parser?: ParserType | null
+  /**
+   * Block to execute in case of error.
+   *
+   */
+  fallback?: BlockType | null
+  /**
+   * The maximum number of times to retry when an error occurs within a block.
+   *
+   */
+  retry?: number | null
+  /**
+   * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+   *
+   */
+  trace_error_on_retry?: boolean | string | null
+  requirements?: RequirementsType
+  /**
+   * Role associated to the block and sub-blocks.
+   * Typical roles are `system`, `user`, and `assistant`,
+   * but there may be other roles such as `available_tools`.
+   */
+  role?: string | null
+  /**
+   * Current context.
+   */
+  pdl__context?: ModelInput | null
+  /**
+   * Unique identifier for this block.
+   */
+  pdl__id?: string | null
+  pdl__result?: unknown
+  pdl__location?: PdlLocationType | null
+  /**
+   * Execution timing information.
+   */
+  pdl__timing?: PdlTiming | null
+  pdl__is_leaf?: PdlIsLeaf
+  kind?: Kind
+  call: Call
+  args?: unknown
+  pdl__trace?: BlockType | null
+}
 /**
- * Function signature computed from the function definition.
+ * Set of definitions executed before the execution of the block.
  *
- */
-export type Signature = string | null
-export type PdlBlock =
-  | boolean
-  | number
-  | string
-  | FunctionBlock
-  | CallBlock
-  | LitellmModelBlock
-  | GraniteioModelBlock
-  | CodeBlock
-  | ArgsBlock
-  | GetBlock
-  | DataBlock
-  | IfBlock
-  | MatchBlock
-  | RepeatBlock
-  | TextBlock
-  | LastOfBlock
-  | ArrayBlock
-  | ObjectBlock
-  | MessageBlock
-  | ReadBlock
-  | IncludeBlock
-  | ImportBlock
-  | ErrorBlock
-  | EmptyBlock
-  | null
-
+ */
+export interface Defs1 {
+  [k: string]: BlockType
+}
 /**
- * Function declaration.
+ * Contribution of a specific value instead of the default one.
  */
-export interface FunctionBlock {
-  description?: Description
-  /**
-   * Type specification of the result of the block.
-   *
-   */
+export interface ContributeValue {
+  value: unknown
+}
+/**
+ * Use a PDL program as a parser specification (experimental).
+ */
+export interface PdlParser {
+  description?: string | null
   spec?:
     | (
         | "null"
@@ -2923,95 +976,13 @@ export interface FunctionBlock {
         [k: string]: PdlTypeType
       }
     | null
-  defs?: Defs
-  def?: Def24
-  contribute?: Contribute20
-  parser?: Parser20
-  fallback?: Fallback20
-  retry?: Retry20
-  trace_error_on_retry?: TraceErrorOnRetry20
-  role?: Role20
-  pdl__context?: PdlContext20
-  pdl__id?: PdlId20
-  pdl__result?: unknown
-  pdl__location?: PdlLocationType | null
-  pdl__timing?: PdlTiming | null
-  pdl__is_leaf?: PdlIsLeaf20
-  kind?: Kind20
-  function: Function
-  return: Return
-  signature?: Signature
-}
-/**
- * Json Schema with an `enum` field.
- */
-export interface EnumPdlType {
-  enum: Enum
-  [k: string]: unknown
-}
-/**
- * Optional type.
- */
-export interface OptionalPdlType {
-  optional: PdlTypeType
-}
-/**
- * Json Schema with a type field.
- */
-export interface JsonSchemaTypePdlType {
-  type: Type
-  [k: string]: unknown
-}
-/**
- * Object type.
- */
-export interface ObjectPdlType {
-  object: Object
-}
-export interface Object {
-  [k: string]: PdlTypeType
-}
-/**
- * Set of definitions executed before the execution of the block.
- *
- */
-export interface Defs {
-  [k: string]:
-    | boolean
-    | number
-    | string
-    | FunctionBlock
-    | CallBlock
-    | LitellmModelBlock
-    | GraniteioModelBlock
-    | CodeBlock
-    | ArgsBlock
-    | GetBlock
-    | DataBlock
-    | IfBlock
-    | MatchBlock
-    | RepeatBlock
-    | TextBlock
-    | LastOfBlock
-    | ArrayBlock
-    | ObjectBlock
-    | MessageBlock
-    | ReadBlock
-    | IncludeBlock
-    | ImportBlock
-    | ErrorBlock
-    | EmptyBlock
-    | null
+  pdl: BlockType
 }
 /**
- * Calling a function.
+ * A regular expression parser.
  */
-export interface CallBlock {
-  description?: Description1
-  /**
-   * Type specification of the result of the block.
-   *
-   */
+export interface RegexParser {
+  description?: string | null
   spec?:
     | (
         | "null"
@@ -3037,56 +1008,44 @@ export interface CallBlock {
         [k: string]: PdlTypeType
       }
     | null
-  defs?: Defs1
-  def?: Def23
-  contribute?: Contribute19
-  parser?: Parser19
-  fallback?: Fallback19
-  retry?: Retry19
-  trace_error_on_retry?: TraceErrorOnRetry19
-  role?: Role19
-  pdl__context?: PdlContext19
-  pdl__id?: PdlId19
+  regex: Regex
+  mode?: Mode
+}
+/**
+ * Single requirement definition.
+ */
+export interface RequirementType {
+  description: unknown
+  evaluate: Evaluate
+  transformContext: Transformcontext
+}
+export interface LocalizedExpression {
+  pdl__expr: PdlExpr
   pdl__result?: unknown
   pdl__location?: PdlLocationType | null
-  pdl__timing?: PdlTiming | null
-  pdl__is_leaf?: PdlIsLeaf19
-  kind?: Kind19
-  call: Call
-  args?: unknown
-  pdl__trace?: PdlTrace3
+}
+export interface PdlExpr {
+  [k: string]: unknown
 }
 /**
- * Set of definitions executed before the execution of the block.
- *
+ * Internal data structure to keep track of the source location information.
  */
-export interface Defs1 {
-  [k: string]:
-    | boolean
-    | number
-    | string
-    | FunctionBlock
-    | CallBlock
-    | LitellmModelBlock
-    | GraniteioModelBlock
-    | CodeBlock
-    | ArgsBlock
-    | GetBlock
-    | DataBlock
-    | IfBlock
-    | MatchBlock
-    | RepeatBlock
-    | TextBlock
-    | LastOfBlock
-    | ArrayBlock
-    | ObjectBlock
-    | MessageBlock
-    | ReadBlock
-    | IncludeBlock
-    | ImportBlock
-    | ErrorBlock
-    | EmptyBlock
-    | null
+export interface PdlLocationType {
+  path: Path
+  file: File
+  table: Table
+}
+export interface Table {
+  [k: string]: number
+}
+/**
+ * Internal data structure to record timing information in the trace.
+ */
+export interface PdlTiming {
+  start_nanos?: number | null
+  end_nanos?: number | null
+  first_use_nanos?: number | null
+  timezone?: string | null
 }
 /**
  * Call an LLM through [the LiteLLM API](https://docs.litellm.ai/).
@@ -3099,7 +1058,11 @@ export interface Defs1 {
  * ```
  */
 export interface LitellmModelBlock {
-  description?: Description2
+  /**
+   * Documentation associated to the block.
+   *
+   */
+  description?: string | null
   /**
    * Type specification of the result of the block.
    *
@@ -3130,38 +1093,59 @@ export interface LitellmModelBlock {
       }
     | null
   defs?: Defs2
-  def?: Def22
-  contribute?: Contribute18
-  parser?: Parser18
-  fallback?: Fallback18
-  retry?: Retry18
-  trace_error_on_retry?: TraceErrorOnRetry18
-  role?: Role18
-  pdl__context?: PdlContext18
-  pdl__id?: PdlId18
+  /**
+   * Name of the variable used to store the result of the execution of the block.
+   *
+   */
+  def?: string | null
+  contribute?: Contribute1
+  /**
+   * Parser to use to construct a value out of a string result.
+   */
+  parser?: ParserType | null
+  /**
+   * Block to execute in case of error.
+   *
+   */
+  fallback?: BlockType | null
+  /**
+   * The maximum number of times to retry when an error occurs within a block.
+   *
+   */
+  retry?: number | null
+  /**
+   * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+   *
+   */
+  trace_error_on_retry?: boolean | string | null
+  requirements?: RequirementsType1
+  /**
+   * Role associated to the block and sub-blocks.
+   * Typical roles are `system`, `user`, and `assistant`,
+   * but there may be other roles such as `available_tools`.
+   */
+  role?: string | null
+  /**
+   * Current context.
+   */
+  pdl__context?: ModelInput | null
+  /**
+   * Unique identifier for this block.
+   */
+  pdl__id?: string | null
   pdl__result?: unknown
   pdl__location?: PdlLocationType | null
+  /**
+   * Execution timing information.
+   */
   pdl__timing?: PdlTiming | null
-  pdl__is_leaf?: PdlIsLeaf18
-  kind?: Kind18
-  input?: Input1
-  modelResponse?: Modelresponse1
+  pdl__is_leaf?: PdlIsLeaf1
+  kind?: Kind1
   /**
-   * Tokens consumed during model call
+   * Messages to send to the model.
    *
    */
-  pdl__usage?: PdlUsage | null
-  pdl__model_input?: PdlModelInput1
-  platform?: Platform1
-  model: Model1
-  parameters?: Parameters1
-}
-/**
- * Set of definitions executed before the execution of the block.
- *
- */
-export interface Defs2 {
-  [k: string]:
+  input?:
     | boolean
     | number
     | string
@@ -3176,6 +1160,7 @@ export interface Defs2 {
     | IfBlock
     | MatchBlock
     | RepeatBlock
+    | MapBlock
     | TextBlock
     | LastOfBlock
     | ArrayBlock
@@ -3184,15 +1169,45 @@ export interface Defs2 {
     | ReadBlock
     | IncludeBlock
     | ImportBlock
+    | AggregatorBlock
     | ErrorBlock
     | EmptyBlock
     | null
+  /**
+   * Variable where to store the raw response of the model.
+   *
+   */
+  modelResponse?: string | null
+  /**
+   * Tokens consumed during model call
+   *
+   */
+  pdl__usage?: PdlUsage | null
+  pdl__model_input?: ModelInput | null
+  platform?: Platform1
+  /**
+   * Name of the model following the LiteLLM convention.
+   *
+   */
+  model: LocalizedExpression | string
+  parameters?: Parameters1
+}
+/**
+ * Set of definitions executed before the execution of the block.
+ *
+ */
+export interface Defs2 {
+  [k: string]: BlockType
 }
 /**
  * Call an LLM through the granite-io API.
  */
 export interface GraniteioModelBlock {
-  description?: Description3
+  /**
+   * Documentation associated to the block.
+   *
+   */
+  description?: string | null
   /**
    * Type specification of the result of the block.
    *
@@ -3223,38 +1238,59 @@ export interface GraniteioModelBlock {
       }
     | null
   defs?: Defs3
-  def?: Def21
-  contribute?: Contribute17
-  parser?: Parser17
-  fallback?: Fallback17
-  retry?: Retry17
-  trace_error_on_retry?: TraceErrorOnRetry17
-  role?: Role17
-  pdl__context?: PdlContext17
-  pdl__id?: PdlId17
+  /**
+   * Name of the variable used to store the result of the execution of the block.
+   *
+   */
+  def?: string | null
+  contribute?: Contribute2
+  /**
+   * Parser to use to construct a value out of a string result.
+   */
+  parser?: ParserType | null
+  /**
+   * Block to execute in case of error.
+   *
+   */
+  fallback?: BlockType | null
+  /**
+   * The maximum number of times to retry when an error occurs within a block.
+   *
+   */
+  retry?: number | null
+  /**
+   * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+   *
+   */
+  trace_error_on_retry?: boolean | string | null
+  requirements?: RequirementsType2
+  /**
+   * Role associated to the block and sub-blocks.
+   * Typical roles are `system`, `user`, and `assistant`,
+   * but there may be other roles such as `available_tools`.
+   */
+  role?: string | null
+  /**
+   * Current context.
+   */
+  pdl__context?: ModelInput | null
+  /**
+   * Unique identifier for this block.
+   */
+  pdl__id?: string | null
   pdl__result?: unknown
   pdl__location?: PdlLocationType | null
+  /**
+   * Execution timing information.
+   */
   pdl__timing?: PdlTiming | null
-  pdl__is_leaf?: PdlIsLeaf17
-  kind?: Kind17
-  input?: Input
-  modelResponse?: Modelresponse
+  pdl__is_leaf?: PdlIsLeaf2
+  kind?: Kind2
   /**
-   * Tokens consumed during model call
+   * Messages to send to the model.
    *
    */
-  pdl__usage?: PdlUsage | null
-  pdl__model_input?: PdlModelInput
-  platform?: Platform
-  processor: unknown
-  parameters?: Parameters
-}
-/**
- * Set of definitions executed before the execution of the block.
- *
- */
-export interface Defs3 {
-  [k: string]:
+  input?:
     | boolean
     | number
     | string
@@ -3269,6 +1305,7 @@ export interface Defs3 {
     | IfBlock
     | MatchBlock
     | RepeatBlock
+    | MapBlock
     | TextBlock
     | LastOfBlock
     | ArrayBlock
@@ -3277,9 +1314,31 @@ export interface Defs3 {
     | ReadBlock
     | IncludeBlock
     | ImportBlock
+    | AggregatorBlock
     | ErrorBlock
     | EmptyBlock
     | null
+  /**
+   * Variable where to store the raw response of the model.
+   *
+   */
+  modelResponse?: string | null
+  /**
+   * Tokens consumed during model call
+   *
+   */
+  pdl__usage?: PdlUsage | null
+  pdl__model_input?: ModelInput | null
+  platform?: Platform
+  processor: unknown
+  parameters?: Parameters
+}
+/**
+ * Set of definitions executed before the execution of the block.
+ *
+ */
+export interface Defs3 {
+  [k: string]: BlockType
 }
 /**
  * Execute a piece of code.
@@ -3294,7 +1353,11 @@ export interface Defs3 {
  * ```
  */
 export interface CodeBlock {
-  description?: Description4
+  /**
+   * Documentation associated to the block.
+   *
+   */
+  description?: string | null
   /**
    * Type specification of the result of the block.
    *
@@ -3325,29 +1388,60 @@ export interface CodeBlock {
       }
     | null
   defs?: Defs4
-  def?: Def20
-  contribute?: Contribute16
-  parser?: Parser16
-  fallback?: Fallback16
-  retry?: Retry16
-  trace_error_on_retry?: TraceErrorOnRetry16
-  role?: Role16
-  pdl__context?: PdlContext16
-  pdl__id?: PdlId16
+  /**
+   * Name of the variable used to store the result of the execution of the block.
+   *
+   */
+  def?: string | null
+  contribute?: Contribute3
+  /**
+   * Parser to use to construct a value out of a string result.
+   */
+  parser?: ParserType | null
+  /**
+   * Block to execute in case of error.
+   *
+   */
+  fallback?: BlockType | null
+  /**
+   * The maximum number of times to retry when an error occurs within a block.
+   *
+   */
+  retry?: number | null
+  /**
+   * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+   *
+   */
+  trace_error_on_retry?: boolean | string | null
+  requirements?: RequirementsType3
+  /**
+   * Role associated to the block and sub-blocks.
+   * Typical roles are `system`, `user`, and `assistant`,
+   * but there may be other roles such as `available_tools`.
+   */
+  role?: string | null
+  /**
+   * Current context.
+   */
+  pdl__context?: ModelInput | null
+  /**
+   * Unique identifier for this block.
+   */
+  pdl__id?: string | null
   pdl__result?: unknown
   pdl__location?: PdlLocationType | null
+  /**
+   * Execution timing information.
+   */
   pdl__timing?: PdlTiming | null
-  pdl__is_leaf?: PdlIsLeaf16
-  kind?: Kind16
-  lang: Lang1
-  code: Code
-}
-/**
- * Set of definitions executed before the execution of the block.
- *
- */
-export interface Defs4 {
-  [k: string]:
+  pdl__is_leaf?: PdlIsLeaf3
+  kind?: Kind3
+  lang: Lang
+  /**
+   * Code to execute.
+   *
+   */
+  code:
     | boolean
     | number
     | string
@@ -3362,6 +1456,7 @@ export interface Defs4 {
     | IfBlock
     | MatchBlock
     | RepeatBlock
+    | MapBlock
     | TextBlock
     | LastOfBlock
     | ArrayBlock
@@ -3370,10 +1465,18 @@ export interface Defs4 {
     | ReadBlock
     | IncludeBlock
     | ImportBlock
+    | AggregatorBlock
     | ErrorBlock
     | EmptyBlock
     | null
 }
+/**
+ * Set of definitions executed before the execution of the block.
+ *
+ */
+export interface Defs4 {
+  [k: string]: BlockType
+}
 /**
  * Execute a command line, which will spawn a subprocess with the given argument vector. Note: if you need a shell script execution, you must wrap your command line in /bin/sh or some shell of your choosing.
  *
@@ -3386,7 +1489,11 @@ export interface Defs4 {
  * ```
  */
 export interface ArgsBlock {
-  description?: Description5
+  /**
+   * Documentation associated to the block.
+   *
+   */
+  description?: string | null
   /**
    * Type specification of the result of the block.
    *
@@ -3417,54 +1524,63 @@ export interface ArgsBlock {
       }
     | null
   defs?: Defs5
-  def?: Def19
-  contribute?: Contribute15
-  parser?: Parser15
-  fallback?: Fallback15
-  retry?: Retry15
-  trace_error_on_retry?: TraceErrorOnRetry15
-  role?: Role15
-  pdl__context?: PdlContext15
-  pdl__id?: PdlId15
+  /**
+   * Name of the variable used to store the result of the execution of the block.
+   *
+   */
+  def?: string | null
+  contribute?: Contribute4
+  /**
+   * Parser to use to construct a value out of a string result.
+   */
+  parser?: ParserType | null
+  /**
+   * Block to execute in case of error.
+   *
+   */
+  fallback?: BlockType | null
+  /**
+   * The maximum number of times to retry when an error occurs within a block.
+   *
+   */
+  retry?: number | null
+  /**
+   * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+   *
+   */
+  trace_error_on_retry?: boolean | string | null
+  requirements?: RequirementsType4
+  /**
+   * Role associated to the block and sub-blocks.
+   * Typical roles are `system`, `user`, and `assistant`,
+   * but there may be other roles such as `available_tools`.
+   */
+  role?: string | null
+  /**
+   * Current context.
+   */
+  pdl__context?: ModelInput | null
+  /**
+   * Unique identifier for this block.
+   */
+  pdl__id?: string | null
   pdl__result?: unknown
   pdl__location?: PdlLocationType | null
+  /**
+   * Execution timing information.
+   */
   pdl__timing?: PdlTiming | null
-  pdl__is_leaf?: PdlIsLeaf15
-  kind?: Kind15
-  lang?: Lang
-  args: Args
+  pdl__is_leaf?: PdlIsLeaf4
+  kind?: Kind4
+  lang?: Lang1
+  args: Args1
 }
 /**
  * Set of definitions executed before the execution of the block.
  *
  */
 export interface Defs5 {
-  [k: string]:
-    | boolean
-    | number
-    | string
-    | FunctionBlock
-    | CallBlock
-    | LitellmModelBlock
-    | GraniteioModelBlock
-    | CodeBlock
-    | ArgsBlock
-    | GetBlock
-    | DataBlock
-    | IfBlock
-    | MatchBlock
-    | RepeatBlock
-    | TextBlock
-    | LastOfBlock
-    | ArrayBlock
-    | ObjectBlock
-    | MessageBlock
-    | ReadBlock
-    | IncludeBlock
-    | ImportBlock
-    | ErrorBlock
-    | EmptyBlock
-    | null
+  [k: string]: BlockType
 }
 /**
  * Get the value of a variable.
@@ -3472,7 +1588,11 @@ export interface Defs5 {
  * The GetBlock is deprecated.  Use DataBlock instead.
  */
 export interface GetBlock {
-  description?: Description6
+  /**
+   * Documentation associated to the block.
+   *
+   */
+  description?: string | null
   /**
    * Type specification of the result of the block.
    *
@@ -3503,20 +1623,54 @@ export interface GetBlock {
       }
     | null
   defs?: Defs6
-  def?: Def18
-  contribute?: Contribute14
-  parser?: Parser14
-  fallback?: Fallback14
-  retry?: Retry14
-  trace_error_on_retry?: TraceErrorOnRetry14
-  role?: Role14
-  pdl__context?: PdlContext14
-  pdl__id?: PdlId14
+  /**
+   * Name of the variable used to store the result of the execution of the block.
+   *
+   */
+  def?: string | null
+  contribute?: Contribute5
+  /**
+   * Parser to use to construct a value out of a string result.
+   */
+  parser?: ParserType | null
+  /**
+   * Block to execute in case of error.
+   *
+   */
+  fallback?: BlockType | null
+  /**
+   * The maximum number of times to retry when an error occurs within a block.
+   *
+   */
+  retry?: number | null
+  /**
+   * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+   *
+   */
+  trace_error_on_retry?: boolean | string | null
+  requirements?: RequirementsType5
+  /**
+   * Role associated to the block and sub-blocks.
+   * Typical roles are `system`, `user`, and `assistant`,
+   * but there may be other roles such as `available_tools`.
+   */
+  role?: string | null
+  /**
+   * Current context.
+   */
+  pdl__context?: ModelInput | null
+  /**
+   * Unique identifier for this block.
+   */
+  pdl__id?: string | null
   pdl__result?: unknown
   pdl__location?: PdlLocationType | null
+  /**
+   * Execution timing information.
+   */
   pdl__timing?: PdlTiming | null
-  pdl__is_leaf?: PdlIsLeaf14
-  kind?: Kind14
+  pdl__is_leaf?: PdlIsLeaf5
+  kind?: Kind5
   get: Get
 }
 /**
@@ -3524,32 +1678,7 @@ export interface GetBlock {
  *
  */
 export interface Defs6 {
-  [k: string]:
-    | boolean
-    | number
-    | string
-    | FunctionBlock
-    | CallBlock
-    | LitellmModelBlock
-    | GraniteioModelBlock
-    | CodeBlock
-    | ArgsBlock
-    | GetBlock
-    | DataBlock
-    | IfBlock
-    | MatchBlock
-    | RepeatBlock
-    | TextBlock
-    | LastOfBlock
-    | ArrayBlock
-    | ObjectBlock
-    | MessageBlock
-    | ReadBlock
-    | IncludeBlock
-    | ImportBlock
-    | ErrorBlock
-    | EmptyBlock
-    | null
+  [k: string]: BlockType
 }
 /**
  * Arbitrary value, equivalent to JSON.
@@ -3576,7 +1705,11 @@ export interface Defs6 {
  * ```
  */
 export interface DataBlock {
-  description?: Description7
+  /**
+   * Documentation associated to the block.
+   *
+   */
+  description?: string | null
   /**
    * Type specification of the result of the block.
    *
@@ -3607,20 +1740,54 @@ export interface DataBlock {
       }
     | null
   defs?: Defs7
-  def?: Def17
-  contribute?: Contribute13
-  parser?: Parser13
-  fallback?: Fallback13
-  retry?: Retry13
-  trace_error_on_retry?: TraceErrorOnRetry13
-  role?: Role13
-  pdl__context?: PdlContext13
-  pdl__id?: PdlId13
+  /**
+   * Name of the variable used to store the result of the execution of the block.
+   *
+   */
+  def?: string | null
+  contribute?: Contribute6
+  /**
+   * Parser to use to construct a value out of a string result.
+   */
+  parser?: ParserType | null
+  /**
+   * Block to execute in case of error.
+   *
+   */
+  fallback?: BlockType | null
+  /**
+   * The maximum number of times to retry when an error occurs within a block.
+   *
+   */
+  retry?: number | null
+  /**
+   * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+   *
+   */
+  trace_error_on_retry?: boolean | string | null
+  requirements?: RequirementsType6
+  /**
+   * Role associated to the block and sub-blocks.
+   * Typical roles are `system`, `user`, and `assistant`,
+   * but there may be other roles such as `available_tools`.
+   */
+  role?: string | null
+  /**
+   * Current context.
+   */
+  pdl__context?: ModelInput | null
+  /**
+   * Unique identifier for this block.
+   */
+  pdl__id?: string | null
   pdl__result?: unknown
   pdl__location?: PdlLocationType | null
+  /**
+   * Execution timing information.
+   */
   pdl__timing?: PdlTiming | null
-  pdl__is_leaf?: PdlIsLeaf13
-  kind?: Kind13
+  pdl__is_leaf?: PdlIsLeaf6
+  kind?: Kind6
   data: unknown
   raw?: Raw
 }
@@ -3629,32 +1796,7 @@ export interface DataBlock {
  *
  */
 export interface Defs7 {
-  [k: string]:
-    | boolean
-    | number
-    | string
-    | FunctionBlock
-    | CallBlock
-    | LitellmModelBlock
-    | GraniteioModelBlock
-    | CodeBlock
-    | ArgsBlock
-    | GetBlock
-    | DataBlock
-    | IfBlock
-    | MatchBlock
-    | RepeatBlock
-    | TextBlock
-    | LastOfBlock
-    | ArrayBlock
-    | ObjectBlock
-    | MessageBlock
-    | ReadBlock
-    | IncludeBlock
-    | ImportBlock
-    | ErrorBlock
-    | EmptyBlock
-    | null
+  [k: string]: BlockType
 }
 /**
  * Conditional control structure.
@@ -3670,7 +1812,11 @@ export interface Defs7 {
  * ```
  */
 export interface IfBlock {
-  description?: Description8
+  /**
+   * Documentation associated to the block.
+   *
+   */
+  description?: string | null
   /**
    * Type specification of the result of the block.
    *
@@ -3701,31 +1847,65 @@ export interface IfBlock {
       }
     | null
   defs?: Defs8
-  def?: Def16
-  contribute?: Contribute12
-  parser?: Parser12
-  fallback?: Fallback12
-  retry?: Retry12
-  trace_error_on_retry?: TraceErrorOnRetry12
-  role?: Role12
-  pdl__context?: PdlContext12
-  pdl__id?: PdlId12
+  /**
+   * Name of the variable used to store the result of the execution of the block.
+   *
+   */
+  def?: string | null
+  contribute?: Contribute7
+  /**
+   * Parser to use to construct a value out of a string result.
+   */
+  parser?: ParserType | null
+  /**
+   * Block to execute in case of error.
+   *
+   */
+  fallback?: BlockType | null
+  /**
+   * The maximum number of times to retry when an error occurs within a block.
+   *
+   */
+  retry?: number | null
+  /**
+   * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+   *
+   */
+  trace_error_on_retry?: boolean | string | null
+  requirements?: RequirementsType7
+  /**
+   * Role associated to the block and sub-blocks.
+   * Typical roles are `system`, `user`, and `assistant`,
+   * but there may be other roles such as `available_tools`.
+   */
+  role?: string | null
+  /**
+   * Current context.
+   */
+  pdl__context?: ModelInput | null
+  /**
+   * Unique identifier for this block.
+   */
+  pdl__id?: string | null
   pdl__result?: unknown
   pdl__location?: PdlLocationType | null
+  /**
+   * Execution timing information.
+   */
   pdl__timing?: PdlTiming | null
-  pdl__is_leaf?: PdlIsLeaf12
-  context?: IndependentEnum7
-  kind?: Kind12
-  if: If1
-  then: Then1
-  else?: Else
-}
-/**
- * Set of definitions executed before the execution of the block.
- *
- */
-export interface Defs8 {
-  [k: string]:
+  pdl__is_leaf?: PdlIsLeaf7
+  context?: IndependentEnum
+  kind?: Kind7
+  /**
+   * Condition.
+   *
+   */
+  if: LocalizedExpression | boolean | string
+  /**
+   * Branch to execute if the condition is true.
+   *
+   */
+  then:
     | boolean
     | number
     | string
@@ -3740,6 +1920,7 @@ export interface Defs8 {
     | IfBlock
     | MatchBlock
     | RepeatBlock
+    | MapBlock
     | TextBlock
     | LastOfBlock
     | ArrayBlock
@@ -3748,9 +1929,22 @@ export interface Defs8 {
     | ReadBlock
     | IncludeBlock
     | ImportBlock
+    | AggregatorBlock
     | ErrorBlock
     | EmptyBlock
     | null
+  /**
+   * Branch to execute if the condition is false.
+   *
+   */
+  else?: BlockType | null
+}
+/**
+ * Set of definitions executed before the execution of the block.
+ *
+ */
+export interface Defs8 {
+  [k: string]: BlockType
 }
 /**
  * Match control structure.
@@ -3773,7 +1967,11 @@ export interface Defs8 {
  * - then: Too low
  */
 export interface MatchBlock {
-  description?: Description9
+  /**
+   * Documentation associated to the block.
+   *
+   */
+  description?: string | null
   /**
    * Type specification of the result of the block.
    *
@@ -3804,30 +2002,234 @@ export interface MatchBlock {
       }
     | null
   defs?: Defs9
-  def?: Def11
-  contribute?: Contribute11
-  parser?: Parser11
-  fallback?: Fallback11
-  retry?: Retry11
-  trace_error_on_retry?: TraceErrorOnRetry11
-  role?: Role11
-  pdl__context?: PdlContext11
-  pdl__id?: PdlId11
+  /**
+   * Name of the variable used to store the result of the execution of the block.
+   *
+   */
+  def?: string | null
+  contribute?: Contribute8
+  /**
+   * Parser to use to construct a value out of a string result.
+   */
+  parser?: ParserType | null
+  /**
+   * Block to execute in case of error.
+   *
+   */
+  fallback?: BlockType | null
+  /**
+   * The maximum number of times to retry when an error occurs within a block.
+   *
+   */
+  retry?: number | null
+  /**
+   * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+   *
+   */
+  trace_error_on_retry?: boolean | string | null
+  requirements?: RequirementsType8
+  /**
+   * Role associated to the block and sub-blocks.
+   * Typical roles are `system`, `user`, and `assistant`,
+   * but there may be other roles such as `available_tools`.
+   */
+  role?: string | null
+  /**
+   * Current context.
+   */
+  pdl__context?: ModelInput | null
+  /**
+   * Unique identifier for this block.
+   */
+  pdl__id?: string | null
   pdl__result?: unknown
   pdl__location?: PdlLocationType | null
+  /**
+   * Execution timing information.
+   */
   pdl__timing?: PdlTiming | null
-  pdl__is_leaf?: PdlIsLeaf11
-  context?: IndependentEnum6
-  kind?: Kind11
+  pdl__is_leaf?: PdlIsLeaf8
+  context?: IndependentEnum1
+  kind?: Kind8
   match: unknown
-  with: With1
+  with: With
 }
 /**
  * Set of definitions executed before the execution of the block.
  *
  */
 export interface Defs9 {
-  [k: string]:
+  [k: string]: BlockType
+}
+/**
+ * Case of a match.
+ */
+export interface MatchCase {
+  case?: PatternType | null
+  if?: ExpressionBool | null
+  then: BlockType
+  pdl__case_result?: PdlCaseResult
+  pdl__if_result?: PdlIfResult
+  pdl__matched?: PdlMatched
+}
+/**
+ * Match any of the patterns.
+ */
+export interface OrPattern {
+  def?: string | null
+  anyOf: Anyof
+}
+/**
+ * Match an array.
+ */
+export interface ArrayPattern {
+  def?: string | null
+  array: Array
+}
+/**
+ * Match an object.
+ */
+export interface ObjectPattern {
+  def?: string | null
+  object: Object1
+}
+export interface Object1 {
+  [k: string]: PatternType
+}
+/**
+ * Match any value.
+ */
+export interface AnyPattern {
+  def?: string | null
+  any: Any
+}
+/**
+ * Repeat the execution of a block sequentially.
+ * The scope and `pdl_context` are accumulated in between iterations.
+ *
+ * For loop example:
+ * ```PDL
+ * for:
+ *     number: [1, 2, 3, 4]
+ *     name: ["Bob", "Carol", "David", "Ernest"]
+ * repeat:
+ *     "${ name }'s number is ${ number }\n"
+ * ```
+ *
+ * While loop:
+ * ```PDL
+ * defs:
+ *   i: 0
+ * while: ${i < 5}
+ * repeat:
+ *     defs:
+ *       i: ${ i + 1}
+ *     data: ${ i }
+ * join:
+ *   as: array
+ * ```
+ */
+export interface RepeatBlock {
+  /**
+   * Documentation associated to the block.
+   *
+   */
+  description?: string | null
+  /**
+   * Type specification of the result of the block.
+   *
+   */
+  spec?:
+    | (
+        | "null"
+        | "boolean"
+        | "string"
+        | "number"
+        | "integer"
+        | "array"
+        | "object"
+        | "bool"
+        | "str"
+        | "float"
+        | "int"
+        | "list"
+        | "obj"
+      )
+    | EnumPdlType
+    | PdlTypeType[]
+    | OptionalPdlType
+    | JsonSchemaTypePdlType
+    | ObjectPdlType
+    | {
+        [k: string]: PdlTypeType
+      }
+    | null
+  defs?: Defs10
+  /**
+   * Name of the variable used to store the result of the execution of the block.
+   *
+   */
+  def?: string | null
+  contribute?: Contribute9
+  /**
+   * Parser to use to construct a value out of a string result.
+   */
+  parser?: ParserType | null
+  /**
+   * Block to execute in case of error.
+   *
+   */
+  fallback?: BlockType | null
+  /**
+   * The maximum number of times to retry when an error occurs within a block.
+   *
+   */
+  retry?: number | null
+  /**
+   * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+   *
+   */
+  trace_error_on_retry?: boolean | string | null
+  requirements?: RequirementsType9
+  /**
+   * Role associated to the block and sub-blocks.
+   * Typical roles are `system`, `user`, and `assistant`,
+   * but there may be other roles such as `available_tools`.
+   */
+  role?: string | null
+  /**
+   * Current context.
+   */
+  pdl__context?: ModelInput | null
+  /**
+   * Unique identifier for this block.
+   */
+  pdl__id?: string | null
+  pdl__result?: unknown
+  pdl__location?: PdlLocationType | null
+  /**
+   * Execution timing information.
+   */
+  pdl__timing?: PdlTiming | null
+  pdl__is_leaf?: PdlIsLeaf9
+  context?: IndependentEnum2
+  kind?: Kind9
+  for?: For
+  /**
+   * Name of the variable containing the loop iteration.
+   *
+   */
+  index?: string | null
+  /**
+   * Condition to stay at the beginning of the loop.
+   *
+   */
+  while?: LocalizedExpression | boolean | string
+  /**
+   * Body of the loop.
+   *
+   */
+  repeat:
     | boolean
     | number
     | string
@@ -3842,6 +2244,7 @@ export interface Defs9 {
     | IfBlock
     | MatchBlock
     | RepeatBlock
+    | MapBlock
     | TextBlock
     | LastOfBlock
     | ArrayBlock
@@ -3850,19 +2253,45 @@ export interface Defs9 {
     | ReadBlock
     | IncludeBlock
     | ImportBlock
+    | AggregatorBlock
     | ErrorBlock
     | EmptyBlock
     | null
+  /**
+   * Condition to exit at the end of the loop.
+   *
+   */
+  until?: LocalizedExpression | boolean | string
+  /**
+   * Maximal number of iterations to perform.
+   *
+   */
+  maxIterations?: ExpressionInt | null
+  /**
+   * Define how to combine the result of each iteration.
+   *
+   */
+  join?: JoinText | JoinArray | JoinObject | JoinLastOf | JoinReduce
+  pdl__trace?: PdlTrace1
+}
+/**
+ * Set of definitions executed before the execution of the block.
+ *
+ */
+export interface Defs10 {
+  [k: string]: BlockType
 }
 /**
- * Repeat the execution of a block.
+ * Independent executions of  a block.
+ * Repeat the execution of a block starting from the initial scope
+ * and `pdl_context`.
  *
  * For loop example:
  * ```PDL
  * for:
  *     number: [1, 2, 3, 4]
  *     name: ["Bob", "Carol", "David", "Ernest"]
- * repeat:
+ * map:
  *     "${ name }'s number is ${ number }\n"
  * ```
  *
@@ -3870,14 +2299,18 @@ export interface Defs9 {
  * ```PDL
  * index: i
  * maxIterations: 5
- * repeat:
+ * map:
  *     ${ i }
  * join:
  *   as: array
  * ```
  */
-export interface RepeatBlock {
-  description?: Description10
+export interface MapBlock {
+  /**
+   * Documentation associated to the block.
+   *
+   */
+  description?: string | null
   /**
    * Type specification of the result of the block.
    *
@@ -3907,37 +2340,67 @@ export interface RepeatBlock {
         [k: string]: PdlTypeType
       }
     | null
-  defs?: Defs10
-  def?: Def10
+  defs?: Defs11
+  /**
+   * Name of the variable used to store the result of the execution of the block.
+   *
+   */
+  def?: string | null
   contribute?: Contribute10
-  parser?: Parser10
-  fallback?: Fallback10
-  retry?: Retry10
-  trace_error_on_retry?: TraceErrorOnRetry10
-  role?: Role10
-  pdl__context?: PdlContext10
-  pdl__id?: PdlId10
+  /**
+   * Parser to use to construct a value out of a string result.
+   */
+  parser?: ParserType | null
+  /**
+   * Block to execute in case of error.
+   *
+   */
+  fallback?: BlockType | null
+  /**
+   * The maximum number of times to retry when an error occurs within a block.
+   *
+   */
+  retry?: number | null
+  /**
+   * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+   *
+   */
+  trace_error_on_retry?: boolean | string | null
+  requirements?: RequirementsType10
+  /**
+   * Role associated to the block and sub-blocks.
+   * Typical roles are `system`, `user`, and `assistant`,
+   * but there may be other roles such as `available_tools`.
+   */
+  role?: string | null
+  /**
+   * Current context.
+   */
+  pdl__context?: ModelInput | null
+  /**
+   * Unique identifier for this block.
+   */
+  pdl__id?: string | null
   pdl__result?: unknown
   pdl__location?: PdlLocationType | null
+  /**
+   * Execution timing information.
+   */
   pdl__timing?: PdlTiming | null
   pdl__is_leaf?: PdlIsLeaf10
-  context?: IndependentEnum5
+  context?: IndependentEnum3
   kind?: Kind10
-  for?: For
-  index?: Index
-  while?: While
-  repeat: Repeat
-  until?: Until
-  maxIterations?: Maxiterations
-  join?: Join
-  pdl__trace?: PdlTrace2
-}
-/**
- * Set of definitions executed before the execution of the block.
- *
- */
-export interface Defs10 {
-  [k: string]:
+  for?: For1
+  /**
+   * Name of the variable containing the loop iteration.
+   *
+   */
+  index?: string | null
+  /**
+   * Body of the iterator.
+   *
+   */
+  map:
     | boolean
     | number
     | string
@@ -3952,6 +2415,7 @@ export interface Defs10 {
     | IfBlock
     | MatchBlock
     | RepeatBlock
+    | MapBlock
     | TextBlock
     | LastOfBlock
     | ArrayBlock
@@ -3960,15 +2424,43 @@ export interface Defs10 {
     | ReadBlock
     | IncludeBlock
     | ImportBlock
+    | AggregatorBlock
     | ErrorBlock
     | EmptyBlock
     | null
+  /**
+   * Maximal number of iterations to perform.
+   *
+   */
+  maxIterations?: ExpressionInt | null
+  /**
+   * Define how to combine the result of each iteration.
+   *
+   */
+  join?: JoinText | JoinArray | JoinObject | JoinLastOf | JoinReduce
+  /**
+   * Maximal number of workers to execute the map in parallel. Is it is set to `0`, the execution is sequential otherwise it is given as argument to the `ThreadPoolExecutor`.
+   *
+   */
+  maxWorkers?: number | null
+  pdl__trace?: PdlTrace
+}
+/**
+ * Set of definitions executed before the execution of the block.
+ *
+ */
+export interface Defs11 {
+  [k: string]: BlockType
 }
 /**
  * Create the concatenation of the stringify version of the result of each block of the list of blocks.
  */
 export interface TextBlock {
-  description?: Description11
+  /**
+   * Documentation associated to the block.
+   *
+   */
+  description?: string | null
   /**
    * Type specification of the result of the block.
    *
@@ -3998,61 +2490,74 @@ export interface TextBlock {
         [k: string]: PdlTypeType
       }
     | null
-  defs?: Defs11
-  def?: Def9
-  contribute?: Contribute9
-  parser?: Parser9
-  fallback?: Fallback9
-  retry?: Retry9
-  trace_error_on_retry?: TraceErrorOnRetry9
-  role?: Role9
-  pdl__context?: PdlContext9
-  pdl__id?: PdlId9
+  defs?: Defs12
+  /**
+   * Name of the variable used to store the result of the execution of the block.
+   *
+   */
+  def?: string | null
+  contribute?: Contribute11
+  /**
+   * Parser to use to construct a value out of a string result.
+   */
+  parser?: ParserType | null
+  /**
+   * Block to execute in case of error.
+   *
+   */
+  fallback?: BlockType | null
+  /**
+   * The maximum number of times to retry when an error occurs within a block.
+   *
+   */
+  retry?: number | null
+  /**
+   * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+   *
+   */
+  trace_error_on_retry?: boolean | string | null
+  requirements?: RequirementsType11
+  /**
+   * Role associated to the block and sub-blocks.
+   * Typical roles are `system`, `user`, and `assistant`,
+   * but there may be other roles such as `available_tools`.
+   */
+  role?: string | null
+  /**
+   * Current context.
+   */
+  pdl__context?: ModelInput | null
+  /**
+   * Unique identifier for this block.
+   */
+  pdl__id?: string | null
   pdl__result?: unknown
   pdl__location?: PdlLocationType | null
+  /**
+   * Execution timing information.
+   */
   pdl__timing?: PdlTiming | null
-  pdl__is_leaf?: PdlIsLeaf9
+  pdl__is_leaf?: PdlIsLeaf11
   context?: IndependentEnum4
-  kind?: Kind9
+  kind?: Kind11
   text: Text
 }
 /**
  * Set of definitions executed before the execution of the block.
  *
  */
-export interface Defs11 {
-  [k: string]:
-    | boolean
-    | number
-    | string
-    | FunctionBlock
-    | CallBlock
-    | LitellmModelBlock
-    | GraniteioModelBlock
-    | CodeBlock
-    | ArgsBlock
-    | GetBlock
-    | DataBlock
-    | IfBlock
-    | MatchBlock
-    | RepeatBlock
-    | TextBlock
-    | LastOfBlock
-    | ArrayBlock
-    | ObjectBlock
-    | MessageBlock
-    | ReadBlock
-    | IncludeBlock
-    | ImportBlock
-    | ErrorBlock
-    | EmptyBlock
-    | null
+export interface Defs12 {
+  [k: string]: BlockType
 }
 /**
  * Return the value of the last block if the list of blocks.
  */
 export interface LastOfBlock {
-  description?: Description12
+  /**
+   * Documentation associated to the block.
+   *
+   */
+  description?: string | null
   /**
    * Type specification of the result of the block.
    *
@@ -4082,61 +2587,74 @@ export interface LastOfBlock {
         [k: string]: PdlTypeType
       }
     | null
-  defs?: Defs12
-  def?: Def8
-  contribute?: Contribute8
-  parser?: Parser8
-  fallback?: Fallback8
-  retry?: Retry8
-  trace_error_on_retry?: TraceErrorOnRetry8
-  role?: Role8
-  pdl__context?: PdlContext8
-  pdl__id?: PdlId8
+  defs?: Defs13
+  /**
+   * Name of the variable used to store the result of the execution of the block.
+   *
+   */
+  def?: string | null
+  contribute?: Contribute12
+  /**
+   * Parser to use to construct a value out of a string result.
+   */
+  parser?: ParserType | null
+  /**
+   * Block to execute in case of error.
+   *
+   */
+  fallback?: BlockType | null
+  /**
+   * The maximum number of times to retry when an error occurs within a block.
+   *
+   */
+  retry?: number | null
+  /**
+   * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+   *
+   */
+  trace_error_on_retry?: boolean | string | null
+  requirements?: RequirementsType12
+  /**
+   * Role associated to the block and sub-blocks.
+   * Typical roles are `system`, `user`, and `assistant`,
+   * but there may be other roles such as `available_tools`.
+   */
+  role?: string | null
+  /**
+   * Current context.
+   */
+  pdl__context?: ModelInput | null
+  /**
+   * Unique identifier for this block.
+   */
+  pdl__id?: string | null
   pdl__result?: unknown
   pdl__location?: PdlLocationType | null
+  /**
+   * Execution timing information.
+   */
   pdl__timing?: PdlTiming | null
-  pdl__is_leaf?: PdlIsLeaf8
-  context?: IndependentEnum3
-  kind?: Kind8
+  pdl__is_leaf?: PdlIsLeaf12
+  context?: IndependentEnum5
+  kind?: Kind12
   lastOf: Lastof
 }
 /**
  * Set of definitions executed before the execution of the block.
  *
  */
-export interface Defs12 {
-  [k: string]:
-    | boolean
-    | number
-    | string
-    | FunctionBlock
-    | CallBlock
-    | LitellmModelBlock
-    | GraniteioModelBlock
-    | CodeBlock
-    | ArgsBlock
-    | GetBlock
-    | DataBlock
-    | IfBlock
-    | MatchBlock
-    | RepeatBlock
-    | TextBlock
-    | LastOfBlock
-    | ArrayBlock
-    | ObjectBlock
-    | MessageBlock
-    | ReadBlock
-    | IncludeBlock
-    | ImportBlock
-    | ErrorBlock
-    | EmptyBlock
-    | null
+export interface Defs13 {
+  [k: string]: BlockType
 }
 /**
  * Return the array of values computed by each block of the list of blocks.
  */
 export interface ArrayBlock {
-  description?: Description13
+  /**
+   * Documentation associated to the block.
+   *
+   */
+  description?: string | null
   /**
    * Type specification of the result of the block.
    *
@@ -4166,61 +2684,74 @@ export interface ArrayBlock {
         [k: string]: PdlTypeType
       }
     | null
-  defs?: Defs13
-  def?: Def7
-  contribute?: Contribute7
-  parser?: Parser7
-  fallback?: Fallback7
-  retry?: Retry7
-  trace_error_on_retry?: TraceErrorOnRetry7
-  role?: Role7
-  pdl__context?: PdlContext7
-  pdl__id?: PdlId7
+  defs?: Defs14
+  /**
+   * Name of the variable used to store the result of the execution of the block.
+   *
+   */
+  def?: string | null
+  contribute?: Contribute13
+  /**
+   * Parser to use to construct a value out of a string result.
+   */
+  parser?: ParserType | null
+  /**
+   * Block to execute in case of error.
+   *
+   */
+  fallback?: BlockType | null
+  /**
+   * The maximum number of times to retry when an error occurs within a block.
+   *
+   */
+  retry?: number | null
+  /**
+   * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+   *
+   */
+  trace_error_on_retry?: boolean | string | null
+  requirements?: RequirementsType13
+  /**
+   * Role associated to the block and sub-blocks.
+   * Typical roles are `system`, `user`, and `assistant`,
+   * but there may be other roles such as `available_tools`.
+   */
+  role?: string | null
+  /**
+   * Current context.
+   */
+  pdl__context?: ModelInput | null
+  /**
+   * Unique identifier for this block.
+   */
+  pdl__id?: string | null
   pdl__result?: unknown
   pdl__location?: PdlLocationType | null
+  /**
+   * Execution timing information.
+   */
   pdl__timing?: PdlTiming | null
-  pdl__is_leaf?: PdlIsLeaf7
-  context?: IndependentEnum2
-  kind?: Kind7
-  array: Array
+  pdl__is_leaf?: PdlIsLeaf13
+  context?: IndependentEnum6
+  kind?: Kind13
+  array: Array1
 }
 /**
  * Set of definitions executed before the execution of the block.
  *
  */
-export interface Defs13 {
-  [k: string]:
-    | boolean
-    | number
-    | string
-    | FunctionBlock
-    | CallBlock
-    | LitellmModelBlock
-    | GraniteioModelBlock
-    | CodeBlock
-    | ArgsBlock
-    | GetBlock
-    | DataBlock
-    | IfBlock
-    | MatchBlock
-    | RepeatBlock
-    | TextBlock
-    | LastOfBlock
-    | ArrayBlock
-    | ObjectBlock
-    | MessageBlock
-    | ReadBlock
-    | IncludeBlock
-    | ImportBlock
-    | ErrorBlock
-    | EmptyBlock
-    | null
+export interface Defs14 {
+  [k: string]: BlockType
 }
 /**
  * Return the object where the value of each field is defined by a block. If the body of the object is an array, the resulting object is the union of the objects computed by each element of the array.
  */
 export interface ObjectBlock {
-  description?: Description14
+  /**
+   * Documentation associated to the block.
+   *
+   */
+  description?: string | null
   /**
    * Type specification of the result of the block.
    *
@@ -4250,61 +2781,74 @@ export interface ObjectBlock {
         [k: string]: PdlTypeType
       }
     | null
-  defs?: Defs14
-  def?: Def6
-  contribute?: Contribute6
-  parser?: Parser6
-  fallback?: Fallback6
-  retry?: Retry6
-  trace_error_on_retry?: TraceErrorOnRetry6
-  role?: Role6
-  pdl__context?: PdlContext6
-  pdl__id?: PdlId6
+  defs?: Defs15
+  /**
+   * Name of the variable used to store the result of the execution of the block.
+   *
+   */
+  def?: string | null
+  contribute?: Contribute14
+  /**
+   * Parser to use to construct a value out of a string result.
+   */
+  parser?: ParserType | null
+  /**
+   * Block to execute in case of error.
+   *
+   */
+  fallback?: BlockType | null
+  /**
+   * The maximum number of times to retry when an error occurs within a block.
+   *
+   */
+  retry?: number | null
+  /**
+   * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+   *
+   */
+  trace_error_on_retry?: boolean | string | null
+  requirements?: RequirementsType14
+  /**
+   * Role associated to the block and sub-blocks.
+   * Typical roles are `system`, `user`, and `assistant`,
+   * but there may be other roles such as `available_tools`.
+   */
+  role?: string | null
+  /**
+   * Current context.
+   */
+  pdl__context?: ModelInput | null
+  /**
+   * Unique identifier for this block.
+   */
+  pdl__id?: string | null
   pdl__result?: unknown
   pdl__location?: PdlLocationType | null
-  pdl__timing?: PdlTiming | null
-  pdl__is_leaf?: PdlIsLeaf6
-  context?: IndependentEnum1
-  kind?: Kind6
-  object: Object1
-}
-/**
- * Set of definitions executed before the execution of the block.
- *
- */
-export interface Defs14 {
-  [k: string]:
-    | boolean
-    | number
-    | string
-    | FunctionBlock
-    | CallBlock
-    | LitellmModelBlock
-    | GraniteioModelBlock
-    | CodeBlock
-    | ArgsBlock
-    | GetBlock
-    | DataBlock
-    | IfBlock
-    | MatchBlock
-    | RepeatBlock
-    | TextBlock
-    | LastOfBlock
-    | ArrayBlock
-    | ObjectBlock
-    | MessageBlock
-    | ReadBlock
-    | IncludeBlock
-    | ImportBlock
-    | ErrorBlock
-    | EmptyBlock
-    | null
+  /**
+   * Execution timing information.
+   */
+  pdl__timing?: PdlTiming | null
+  pdl__is_leaf?: PdlIsLeaf14
+  context?: IndependentEnum7
+  kind?: Kind14
+  object: Object2
+}
+/**
+ * Set of definitions executed before the execution of the block.
+ *
+ */
+export interface Defs15 {
+  [k: string]: BlockType
 }
 /**
  * Create a message.
  */
 export interface MessageBlock {
-  description?: Description15
+  /**
+   * Documentation associated to the block.
+   *
+   */
+  description?: string | null
   /**
    * Type specification of the result of the block.
    *
@@ -4334,31 +2878,59 @@ export interface MessageBlock {
         [k: string]: PdlTypeType
       }
     | null
-  defs?: Defs15
-  def?: Def5
-  contribute?: Contribute5
-  parser?: Parser5
-  fallback?: Fallback5
-  retry?: Retry5
-  trace_error_on_retry?: TraceErrorOnRetry5
-  role?: Role5
-  pdl__context?: PdlContext5
-  pdl__id?: PdlId5
+  defs?: Defs16
+  /**
+   * Name of the variable used to store the result of the execution of the block.
+   *
+   */
+  def?: string | null
+  contribute?: Contribute15
+  /**
+   * Parser to use to construct a value out of a string result.
+   */
+  parser?: ParserType | null
+  /**
+   * Block to execute in case of error.
+   *
+   */
+  fallback?: BlockType | null
+  /**
+   * The maximum number of times to retry when an error occurs within a block.
+   *
+   */
+  retry?: number | null
+  /**
+   * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+   *
+   */
+  trace_error_on_retry?: boolean | string | null
+  requirements?: RequirementsType15
+  /**
+   * Role associated to the block and sub-blocks.
+   * Typical roles are `system`, `user`, and `assistant`,
+   * but there may be other roles such as `available_tools`.
+   */
+  role?: string | null
+  /**
+   * Current context.
+   */
+  pdl__context?: ModelInput | null
+  /**
+   * Unique identifier for this block.
+   */
+  pdl__id?: string | null
   pdl__result?: unknown
   pdl__location?: PdlLocationType | null
+  /**
+   * Execution timing information.
+   */
   pdl__timing?: PdlTiming | null
-  pdl__is_leaf?: PdlIsLeaf5
-  kind?: Kind5
-  content: Content
-  name?: Name
-  tool_call_id?: ToolCallId
-}
-/**
- * Set of definitions executed before the execution of the block.
- *
- */
-export interface Defs15 {
-  [k: string]:
+  pdl__is_leaf?: PdlIsLeaf15
+  kind?: Kind15
+  /**
+   * Content of the message.
+   */
+  content:
     | boolean
     | number
     | string
@@ -4373,6 +2945,7 @@ export interface Defs15 {
     | IfBlock
     | MatchBlock
     | RepeatBlock
+    | MapBlock
     | TextBlock
     | LastOfBlock
     | ArrayBlock
@@ -4381,9 +2954,25 @@ export interface Defs15 {
     | ReadBlock
     | IncludeBlock
     | ImportBlock
+    | AggregatorBlock
     | ErrorBlock
     | EmptyBlock
     | null
+  /**
+   * For example, the name of the tool that was invoked, for which this message is the tool response.
+   */
+  name?: ExpressionStr | null
+  /**
+   * The id of the tool invocation for which this message is the tool response.
+   */
+  tool_call_id?: ExpressionStr | null
+}
+/**
+ * Set of definitions executed before the execution of the block.
+ *
+ */
+export interface Defs16 {
+  [k: string]: BlockType
 }
 /**
  * Read from a file or standard input.
@@ -4401,7 +2990,11 @@ export interface Defs15 {
  * ```
  */
 export interface ReadBlock {
-  description?: Description16
+  /**
+   * Documentation associated to the block.
+   *
+   */
+  description?: string | null
   /**
    * Type specification of the result of the block.
    *
@@ -4431,62 +3024,83 @@ export interface ReadBlock {
         [k: string]: PdlTypeType
       }
     | null
-  defs?: Defs16
-  def?: Def4
-  contribute?: Contribute4
-  parser?: Parser4
-  fallback?: Fallback4
-  retry?: Retry4
-  trace_error_on_retry?: TraceErrorOnRetry4
-  role?: Role4
-  pdl__context?: PdlContext4
-  pdl__id?: PdlId4
+  defs?: Defs17
+  /**
+   * Name of the variable used to store the result of the execution of the block.
+   *
+   */
+  def?: string | null
+  contribute?: Contribute16
+  /**
+   * Parser to use to construct a value out of a string result.
+   */
+  parser?: ParserType | null
+  /**
+   * Block to execute in case of error.
+   *
+   */
+  fallback?: BlockType | null
+  /**
+   * The maximum number of times to retry when an error occurs within a block.
+   *
+   */
+  retry?: number | null
+  /**
+   * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+   *
+   */
+  trace_error_on_retry?: boolean | string | null
+  requirements?: RequirementsType16
+  /**
+   * Role associated to the block and sub-blocks.
+   * Typical roles are `system`, `user`, and `assistant`,
+   * but there may be other roles such as `available_tools`.
+   */
+  role?: string | null
+  /**
+   * Current context.
+   */
+  pdl__context?: ModelInput | null
+  /**
+   * Unique identifier for this block.
+   */
+  pdl__id?: string | null
   pdl__result?: unknown
   pdl__location?: PdlLocationType | null
+  /**
+   * Execution timing information.
+   */
   pdl__timing?: PdlTiming | null
-  pdl__is_leaf?: PdlIsLeaf4
-  kind?: Kind4
-  read: Read
-  message?: Message
+  pdl__is_leaf?: PdlIsLeaf16
+  kind?: Kind16
+  /**
+   * Name of the file to read. If `None`, read the standard input.
+   *
+   */
+  read: ExpressionStr | null
+  /**
+   * Message to prompt the user to enter a value.
+   *
+   */
+  message?: string | null
   multiline?: Multiline
 }
 /**
  * Set of definitions executed before the execution of the block.
  *
  */
-export interface Defs16 {
-  [k: string]:
-    | boolean
-    | number
-    | string
-    | FunctionBlock
-    | CallBlock
-    | LitellmModelBlock
-    | GraniteioModelBlock
-    | CodeBlock
-    | ArgsBlock
-    | GetBlock
-    | DataBlock
-    | IfBlock
-    | MatchBlock
-    | RepeatBlock
-    | TextBlock
-    | LastOfBlock
-    | ArrayBlock
-    | ObjectBlock
-    | MessageBlock
-    | ReadBlock
-    | IncludeBlock
-    | ImportBlock
-    | ErrorBlock
-    | EmptyBlock
-    | null
+export interface Defs17 {
+  [k: string]: BlockType
 }
 /**
  * Include a PDL file.
  */
 export interface IncludeBlock {
-  description?: Description17
+  /**
+   * Documentation associated to the block.
+   *
+   */
+  description?: string | null
   /**
    * Type specification of the result of the block.
    *
@@ -4516,62 +3130,75 @@ export interface IncludeBlock {
         [k: string]: PdlTypeType
       }
     | null
-  defs?: Defs17
-  def?: Def3
-  contribute?: Contribute3
-  parser?: Parser3
-  fallback?: Fallback3
-  retry?: Retry3
-  trace_error_on_retry?: TraceErrorOnRetry3
-  role?: Role3
-  pdl__context?: PdlContext3
-  pdl__id?: PdlId3
+  defs?: Defs18
+  /**
+   * Name of the variable used to store the result of the execution of the block.
+   *
+   */
+  def?: string | null
+  contribute?: Contribute17
+  /**
+   * Parser to use to construct a value out of a string result.
+   */
+  parser?: ParserType | null
+  /**
+   * Block to execute in case of error.
+   *
+   */
+  fallback?: BlockType | null
+  /**
+   * The maximum number of times to retry when an error occurs within a block.
+   *
+   */
+  retry?: number | null
+  /**
+   * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+   *
+   */
+  trace_error_on_retry?: boolean | string | null
+  requirements?: RequirementsType17
+  /**
+   * Role associated to the block and sub-blocks.
+   * Typical roles are `system`, `user`, and `assistant`,
+   * but there may be other roles such as `available_tools`.
+   */
+  role?: string | null
+  /**
+   * Current context.
+   */
+  pdl__context?: ModelInput | null
+  /**
+   * Unique identifier for this block.
+   */
+  pdl__id?: string | null
   pdl__result?: unknown
   pdl__location?: PdlLocationType | null
+  /**
+   * Execution timing information.
+   */
   pdl__timing?: PdlTiming | null
-  pdl__is_leaf?: PdlIsLeaf3
-  context?: IndependentEnum
-  kind?: Kind3
+  pdl__is_leaf?: PdlIsLeaf17
+  context?: IndependentEnum8
+  kind?: Kind17
   include: Include
-  pdl__trace?: PdlTrace1
+  pdl__trace?: BlockType | null
 }
 /**
  * Set of definitions executed before the execution of the block.
  *
  */
-export interface Defs17 {
-  [k: string]:
-    | boolean
-    | number
-    | string
-    | FunctionBlock
-    | CallBlock
-    | LitellmModelBlock
-    | GraniteioModelBlock
-    | CodeBlock
-    | ArgsBlock
-    | GetBlock
-    | DataBlock
-    | IfBlock
-    | MatchBlock
-    | RepeatBlock
-    | TextBlock
-    | LastOfBlock
-    | ArrayBlock
-    | ObjectBlock
-    | MessageBlock
-    | ReadBlock
-    | IncludeBlock
-    | ImportBlock
-    | ErrorBlock
-    | EmptyBlock
-    | null
+export interface Defs18 {
+  [k: string]: BlockType
 }
 /**
  * Import a PDL file.
  */
 export interface ImportBlock {
-  description?: Description18
+  /**
+   * Documentation associated to the block.
+   *
+   */
+  description?: string | null
   /**
    * Type specification of the result of the block.
    *
@@ -4601,61 +3228,74 @@ export interface ImportBlock {
         [k: string]: PdlTypeType
       }
     | null
-  defs?: Defs18
-  def?: Def2
-  contribute?: Contribute2
-  parser?: Parser2
-  fallback?: Fallback2
-  retry?: Retry2
-  trace_error_on_retry?: TraceErrorOnRetry2
-  role?: Role2
-  pdl__context?: PdlContext2
-  pdl__id?: PdlId2
-  pdl__result?: unknown
-  pdl__location?: PdlLocationType | null
-  pdl__timing?: PdlTiming | null
-  pdl__is_leaf?: PdlIsLeaf2
-  kind?: Kind2
-  import: Import
-  pdl__trace?: PdlTrace
-}
-/**
- * Set of definitions executed before the execution of the block.
- *
- */
-export interface Defs18 {
-  [k: string]:
-    | boolean
-    | number
-    | string
-    | FunctionBlock
-    | CallBlock
-    | LitellmModelBlock
-    | GraniteioModelBlock
-    | CodeBlock
-    | ArgsBlock
-    | GetBlock
-    | DataBlock
-    | IfBlock
-    | MatchBlock
-    | RepeatBlock
-    | TextBlock
-    | LastOfBlock
-    | ArrayBlock
-    | ObjectBlock
-    | MessageBlock
-    | ReadBlock
-    | IncludeBlock
-    | ImportBlock
-    | ErrorBlock
-    | EmptyBlock
-    | null
+  defs?: Defs19
+  /**
+   * Name of the variable used to store the result of the execution of the block.
+   *
+   */
+  def?: string | null
+  contribute?: Contribute18
+  /**
+   * Parser to use to construct a value out of a string result.
+   */
+  parser?: ParserType | null
+  /**
+   * Block to execute in case of error.
+   *
+   */
+  fallback?: BlockType | null
+  /**
+   * The maximum number of times to retry when an error occurs within a block.
+   *
+   */
+  retry?: number | null
+  /**
+   * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+   *
+   */
+  trace_error_on_retry?: boolean | string | null
+  requirements?: RequirementsType18
+  /**
+   * Role associated to the block and sub-blocks.
+   * Typical roles are `system`, `user`, and `assistant`,
+   * but there may be other roles such as `available_tools`.
+   */
+  role?: string | null
+  /**
+   * Current context.
+   */
+  pdl__context?: ModelInput | null
+  /**
+   * Unique identifier for this block.
+   */
+  pdl__id?: string | null
+  pdl__result?: unknown
+  pdl__location?: PdlLocationType | null
+  /**
+   * Execution timing information.
+   */
+  pdl__timing?: PdlTiming | null
+  pdl__is_leaf?: PdlIsLeaf18
+  kind?: Kind18
+  import: Import
+  pdl__trace?: BlockType | null
 }
 /**
- * Block representing an error generated at runtime.
+ * Set of definitions executed before the execution of the block.
+ *
  */
-export interface ErrorBlock {
-  description?: Description19
+export interface Defs19 {
+  [k: string]: BlockType
+}
+/**
+ * Create a new aggregator that can be use in the `contribute` field.
+ */
+export interface AggregatorBlock {
+  /**
+   * Documentation associated to the block.
+   *
+   */
+  description?: string | null
   /**
    * Type specification of the result of the block.
    *
@@ -4685,61 +3325,82 @@ export interface ErrorBlock {
         [k: string]: PdlTypeType
       }
     | null
-  defs?: Defs19
-  def?: Def1
-  contribute?: Contribute1
-  parser?: Parser1
-  fallback?: Fallback1
-  retry?: Retry1
-  trace_error_on_retry?: TraceErrorOnRetry1
-  role?: Role1
-  pdl__context?: PdlContext1
-  pdl__id?: PdlId1
+  defs?: Defs20
+  /**
+   * Name of the variable used to store the result of the execution of the block.
+   *
+   */
+  def?: string | null
+  contribute?: Contribute19
+  /**
+   * Parser to use to construct a value out of a string result.
+   */
+  parser?: ParserType | null
+  /**
+   * Block to execute in case of error.
+   *
+   */
+  fallback?: BlockType | null
+  /**
+   * The maximum number of times to retry when an error occurs within a block.
+   *
+   */
+  retry?: number | null
+  /**
+   * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+   *
+   */
+  trace_error_on_retry?: boolean | string | null
+  requirements?: RequirementsType19
+  /**
+   * Role associated to the block and sub-blocks.
+   * Typical roles are `system`, `user`, and `assistant`,
+   * but there may be other roles such as `available_tools`.
+   */
+  role?: string | null
+  /**
+   * Current context.
+   */
+  pdl__context?: ModelInput | null
+  /**
+   * Unique identifier for this block.
+   */
+  pdl__id?: string | null
   pdl__result?: unknown
   pdl__location?: PdlLocationType | null
+  /**
+   * Execution timing information.
+   */
   pdl__timing?: PdlTiming | null
-  pdl__is_leaf?: PdlIsLeaf1
-  kind?: Kind1
-  msg: Msg
-  program: Program1
+  pdl__is_leaf?: PdlIsLeaf19
+  kind?: Kind19
+  aggregator: Aggregator
 }
 /**
  * Set of definitions executed before the execution of the block.
  *
  */
-export interface Defs19 {
-  [k: string]:
-    | boolean
-    | number
-    | string
-    | FunctionBlock
-    | CallBlock
-    | LitellmModelBlock
-    | GraniteioModelBlock
-    | CodeBlock
-    | ArgsBlock
-    | GetBlock
-    | DataBlock
-    | IfBlock
-    | MatchBlock
-    | RepeatBlock
-    | TextBlock
-    | LastOfBlock
-    | ArrayBlock
-    | ObjectBlock
-    | MessageBlock
-    | ReadBlock
-    | IncludeBlock
-    | ImportBlock
-    | ErrorBlock
-    | EmptyBlock
-    | null
+export interface Defs20 {
+  [k: string]: BlockType
+}
+export interface FileAggregatorConfig {
+  description?: Description1
+  file: File1
+  mode?: Mode1
+  encoding?: Encoding
+  prefix?: Prefix
+  suffix?: Suffix
+  flush?: Flush
 }
 /**
- * Block without an action. It can contain definitions.
+ * Block representing an error generated at runtime.
  */
-export interface EmptyBlock {
-  description?: Description20
+export interface ErrorBlock {
+  /**
+   * Documentation associated to the block.
+   *
+   */
+  description?: string | null
   /**
    * Type specification of the result of the block.
    *
@@ -4769,28 +3430,61 @@ export interface EmptyBlock {
         [k: string]: PdlTypeType
       }
     | null
-  defs?: Defs20
-  def?: Def
-  contribute?: Contribute
-  parser?: Parser
-  fallback?: Fallback
-  retry?: Retry
-  trace_error_on_retry?: TraceErrorOnRetry
-  role?: Role
-  pdl__context?: PdlContext
-  pdl__id?: PdlId
+  defs?: Defs21
+  /**
+   * Name of the variable used to store the result of the execution of the block.
+   *
+   */
+  def?: string | null
+  contribute?: Contribute20
+  /**
+   * Parser to use to construct a value out of a string result.
+   */
+  parser?: ParserType | null
+  /**
+   * Block to execute in case of error.
+   *
+   */
+  fallback?: BlockType | null
+  /**
+   * The maximum number of times to retry when an error occurs within a block.
+   *
+   */
+  retry?: number | null
+  /**
+   * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+   *
+   */
+  trace_error_on_retry?: boolean | string | null
+  requirements?: RequirementsType20
+  /**
+   * Role associated to the block and sub-blocks.
+   * Typical roles are `system`, `user`, and `assistant`,
+   * but there may be other roles such as `available_tools`.
+   */
+  role?: string | null
+  /**
+   * Current context.
+   */
+  pdl__context?: ModelInput | null
+  /**
+   * Unique identifier for this block.
+   */
+  pdl__id?: string | null
   pdl__result?: unknown
   pdl__location?: PdlLocationType | null
+  /**
+   * Execution timing information.
+   */
   pdl__timing?: PdlTiming | null
-  pdl__is_leaf?: PdlIsLeaf
-  kind?: Kind
-}
-/**
- * Set of definitions executed before the execution of the block.
- *
- */
-export interface Defs20 {
-  [k: string]:
+  pdl__is_leaf?: PdlIsLeaf20
+  kind?: Kind20
+  msg: Msg
+  /**
+   * Block that raised the error.
+   *
+   */
+  program:
     | boolean
     | number
     | string
@@ -4805,6 +3499,7 @@ export interface Defs20 {
     | IfBlock
     | MatchBlock
     | RepeatBlock
+    | MapBlock
     | TextBlock
     | LastOfBlock
     | ArrayBlock
@@ -4813,72 +3508,31 @@ export interface Defs20 {
     | ReadBlock
     | IncludeBlock
     | ImportBlock
+    | AggregatorBlock
     | ErrorBlock
     | EmptyBlock
     | null
 }
 /**
- * Contribution of a specific value instead of the default one.
- */
-export interface ContributeValue {
-  value: Value
-}
-export interface LocalizedExpression {
-  pdl__expr: PdlExpr
-  pdl__result?: unknown
-  pdl__location?: PdlLocationType | null
-}
-export interface PdlExpr {
-  [k: string]: unknown
-}
-/**
- * Internal data structure to keep track of the source location information.
- */
-export interface PdlLocationType {
-  path: Path
-  file: File
-  table: Table
-}
-export interface Table {
-  [k: string]: number
-}
-/**
- * Use a PDL program as a parser specification (experimental).
+ * Set of definitions executed before the execution of the block.
+ *
  */
-export interface PdlParser {
-  description?: Description21
-  spec?:
-    | (
-        | "null"
-        | "boolean"
-        | "string"
-        | "number"
-        | "integer"
-        | "array"
-        | "object"
-        | "bool"
-        | "str"
-        | "float"
-        | "int"
-        | "list"
-        | "obj"
-      )
-    | EnumPdlType
-    | PdlTypeType[]
-    | OptionalPdlType
-    | JsonSchemaTypePdlType
-    | ObjectPdlType
-    | {
-        [k: string]: PdlTypeType
-      }
-    | null
-  pdl: Pdl
+export interface Defs21 {
+  [k: string]: BlockType
 }
 /**
- * A regular expression parser.
+ * Block without an action. It can contain definitions.
  */
-export interface RegexParser {
-  description?: Description22
+export interface EmptyBlock {
+  /**
+   * Documentation associated to the block.
+   *
+   */
+  description?: string | null
+  /**
+   * Type specification of the result of the block.
+   *
+   */
   spec?:
     | (
         | "null"
@@ -4904,24 +3558,69 @@ export interface RegexParser {
         [k: string]: PdlTypeType
       }
     | null
-  regex: Regex
-  mode?: Mode
+  defs?: Defs22
+  /**
+   * Name of the variable used to store the result of the execution of the block.
+   *
+   */
+  def?: string | null
+  contribute?: Contribute21
+  /**
+   * Parser to use to construct a value out of a string result.
+   */
+  parser?: ParserType | null
+  /**
+   * Block to execute in case of error.
+   *
+   */
+  fallback?: BlockType | null
+  /**
+   * The maximum number of times to retry when an error occurs within a block.
+   *
+   */
+  retry?: number | null
+  /**
+   * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
+   *
+   */
+  trace_error_on_retry?: boolean | string | null
+  requirements?: RequirementsType21
+  /**
+   * Role associated to the block and sub-blocks.
+   * Typical roles are `system`, `user`, and `assistant`,
+   * but there may be other roles such as `available_tools`.
+   */
+  role?: string | null
+  /**
+   * Current context.
+   */
+  pdl__context?: ModelInput | null
+  /**
+   * Unique identifier for this block.
+   */
+  pdl__id?: string | null
+  pdl__result?: unknown
+  pdl__location?: PdlLocationType | null
+  /**
+   * Execution timing information.
+   */
+  pdl__timing?: PdlTiming | null
+  pdl__is_leaf?: PdlIsLeaf21
+  kind?: Kind21
 }
 /**
- * Internal data structure to record timing information in the trace.
+ * Set of definitions executed before the execution of the block.
+ *
  */
-export interface PdlTiming {
-  start_nanos?: StartNanos
-  end_nanos?: EndNanos
-  first_use_nanos?: FirstUseNanos
-  timezone?: Timezone
+export interface Defs22 {
+  [k: string]: BlockType
 }
 /**
  * Join loop iterations as a string.
  */
 export interface JoinText {
   as?: As
-  with?: With
+  with?: With1
 }
 /**
  * Join loop iterations as an array.
@@ -4942,61 +3641,18 @@ export interface JoinLastOf {
   as: As3
 }
 /**
- * Case of a match.
- */
-export interface MatchCase {
-  case?: Case
-  if?: If
-  then: Then
-  pdl__case_result?: PdlCaseResult
-  pdl__if_result?: PdlIfResult
-  pdl__matched?: PdlMatched
-}
-/**
- * Match any of the patterns.
- */
-export interface OrPattern {
-  def?: Def12
-  anyOf: Anyof
-}
-/**
- * Match an array.
- */
-export interface ArrayPattern {
-  def?: Def13
-  array: Array1
-}
-/**
- * Match an object.
- */
-export interface ObjectPattern {
-  def?: Def14
-  object: Object2
-}
-export interface Object2 {
-  [k: string]:
-    | boolean
-    | number
-    | string
-    | OrPattern
-    | ArrayPattern
-    | ObjectPattern
-    | AnyPattern
-    | null
-}
-/**
- * Match any value.
+ * Join loop iterations as the value of the last iteration.
  */
-export interface AnyPattern {
-  def?: Def15
-  any: Any
+export interface JoinReduce {
+  as?: As4
+  reduce: Reduce
 }
 /**
  * Internal data structure to record token consumption usage information.
  */
 export interface PdlUsage {
-  completion_tokens?: CompletionTokens
-  prompt_tokens?: PromptTokens
+  completion_tokens?: number | null
+  prompt_tokens?: number | null
   [k: string]: unknown
 }
 /**
diff --git a/pdl-live-react/src/pdl_ast_utils.ts b/pdl-live-react/src/pdl_ast_utils.ts
index 7d57cd947..9cb36189d 100644
--- a/pdl-live-react/src/pdl_ast_utils.ts
+++ b/pdl-live-react/src/pdl_ast_utils.ts
@@ -45,9 +45,8 @@ export function map_block_children(
     )
     new_block = { ...new_block, contribute }
   }
-  // @ts-expect-error: TODO
   new_block = match(new_block)
-    // .with(P.string, s => s)
+    .with(P.union(P.nullish, P.boolean, P.number, P.string), (v) => v)
     .with({ kind: "empty" }, (block) => block)
     .with({ kind: "function" }, (block) => {
       const return_ = f_block(block.return)
@@ -179,6 +178,7 @@ export function map_block_children(
     })
     .with({ kind: "repeat" }, (block) => {
       const for_ = block?.for ? f_expr(block.for) : undefined
+      const while_ = block?.until ? f_expr(block.while) : undefined
       const until = block?.until ? f_expr(block.until) : undefined
       const max_iterations = block?.maxIterations
         ? f_expr(block.maxIterations)
@@ -187,11 +187,25 @@ export function map_block_children(
       return {
         ...block,
         for: for_,
+        while: while_,
         repeat,
         until,
         maxIterations: max_iterations,
       }
     })
+    .with({ kind: "map" }, (block) => {
+      const for_ = block?.for ? f_expr(block.for) : undefined
+      const max_iterations = block?.maxIterations
+        ? f_expr(block.maxIterations)
+        : undefined
+      const map = f_block(block.map)
+      return {
+        ...block,
+        for: for_,
+        map,
+        maxIterations: max_iterations,
+      }
+    })
     .with({ kind: "error" }, (block) => {
       const doc = f_block(block.program)
       return { ...block, program: doc }
@@ -202,7 +216,9 @@ export function map_block_children(
     })
     .with({ kind: "include" }, (block) => block)
     .with({ kind: "import" }, (block) => block)
-    .with({ kind: undefined }, (block) => block)
+    .with({ kind: "aggregator" }, (block) => block)
+    .with({ kind: P.nullish }, (block) => block)
+    // @ts-expect-error: TODO
     .exhaustive()
   match(new_block)
     .with({ parser: { pdl: P._ } }, (block) => {
@@ -289,11 +305,16 @@ export function iter_block_children(
     .with({ kind: "repeat" }, (block) => {
       f(block.repeat)
     })
+    .with({ kind: "map" }, (block) => {
+      f(block.map)
+    })
     .with({ kind: "error" }, (block) => f(block.program))
     .with({ kind: "read" }, () => {})
     .with({ kind: "include" }, () => {})
     .with({ kind: "import" }, () => {})
+    .with({ kind: "aggregator" }, () => {})
     .with({ kind: undefined }, () => {})
+    // @ts-expect-error: TODO
     .exhaustive()
   match(block)
     .with({ parser: { pdl: P._ } }, (block) => {
diff --git a/pdl-live-react/src/view/detail/find.ts b/pdl-live-react/src/view/detail/find.ts
index 6ee1b38bd..0246f58da 100644
--- a/pdl-live-react/src/view/detail/find.ts
+++ b/pdl-live-react/src/view/detail/find.ts
@@ -3,6 +3,7 @@ import { childrenOf } from "../timeline/model"
 import {
   isNonScalarPdlBlock,
   nonNullable,
+  PdlBlock,
   type NonScalarPdlBlock as Block,
 } from "../../helpers"
 
@@ -21,7 +22,7 @@ export default function find(
   } else {
     return (
       childrenOf(block)
-        .map((child) => find(child, id))
+        .map((child: PdlBlock) => find(child, id))
         .filter(nonNullable)[0] || null
     )
   }
diff --git a/pdl-live-react/src/view/timeline/model.ts b/pdl-live-react/src/view/timeline/model.ts
index c384c3e70..41b762cd0 100644
--- a/pdl-live-react/src/view/timeline/model.ts
+++ b/pdl-live-react/src/view/timeline/model.ts
@@ -102,14 +102,15 @@ function computeModelIter(
 
   const childrenModel = childrenOf(block)
     .filter(nonNullable)
-    .flatMap((child) => computeModelIter(child, root))
+    .flatMap((child: PdlBlock) => computeModelIter(child, root))
 
   // Correct for anomalies in the trace where a child may have an
   // earlier end timestamp than its children. See
   // https://github.com/IBM/prompt-declaration-language/pull/683
   if (root) {
     const maxEnd = childrenModel.reduce(
-      (maxEnd, child) => Math.max(maxEnd, child.block.pdl__timing.end_nanos),
+      (maxEnd: number, child: TimelineRow) =>
+        Math.max(maxEnd, child.block.pdl__timing.end_nanos),
       0,
     )
     root.block.pdl__timing.end_nanos = Math.max(
@@ -122,35 +123,42 @@ function computeModelIter(
 }
 
 export function childrenOf(block: NonScalarPdlBlock) {
-  return match(block)
-    .with({ kind: "model" }, (data) => [/*data.input,*/ data.pdl__result])
-    .with({ kind: "code" }, (data) => [data.pdl__result])
-    .with({ kind: "get" }, (data) => [data.pdl__result])
-    .with({ kind: "data" }, (data) => [data.pdl__result])
-    .with({ kind: "if", if: { pdl__result: P._ } }, (data) =>
-      data.if.pdl__result ? [data.then] : [data.else],
-    )
-    .with({ kind: "if" }, (data) => [data.then, data.else])
-    .with({ kind: "match" }, (data) => [data.with]) // TODO
-    .with({ kind: "read" }, (data) => [data.pdl__result])
-    .with({ kind: "include" }, (data) => [data.pdl__trace ?? data.pdl__result])
-    .with({ kind: "import" }, (data) => [data.pdl__trace ?? data.pdl__result])
-    .with({ kind: "function" }, () => [])
-    .with({ kind: "call" }, (data) => [data.pdl__trace ?? data.pdl__result])
-    .with({ kind: "text" }, (data) => [data.text])
-    .with({ kind: "lastOf" }, (data) => [data.lastOf])
-    .with({ kind: "array" }, (data) => [data.array])
-    .with({ kind: "object" }, (data) => [data.object])
-    .with({ kind: "message" }, (data) => [data.content])
-    .with({ kind: "repeat" }, (data) => [data.pdl__trace ?? data.repeat])
-    .with({ kind: "empty" }, (data) =>
-      data.defs ? Object.values(data.defs) : [],
-    )
-    .with({ kind: "error" }, () => []) // TODO show errors in trace
-    .with({ kind: undefined }, () => [])
-    .exhaustive()
-    .flat()
-    .filter(nonNullable)
+  return (
+    match(block)
+      .with({ kind: "model" }, (data) => [/*data.input,*/ data.pdl__result])
+      .with({ kind: "code" }, (data) => [data.pdl__result])
+      .with({ kind: "get" }, (data) => [data.pdl__result])
+      .with({ kind: "data" }, (data) => [data.pdl__result])
+      .with({ kind: "if", if: { pdl__result: P._ } }, (data) =>
+        data.if.pdl__result ? [data.then] : [data.else],
+      )
+      .with({ kind: "if" }, (data) => [data.then, data.else])
+      .with({ kind: "match" }, (data) => [data.with]) // TODO
+      .with({ kind: "read" }, (data) => [data.pdl__result])
+      .with({ kind: "include" }, (data) => [
+        data.pdl__trace ?? data.pdl__result,
+      ])
+      .with({ kind: "import" }, (data) => [data.pdl__trace ?? data.pdl__result])
+      .with({ kind: "aggregator" }, () => [])
+      .with({ kind: "function" }, () => [])
+      .with({ kind: "call" }, (data) => [data.pdl__trace ?? data.pdl__result])
+      .with({ kind: "text" }, (data) => [data.text])
+      .with({ kind: "lastOf" }, (data) => [data.lastOf])
+      .with({ kind: "array" }, (data) => [data.array])
+      .with({ kind: "object" }, (data) => [data.object])
+      .with({ kind: "message" }, (data) => [data.content])
+      .with({ kind: "repeat" }, (data) => [data.pdl__trace ?? data.repeat])
+      .with({ kind: "map" }, (data) => [data.pdl__trace ?? data.map])
+      .with({ kind: "empty" }, (data) =>
+        data.defs ? Object.values(data.defs) : [],
+      )
+      .with({ kind: "error" }, () => []) // TODO show errors in trace
+      .with({ kind: P.nullish }, () => [])
+      // @ts-expect-error: TODO
+      .exhaustive()
+      .flat()
+      .filter(nonNullable)
+  )
 }
 
 function positionOf(row: TimelineRow): Position {
diff --git a/pyproject.toml b/pyproject.toml
index 3350229a5..242216fde 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -17,7 +17,7 @@ dependencies = [
   "termcolor>=2,<4",
   "ipython>=8,<10",
   "json-repair~=0.35",
-  "granite-io>=0.2,<0.5",
+  "granite-io>=0.5,<0.6",
 ]
 authors = [
   { name="Mandana Vaziri", email="mvaziri@us.ibm.com" },
@@ -44,13 +44,15 @@ examples = [
   "pymilvus~=2.5",
   "langchain~=0.3",
   "langchain-community~=0.3",
-  "pypdf~=5.2",
+  "pypdf~=6.0",
   "wikipedia~=1.0",
   "textdistance~=4.0",
-  "datasets>2,<4",
+  "datasets>3,<5",
   "sympy~=1.0",
   "scikit-learn>=1.6.1,<1.8.0",
-  "faiss-cpu>=1.10,<1.12"
+  "faiss-cpu>=1.12,<1.13",
+  "funcy>=2",
+  "evalplus>=0.3.1",
 ]
 docs = [
   "mkdocs~=1.0",
@@ -76,6 +78,7 @@ Issues = "https://github.com/IBM/prompt-declaration-language/issues"
 [project.scripts]
 pdl = "pdl.pdl:main"
 pdl-lint = "pdl.pdl_linter:run_linter"
+pdl-optimize = "pdl.optimize.pdl_optimizer:run_optimizer"
 
 [tool.setuptools_scm]
 version_file = "src/pdl/_version.py"
@@ -84,7 +87,7 @@ version_file = "src/pdl/_version.py"
 where = ["src"]
 
 [tool.setuptools.package-data]
-pdl = ["pdl-schema.json"]
+pdl = ["pdl-schema.json", "pdl_stlib.pdl"]
 
 [tool.pyright]
 include = ["src", "tests", "examples", "docs"]
diff --git a/renovate.json b/renovate.json
new file mode 100644
index 000000000..5db72dd6a
--- /dev/null
+++ b/renovate.json
@@ -0,0 +1,6 @@
+{
+  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
+  "extends": [
+    "config:recommended"
+  ]
+}
diff --git a/src/pdl/optimize/config_parser.py b/src/pdl/optimize/config_parser.py
index 27b85510b..ec449ee1c 100644
--- a/src/pdl/optimize/config_parser.py
+++ b/src/pdl/optimize/config_parser.py
@@ -3,11 +3,28 @@
 from pydantic import BaseModel, Field
 
 
+class JsonlDataset(BaseModel):
+    train: str = Field(..., description="Path to the training dataset in JSONL format")
+    test: str = Field(..., description="Path to the test dataset in JSONL format")
+    validation: str = Field(
+        ..., description="Path to the validation dataset in JSONL format"
+    )
+
+
 class OptimizationConfig(BaseModel):
-    benchmark: str = Field()
+    pdl_path: str = Field(..., description="Path to the PDL file to optimize")
+    dataset: str | JsonlDataset = Field()
+    demonstrations_variable_name: str = Field(default="demonstrations")
+    demonstration_columns: list[str] = Field()
+    instance_columns: list[str] = Field()
+    groundtruth_column: str | None = Field()
+    eval_pdl: str | None = Field(
+        default=None, description="Path to the PDL file used for evaluation"
+    )
     num_candidates: int = Field(default=30)
-    num_demonstrations: int = Field(default=5)
-    initial_test_set_size: int = Field(default=10)
+    num_demonstrations: int | None = Field(default=None)
+    initial_validation_set_size: int = Field(default=10)
+    max_validation_set_size: int = Field(default=1000)
     max_test_set_size: int = Field(default=1000)
     timeout: int = Field(default=120)
     budget_growth: Literal["double", "to_max"] = Field(default="double")
@@ -17,7 +34,6 @@ class OptimizationConfig(BaseModel):
     train_set_name: str = Field(default="train")
     test_set_name: str = Field(default="test")
     validation_set_name: str = Field(default="validation")
-    demonstrations_variable_name: str = Field(default="demonstrations")
     variables: dict[str, list] = Field(default={})
     experiment_prefix: str = Field(default="")
 
diff --git a/src/pdl/optimize/optimizer_evaluator.py b/src/pdl/optimize/optimizer_evaluator.py
index 4e809c848..5898087e7 100644
--- a/src/pdl/optimize/optimizer_evaluator.py
+++ b/src/pdl/optimize/optimizer_evaluator.py
@@ -45,10 +45,7 @@ def __init__(
     def get_scope(self) -> ScopeType:
         raise NotImplementedError
 
-    def extract_answer(self, document: str) -> Any:
-        raise NotImplementedError
-
-    def answer_correct(self, document: str, answer: Any, truth: Any) -> bool:
+    def score(self, document: str, ground_truth: Any) -> float:
         raise NotImplementedError
 
     def run(  # type: ignore # noqa: C901
@@ -58,7 +55,6 @@ def run(  # type: ignore # noqa: C901
         answer = None
         exception: PDLParseError | PDLRuntimeError | Exception | bool | None = None
         result = None
-        match = False
         truth = self.example[self.answer_key]
         scope: PdlDict = PdlDict({})
 
@@ -68,6 +64,7 @@ def run(  # type: ignore # noqa: C901
         end_time = None
         total_tokens = -1
         errored = False
+        score = 0.0
         while retry:
             if tries > 1:
                 console.log("RETRYING! ", tries)
@@ -93,6 +90,12 @@ def run(  # type: ignore # noqa: C901
 
                 if isinstance(document, str):
                     document = document.strip()
+                    if document:
+                        errored = False
+                        retry = False
+                    else:
+                        console.log("Empty document returned, retrying...")
+                    answer = document
                 else:
                     raise TypeError(
                         f"Expected document to be a string, got {type(document)}",
@@ -102,24 +105,10 @@ def run(  # type: ignore # noqa: C901
                 runtime = end_time - start_time
                 console.log(f"Runtime took seconds: {runtime:.2f}")
 
-                errored = False
-                if errored:
-                    console.log("PDL error occured.")
-                else:
-                    answer = self.extract_answer(document)
-
-                    if answer is None:
-                        last_line = document.splitlines()[-1]
-                        console.log("Couldn't extract answer: ", last_line)
-
-                if answer is None or errored:
-                    retry = True
-
-                if answer is not None and not errored:
-                    retry = False
-
                 if tries >= RETRY_COUNT:
                     retry = False
+
+                score = float(self.score(document, truth))
             except PDLParseError as exc:
                 console.print_exception(show_locals=False)
                 errored = True
@@ -160,11 +149,9 @@ def run(  # type: ignore # noqa: C901
         if errored and not exception:
             exception = errored
 
-        match = self.answer_correct(document, answer, truth)
-
         return TrialOutput(
             pdl_program=self.pdl_program,
-            correct=match,
+            score=score,
             exception=exception,
             scope=scope,
             pdl_result=result,
diff --git a/src/pdl/optimize/pdl_evaluator.py b/src/pdl/optimize/pdl_evaluator.py
new file mode 100644
index 000000000..f1f9eeeb3
--- /dev/null
+++ b/src/pdl/optimize/pdl_evaluator.py
@@ -0,0 +1,57 @@
+from typing import Any
+
+from pdl.optimize.optimizer_evaluator import OptimizerEvaluator
+from pdl.pdl import exec_str
+from pdl.pdl_ast import ScopeType
+from pdl.pdl_interpreter import empty_scope
+
+
+class PdlEvaluator(OptimizerEvaluator):
+    def __init__(
+        self,
+        # scoring_pdl: str,
+        *args,
+        **kwargs,
+    ) -> None:
+        super().__init__(*args, **kwargs)
+        self.scoring_pdl = self.config.eval_pdl
+        if self.config.groundtruth_column is None:
+            raise ValueError("Groundtruth column must be specified")
+        self.answer_key = self.config.groundtruth_column
+
+    def get_scope(self) -> ScopeType:
+        demo_var = self.config.demonstrations_variable_name
+
+        scope = {}
+
+        for k in self.config.variables:
+            if k in self.candidate:
+                scope[k] = self.candidate[k]
+
+        scope[demo_var] = [
+            {k: q[k] for k in self.config.demonstration_columns}
+            for q in self.candidate[demo_var]
+        ]
+
+        for k in self.config.instance_columns:
+            if k in self.example:
+                scope[k] = self.example[k]
+
+        return empty_scope | scope
+
+    def score(self, document: str, ground_truth: Any) -> float:
+        scope = empty_scope | {"document": document, "ground_truth": ground_truth}
+        prog = f"""defs:
+  scoring:
+    import: "{self.scoring_pdl}"
+lastOf:
+  - call: ${{ scoring.score }}
+    args:
+        document: ${{ document }}
+        ground_truth: ${{ ground_truth }}"""
+        result = exec_str(prog=prog, scope=scope, output="result")
+
+        if isinstance(result, str):
+            result = result.strip()
+        # Note: this breaks if the result is not a number
+        return float(result)
diff --git a/src/pdl/optimize/pdl_optimizer.py b/src/pdl/optimize/pdl_optimizer.py
index aa6316d53..f031bbad8 100644
--- a/src/pdl/optimize/pdl_optimizer.py
+++ b/src/pdl/optimize/pdl_optimizer.py
@@ -1,3 +1,4 @@
+import argparse
 import itertools
 import json
 import logging
@@ -11,7 +12,9 @@
 from typing import Any
 
 import yaml
-from datasets import Dataset, DatasetDict
+from datasets import load_dataset
+from datasets.arrow_dataset import Dataset
+from datasets.dataset_dict import DatasetDict
 from duration_parser import parse as parse_duration
 from numpy.random import default_rng
 from rich.logging import RichHandler
@@ -19,8 +22,9 @@
 from tqdm import TqdmExperimentalWarning
 from tqdm.rich import tqdm
 
-from pdl.optimize.config_parser import OptimizationConfig
+from pdl.optimize.config_parser import JsonlDataset, OptimizationConfig
 from pdl.optimize.optimizer_evaluator import OptimizerEvaluator
+from pdl.optimize.pdl_evaluator import PdlEvaluator
 from pdl.optimize.util import CandidateResult, TrialOutput, console, execute_threads
 from pdl.pdl_ast import AdvancedBlockType, DataBlock, Program
 from pdl.pdl_dumper import dump_program_exclude_internals
@@ -67,22 +71,22 @@ class PDLOptimizer:
     # pylint: disable=too-many-instance-attributes,too-many-arguments,too-many-positional-arguments
     def __init__(
         self,
-        pdl_path: Path,
         dataset: DatasetDict,
         config: OptimizationConfig,
         trial_thread: type[OptimizerEvaluator],
         yield_output: bool,
         experiment_path: Path,
     ) -> None:
-        self.pdl_path = pdl_path
         self.trial_thread = trial_thread
         self.yield_output = yield_output
 
         self.config = config
+        self.pdl_path = Path(config.pdl_path)
         self.parallelism = config.parallelism
         self.num_demonstrations = config.num_demonstrations
-        self.starting_validation_set_size = config.initial_test_set_size
-        self.ending_test_set_size = config.max_test_set_size
+        self.starting_validation_set_size = config.initial_validation_set_size
+        self.ending_validation_set_size = config.max_validation_set_size
+        self.max_test_set_size = config.max_test_set_size
         self.max_candidates = config.num_candidates
         self.timeout = config.timeout
         self.budget_growth = config.budget_growth
@@ -159,10 +163,13 @@ def sample_candidates(
         demo_name = self.config.demonstrations_variable_name
         candidates = []
 
+        num_demonstrations_set = {
+            int(x) for x in self.config.variables.get("num_demonstrations", set())
+        }
+
         if (
-            "prompt_pattern" in self.config.variables
-            and "cot" in self.config.variables.get("prompt_pattern", [])
-            and 0 in self.config.variables.get("num_demonstrations", [])
+            "cot" in self.config.variables.get("prompt_pattern", [])
+            and 0 in num_demonstrations_set
         ):
             cot_candidate = {
                 k: self.sample_random_index(v) for k, v in self.config.variables.items()
@@ -178,18 +185,18 @@ def sample_candidates(
 
             candidates.append(cot_candidate)
 
-        zero_shots_seen = ["cot"]
+        zero_shots_seen = {"cot"}
         while len(candidates) < num_candidates:
             variable_instance = {
                 k: self.sample_random_index(v) for k, v in self.config.variables.items()
             }
             if (
                 variable_instance.get("num_demonstrations") == 0
-                and variable_instance.get("prompt_pattern") == "cot"
+                and variable_instance.get("prompt_pattern") is not None
             ):
                 if variable_instance["prompt_pattern"] in zero_shots_seen:
                     continue
-                zero_shots_seen.append(variable_instance["prompt_pattern"])
+                zero_shots_seen.add(variable_instance["prompt_pattern"])
 
             num_demonstrations = int(
                 variable_instance.get("num_demonstrations", self.num_demonstrations),
@@ -214,16 +221,26 @@ def sample_candidates(
             candidates.append(candidate)
 
         if (
-            "num_demonstrations"
-            in self.config.variables  # check if is variable in config
-            and len(self.config.variables["num_demonstrations"])
-            > 1  # check more than 1 option
-            and 0 in [int(x) for x in self.config.variables["num_demonstrations"]]
-            # check zeroshot is an option
+            len(num_demonstrations_set) > 1  # check more than 1 option
+            and 0 in num_demonstrations_set  # check zeroshot is an option
         ):
-            zero_shotters = [x for x in candidates if x["num_demonstrations"] == 0]
+            zero_shotters = [
+                x.get("uuid") for x in candidates if x.get("num_demonstrations") == 0
+            ]
+            variables_zs = self.config.variables.copy()
+            variables_zs.pop("num_demonstrations", None)
+
+            max_zs = len(list(itertools.product(*variables_zs.values())))
+
+            if len(zero_shotters) > max_zs:
+                logger.warning(
+                    "More zero-shot candidates (%d) than expected (%d; "
+                    "product of all variables). "
+                    "Identical duplicated candidates may waste compute.",
+                    len(zero_shotters),
+                    max_zs,
+                )
 
-            assert len(zero_shotters) <= 3
         assert len(candidates) == num_candidates
         return candidates
 
@@ -240,7 +257,10 @@ def save_experiment(self):
         exp_file = self.experiment_path / f"{self.experiment_uuid}.json"
 
         with exp_file.open("w") as f:
-            json.dump(self.experiment_log, f)
+            try:
+                json.dump(self.experiment_log, f)
+            except TypeError:
+                logger.warning("Unable to save experiment")  # TODO
 
         return exp_file
 
@@ -276,7 +296,7 @@ def run(self) -> dict[str, Any]:
             self.starting_validation_set_size,
             validation_set_size,
         )
-        ending_validation_set_size = self.ending_test_set_size
+        ending_validation_set_size = self.ending_validation_set_size
         num_iterations = ceil(log2(num_candidates))
 
         validation_set_multiplier = 0
@@ -477,7 +497,7 @@ def run(self) -> dict[str, Any]:
             # reset_usage_stats()
 
             range_end = min(
-                ending_validation_set_size,
+                self.max_test_set_size,
                 len(self.dataset[self.test_set_name]),
             )
             eval_set_indices = list(range(range_end))
@@ -502,7 +522,7 @@ def run(self) -> dict[str, Any]:
             self.pbar.close()
 
             self.experiment_log["final_iteration"] = {
-                "ending_test_set_size": ending_validation_set_size,
+                "ending_test_set_size": range_end,
                 "eval_set_indices": eval_set_indices,
                 "selected_candidates_uuid": winning_candidate["uuid"],
                 "candidate": final_score.to_dict(),
@@ -615,7 +635,7 @@ def evaluate(
                 ),
             )
 
-        matches = 0
+        score = 0
         exception_count = 0
         timeout_count = 0
         exceptions: list[BaseException | bool] = []
@@ -645,10 +665,10 @@ def evaluate(
                     answer = result.answer
 
                 logger.info(
-                    "Answer: %s Ground truth: %s Match: %s",
+                    "Answer: %s Ground truth: %s Score: %s",
                     answer,
                     result.groundtruth,
-                    result.correct,
+                    result.score,
                 )
 
                 if candidate["uuid"] not in self.candidate_results:
@@ -667,16 +687,16 @@ def evaluate(
                 if trial_result.exception is not None:
                     exceptions.append(trial_result.exception)
 
-                matches += int(trial_result.correct)
+                score += float(trial_result.score)
 
-                p_passing = matches / (index + 1)
+                p_passing = score / (index + 1)
 
         end_time = time.time()
         runtime = end_time - start_time
 
         logger.info(
             "Matches: %s Accuracy: %.2f Exceptions: %s (%s timeout, %s other) Total: %s",
-            f"{matches:,}",
+            f"{score:,}",
             p_passing * 100,
             f"{len(exceptions):,}",
             timeout_count,
@@ -695,7 +715,9 @@ def evaluate(
         )
 
     def benchmark(self, test_set_size: int, candidate: dict | None = None):
-        if self.num_demonstrations <= 0:
+        if self.num_demonstrations is None:
+            demo_size = 0
+        elif self.num_demonstrations <= 0:
             demo_size = len(self.dataset[self.train_set_name])
         else:
             demo_size = self.num_demonstrations
@@ -744,3 +766,74 @@ def benchmark(self, test_set_size: int, candidate: dict | None = None):
         self.pbar.close()
         logger.info("Score: %.4f%%", scores[0].metric * 100)
         logger.info("Saved exp. log to %s", exp_file)
+
+
+def run_optimizer() -> int:
+    parser = argparse.ArgumentParser("")
+
+    parser.add_argument(
+        "--config",
+        "-c",
+        help="Optimizer config file",
+        type=Path,
+        required=True,
+    )
+
+    parser.add_argument(
+        "--experiments-path",
+        help="Path where experiment results will be saved",
+        type=Path,
+        default=Path("experiments"),
+    )
+
+    parser.add_argument(
+        "--yield_output",
+        action=argparse.BooleanOptionalAction,
+        default=False,
+    )
+
+    args = parser.parse_args()
+
+    if not args.config.exists():
+        print("Config file doesn't exist:", args.config)
+        sys.exit(1)
+
+    config_text = args.config.read_text()
+
+    try:
+        config_dict = yaml.safe_load(config_text)
+        config = OptimizationConfig(**config_dict)
+    except Exception:
+        print("Couldn't load config:", args.config)
+        sys.exit(1)
+
+    if not Path(config.pdl_path).exists():
+        print("PDL file doesn't exist:", config.pdl_path)
+        sys.exit(1)
+
+    # Set up dataset and trial thread based on benchmark
+    dataset: Any
+
+    if isinstance(config.dataset, (dict, JsonlDataset)):
+        dataset = load_dataset(
+            "json",
+            data_files={
+                "train": config.dataset.train,
+                "validation": config.dataset.validation,
+                "test": config.dataset.test,
+            },
+        )
+    else:
+        print(f"Unknown dataset: {config.dataset}")
+        sys.exit(1)
+
+    # Create optimizer instance
+    optimizer = PDLOptimizer(
+        dataset=dataset,
+        trial_thread=PdlEvaluator,
+        yield_output=args.yield_output,
+        experiment_path=args.experiments_path,
+        config=config,
+    )
+    optimizer.run()
+    return 0
diff --git a/src/pdl/optimize/util.py b/src/pdl/optimize/util.py
index 9925f8e0e..d331f49d1 100644
--- a/src/pdl/optimize/util.py
+++ b/src/pdl/optimize/util.py
@@ -4,7 +4,7 @@
 from typing import Any
 
 import yaml
-from datasets import Dataset
+from datasets.arrow_dataset import Dataset
 from rich.console import Console
 
 from pdl.pdl_ast import Program, ScopeType
@@ -20,7 +20,7 @@ class TrialOutput:
     pdl_program: Program
     scope: ScopeType
     runtime: float
-    correct: bool = False
+    score: float = 0.0
     exception: BaseException | bool | None = None
     pdl_result: Any = None
     pdl_document: str = ""
@@ -32,7 +32,7 @@ class TrialOutput:
 
     def to_dict(self) -> dict:
         return {
-            "correct": self.correct,
+            "score": self.score,
             "exception": str(self.exception),
             "pdl_document": self.pdl_document,
             "answer": self.answer,
diff --git a/src/pdl/pdl-schema.json b/src/pdl/pdl-schema.json
index 17a6c3f60..aa12df222 100644
--- a/src/pdl/pdl-schema.json
+++ b/src/pdl/pdl-schema.json
@@ -1,20 +1,137 @@
 {
   "$defs": {
-    "AnyPattern": {
+    "AggregatorBlock": {
       "additionalProperties": false,
-      "description": "Match any value.",
+      "description": "Create a new aggregator that can be use in the `contribute` field.",
       "properties": {
+        "description": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": null,
+          "description": "Documentation associated to the block.\n    "
+        },
+        "spec": {
+          "$ref": "#/$defs/PdlTypeType",
+          "default": null,
+          "description": "Type specification of the result of the block.\n    "
+        },
+        "defs": {
+          "additionalProperties": {
+            "$ref": "#/$defs/BlockType"
+          },
+          "default": {},
+          "description": "Set of definitions executed before the execution of the block.\n    ",
+          "title": "Defs",
+          "type": "object"
+        },
         "def": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": null,
+          "description": "Name of the variable used to store the result of the execution of the block.\n    "
+        },
+        "contribute": {
+          "default": [
+            "result",
+            "context"
+          ],
+          "description": "Indicate if the block contributes to the result and background context.\n    ",
+          "items": {
+            "$ref": "#/$defs/ContributeElement"
+          },
+          "title": "Contribute",
+          "type": "array"
+        },
+        "parser": {
+          "$ref": "#/$defs/OptionalParserType",
+          "default": null,
+          "description": "Parser to use to construct a value out of a string result."
+        },
+        "fallback": {
+          "$ref": "#/$defs/OptionalBlockType",
+          "default": null,
+          "description": "Block to execute in case of error.\n    "
+        },
+        "retry": {
+          "$ref": "#/$defs/OptionalInt",
+          "default": null,
+          "description": "The maximum number of times to retry when an error occurs within a block.\n    "
+        },
+        "trace_error_on_retry": {
+          "$ref": "#/$defs/OptionalBoolOrStr",
+          "default": null,
+          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    "
+        },
+        "requirements": {
+          "$ref": "#/$defs/RequirementsType",
+          "default": [],
+          "description": "Specify any requirements that the result of the block must satisfy.\n    "
+        },
+        "role": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": null,
+          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`."
+        },
+        "pdl__context": {
+          "$ref": "#/$defs/OptionalModelInput",
+          "default": [],
+          "description": "Current context."
+        },
+        "pdl__id": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": "",
+          "description": "Unique identifier for this block."
+        },
+        "pdl__result": {
+          "$ref": "#/$defs/OptionalAny",
+          "default": null,
+          "description": "Result of the execution of the block."
+        },
+        "pdl__location": {
+          "$ref": "#/$defs/OptionalPdlLocationType",
+          "default": null
+        },
+        "pdl__timing": {
+          "$ref": "#/$defs/OptionalPdlTiming",
+          "default": null,
+          "description": "Execution timing information."
+        },
+        "pdl__is_leaf": {
+          "const": true,
+          "default": true,
+          "title": "Pdl  Is Leaf",
+          "type": "boolean"
+        },
+        "kind": {
+          "const": "aggregator",
+          "default": "aggregator",
+          "title": "Kind",
+          "type": "string"
+        },
+        "aggregator": {
           "anyOf": [
             {
+              "const": "context",
               "type": "string"
             },
             {
-              "type": "null"
+              "$ref": "#/$defs/FileAggregatorConfig"
             }
           ],
-          "default": null,
-          "title": "Def"
+          "title": "Aggregator"
+        }
+      },
+      "required": [
+        "aggregator"
+      ],
+      "title": "AggregatorBlock",
+      "type": "object"
+    },
+    "AnyPattern": {
+      "additionalProperties": false,
+      "description": "Match any value.",
+      "properties": {
+        "def": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": null
         },
         "any": {
           "const": null,
@@ -33,17 +150,9 @@
       "description": "Execute a command line, which will spawn a subprocess with the given argument vector. Note: if you need a shell script execution, you must wrap your command line in /bin/sh or some shell of your choosing.\n\nExample:\n```PDL\nargs:\n- /bin/sh\n- \"-c\"\n- \"if [[ $x = 1 ]]; then echo y; else echo n; fi\"\n```",
       "properties": {
         "description": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Documentation associated to the block.\n    ",
-          "title": "Description"
+          "description": "Documentation associated to the block.\n    "
         },
         "spec": {
           "$ref": "#/$defs/PdlTypeType",
@@ -52,86 +161,7 @@
         },
         "defs": {
           "additionalProperties": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/FunctionBlock"
-              },
-              {
-                "$ref": "#/$defs/CallBlock"
-              },
-              {
-                "$ref": "#/$defs/LitellmModelBlock"
-              },
-              {
-                "$ref": "#/$defs/GraniteioModelBlock"
-              },
-              {
-                "$ref": "#/$defs/CodeBlock"
-              },
-              {
-                "$ref": "#/$defs/ArgsBlock"
-              },
-              {
-                "$ref": "#/$defs/GetBlock"
-              },
-              {
-                "$ref": "#/$defs/DataBlock"
-              },
-              {
-                "$ref": "#/$defs/IfBlock"
-              },
-              {
-                "$ref": "#/$defs/MatchBlock"
-              },
-              {
-                "$ref": "#/$defs/RepeatBlock"
-              },
-              {
-                "$ref": "#/$defs/TextBlock"
-              },
-              {
-                "$ref": "#/$defs/LastOfBlock"
-              },
-              {
-                "$ref": "#/$defs/ArrayBlock"
-              },
-              {
-                "$ref": "#/$defs/ObjectBlock"
-              },
-              {
-                "$ref": "#/$defs/MessageBlock"
-              },
-              {
-                "$ref": "#/$defs/ReadBlock"
-              },
-              {
-                "$ref": "#/$defs/IncludeBlock"
-              },
-              {
-                "$ref": "#/$defs/ImportBlock"
-              },
-              {
-                "$ref": "#/$defs/ErrorBlock"
-              },
-              {
-                "$ref": "#/$defs/EmptyBlock"
-              },
-              {
-                "type": "null"
-              }
-            ]
+            "$ref": "#/$defs/BlockType"
           },
           "default": {},
           "description": "Set of definitions executed before the execution of the block.\n    ",
@@ -139,17 +169,9 @@
           "type": "object"
         },
         "def": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Name of the variable used to store the result of the execution of the block.\n    ",
-          "title": "Def"
+          "description": "Name of the variable used to store the result of the execution of the block.\n    "
         },
         "contribute": {
           "default": [
@@ -158,234 +180,64 @@
           ],
           "description": "Indicate if the block contributes to the result and background context.\n    ",
           "items": {
-            "anyOf": [
-              {
-                "$ref": "#/$defs/ContributeTarget"
-              },
-              {
-                "additionalProperties": {
-                  "$ref": "#/$defs/ContributeValue"
-                },
-                "type": "object"
-              }
-            ]
+            "$ref": "#/$defs/ContributeElement"
           },
           "title": "Contribute",
           "type": "array"
         },
         "parser": {
-          "anyOf": [
-            {
-              "enum": [
-                "json",
-                "jsonl",
-                "yaml"
-              ],
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/PdlParser"
-            },
-            {
-              "$ref": "#/$defs/RegexParser"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalParserType",
           "default": null,
-          "description": "Parser to use to construct a value out of a string result.",
-          "title": "Parser"
+          "description": "Parser to use to construct a value out of a string result."
         },
         "fallback": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBlockType",
           "default": null,
-          "description": "Block to execute in case of error.\n    ",
-          "title": "Fallback"
+          "description": "Block to execute in case of error.\n    "
         },
         "retry": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalInt",
           "default": null,
-          "description": "The maximum number of times to retry when an error occurs within a block.\n    ",
-          "title": "Retry"
+          "description": "The maximum number of times to retry when an error occurs within a block.\n    "
         },
         "trace_error_on_retry": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBoolOrStr",
           "default": null,
-          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    ",
-          "title": "Trace Error On Retry"
+          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    "
+        },
+        "requirements": {
+          "$ref": "#/$defs/RequirementsType",
+          "default": [],
+          "description": "Specify any requirements that the result of the block must satisfy.\n    "
         },
         "role": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.",
-          "title": "Role"
+          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`."
         },
         "pdl__context": {
-          "anyOf": [
-            {
-              "items": {
-                "additionalProperties": true,
-                "type": "object"
-              },
-              "type": "array"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalModelInput",
           "default": [],
-          "description": "Current context\n    ",
-          "title": "Pdl  Context"
+          "description": "Current context."
         },
         "pdl__id": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": "",
-          "description": "Unique identifier for this block\n    ",
-          "title": "Pdl  Id"
+          "description": "Unique identifier for this block."
         },
         "pdl__result": {
-          "anyOf": [
-            {},
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalAny",
           "default": null,
-          "description": "Result of the execution of the block",
-          "title": "Pdl  Result"
+          "description": "Result of the execution of the block."
         },
         "pdl__location": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlLocationType"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalPdlLocationType",
           "default": null
         },
         "pdl__timing": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlTiming"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null
+          "$ref": "#/$defs/OptionalPdlTiming",
+          "default": null,
+          "description": "Execution timing information."
         },
         "pdl__is_leaf": {
           "const": true,
@@ -408,14 +260,7 @@
         "args": {
           "description": "The argument vector to spawn.\n    ",
           "items": {
-            "anyOf": [
-              {
-                "$ref": "#/$defs/LocalizedExpression_TypeVar_"
-              },
-              {
-                "type": "string"
-              }
-            ]
+            "$ref": "#/$defs/ExpressionStr"
           },
           "title": "Args",
           "type": "array"
@@ -432,17 +277,9 @@
       "description": "Return the array of values computed by each block of the list of blocks.",
       "properties": {
         "description": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Documentation associated to the block.\n    ",
-          "title": "Description"
+          "description": "Documentation associated to the block.\n    "
         },
         "spec": {
           "$ref": "#/$defs/PdlTypeType",
@@ -451,86 +288,7 @@
         },
         "defs": {
           "additionalProperties": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/FunctionBlock"
-              },
-              {
-                "$ref": "#/$defs/CallBlock"
-              },
-              {
-                "$ref": "#/$defs/LitellmModelBlock"
-              },
-              {
-                "$ref": "#/$defs/GraniteioModelBlock"
-              },
-              {
-                "$ref": "#/$defs/CodeBlock"
-              },
-              {
-                "$ref": "#/$defs/ArgsBlock"
-              },
-              {
-                "$ref": "#/$defs/GetBlock"
-              },
-              {
-                "$ref": "#/$defs/DataBlock"
-              },
-              {
-                "$ref": "#/$defs/IfBlock"
-              },
-              {
-                "$ref": "#/$defs/MatchBlock"
-              },
-              {
-                "$ref": "#/$defs/RepeatBlock"
-              },
-              {
-                "$ref": "#/$defs/TextBlock"
-              },
-              {
-                "$ref": "#/$defs/LastOfBlock"
-              },
-              {
-                "$ref": "#/$defs/ArrayBlock"
-              },
-              {
-                "$ref": "#/$defs/ObjectBlock"
-              },
-              {
-                "$ref": "#/$defs/MessageBlock"
-              },
-              {
-                "$ref": "#/$defs/ReadBlock"
-              },
-              {
-                "$ref": "#/$defs/IncludeBlock"
-              },
-              {
-                "$ref": "#/$defs/ImportBlock"
-              },
-              {
-                "$ref": "#/$defs/ErrorBlock"
-              },
-              {
-                "$ref": "#/$defs/EmptyBlock"
-              },
-              {
-                "type": "null"
-              }
-            ]
+            "$ref": "#/$defs/BlockType"
           },
           "default": {},
           "description": "Set of definitions executed before the execution of the block.\n    ",
@@ -538,17 +296,9 @@
           "type": "object"
         },
         "def": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Name of the variable used to store the result of the execution of the block.\n    ",
-          "title": "Def"
+          "description": "Name of the variable used to store the result of the execution of the block.\n    "
         },
         "contribute": {
           "default": [
@@ -557,234 +307,64 @@
           ],
           "description": "Indicate if the block contributes to the result and background context.\n    ",
           "items": {
-            "anyOf": [
-              {
-                "$ref": "#/$defs/ContributeTarget"
-              },
-              {
-                "additionalProperties": {
-                  "$ref": "#/$defs/ContributeValue"
-                },
-                "type": "object"
-              }
-            ]
+            "$ref": "#/$defs/ContributeElement"
           },
           "title": "Contribute",
           "type": "array"
         },
         "parser": {
-          "anyOf": [
-            {
-              "enum": [
-                "json",
-                "jsonl",
-                "yaml"
-              ],
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/PdlParser"
-            },
-            {
-              "$ref": "#/$defs/RegexParser"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalParserType",
           "default": null,
-          "description": "Parser to use to construct a value out of a string result.",
-          "title": "Parser"
+          "description": "Parser to use to construct a value out of a string result."
         },
         "fallback": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBlockType",
           "default": null,
-          "description": "Block to execute in case of error.\n    ",
-          "title": "Fallback"
+          "description": "Block to execute in case of error.\n    "
         },
         "retry": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalInt",
           "default": null,
-          "description": "The maximum number of times to retry when an error occurs within a block.\n    ",
-          "title": "Retry"
+          "description": "The maximum number of times to retry when an error occurs within a block.\n    "
         },
         "trace_error_on_retry": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBoolOrStr",
           "default": null,
-          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    ",
-          "title": "Trace Error On Retry"
+          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    "
+        },
+        "requirements": {
+          "$ref": "#/$defs/RequirementsType",
+          "default": [],
+          "description": "Specify any requirements that the result of the block must satisfy.\n    "
         },
         "role": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.",
-          "title": "Role"
+          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`."
         },
         "pdl__context": {
-          "anyOf": [
-            {
-              "items": {
-                "additionalProperties": true,
-                "type": "object"
-              },
-              "type": "array"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalModelInput",
           "default": [],
-          "description": "Current context\n    ",
-          "title": "Pdl  Context"
+          "description": "Current context."
         },
         "pdl__id": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": "",
-          "description": "Unique identifier for this block\n    ",
-          "title": "Pdl  Id"
+          "description": "Unique identifier for this block."
         },
         "pdl__result": {
-          "anyOf": [
-            {},
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalAny",
           "default": null,
-          "description": "Result of the execution of the block",
-          "title": "Pdl  Result"
+          "description": "Result of the execution of the block."
         },
         "pdl__location": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlLocationType"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalPdlLocationType",
           "default": null
         },
         "pdl__timing": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlTiming"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null
+          "$ref": "#/$defs/OptionalPdlTiming",
+          "default": null,
+          "description": "Execution timing information."
         },
         "pdl__is_leaf": {
           "const": false,
@@ -805,86 +385,7 @@
         "array": {
           "description": "Elements of the array.",
           "items": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/FunctionBlock"
-              },
-              {
-                "$ref": "#/$defs/CallBlock"
-              },
-              {
-                "$ref": "#/$defs/LitellmModelBlock"
-              },
-              {
-                "$ref": "#/$defs/GraniteioModelBlock"
-              },
-              {
-                "$ref": "#/$defs/CodeBlock"
-              },
-              {
-                "$ref": "#/$defs/ArgsBlock"
-              },
-              {
-                "$ref": "#/$defs/GetBlock"
-              },
-              {
-                "$ref": "#/$defs/DataBlock"
-              },
-              {
-                "$ref": "#/$defs/IfBlock"
-              },
-              {
-                "$ref": "#/$defs/MatchBlock"
-              },
-              {
-                "$ref": "#/$defs/RepeatBlock"
-              },
-              {
-                "$ref": "#/$defs/TextBlock"
-              },
-              {
-                "$ref": "#/$defs/LastOfBlock"
-              },
-              {
-                "$ref": "#/$defs/ArrayBlock"
-              },
-              {
-                "$ref": "#/$defs/ObjectBlock"
-              },
-              {
-                "$ref": "#/$defs/MessageBlock"
-              },
-              {
-                "$ref": "#/$defs/ReadBlock"
-              },
-              {
-                "$ref": "#/$defs/IncludeBlock"
-              },
-              {
-                "$ref": "#/$defs/ImportBlock"
-              },
-              {
-                "$ref": "#/$defs/ErrorBlock"
-              },
-              {
-                "$ref": "#/$defs/EmptyBlock"
-              },
-              {
-                "type": "null"
-              }
-            ]
+            "$ref": "#/$defs/BlockType"
           },
           "title": "Array",
           "type": "array"
@@ -901,48 +402,12 @@
       "description": "Match an array.",
       "properties": {
         "def": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Def"
+          "$ref": "#/$defs/OptionalStr",
+          "default": null
         },
         "array": {
           "items": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/OrPattern"
-              },
-              {
-                "$ref": "#/$defs/ArrayPattern"
-              },
-              {
-                "$ref": "#/$defs/ObjectPattern"
-              },
-              {
-                "$ref": "#/$defs/AnyPattern"
-              },
-              {
-                "type": "null"
-              }
-            ]
+            "$ref": "#/$defs/PatternType"
           },
           "title": "Array",
           "type": "array"
@@ -954,22 +419,102 @@
       "title": "ArrayPattern",
       "type": "object"
     },
-    "CallBlock": {
-      "additionalProperties": false,
-      "description": "Calling a function.",
-      "properties": {
-        "description": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+    "BlockType": {
+      "anyOf": [
+        {
+          "type": "boolean"
+        },
+        {
+          "type": "integer"
+        },
+        {
+          "type": "number"
+        },
+        {
+          "type": "string"
+        },
+        {
+          "$ref": "#/$defs/FunctionBlock"
+        },
+        {
+          "$ref": "#/$defs/CallBlock"
+        },
+        {
+          "$ref": "#/$defs/LitellmModelBlock"
+        },
+        {
+          "$ref": "#/$defs/GraniteioModelBlock"
+        },
+        {
+          "$ref": "#/$defs/CodeBlock"
+        },
+        {
+          "$ref": "#/$defs/ArgsBlock"
+        },
+        {
+          "$ref": "#/$defs/GetBlock"
+        },
+        {
+          "$ref": "#/$defs/DataBlock"
+        },
+        {
+          "$ref": "#/$defs/IfBlock"
+        },
+        {
+          "$ref": "#/$defs/MatchBlock"
+        },
+        {
+          "$ref": "#/$defs/RepeatBlock"
+        },
+        {
+          "$ref": "#/$defs/MapBlock"
+        },
+        {
+          "$ref": "#/$defs/TextBlock"
+        },
+        {
+          "$ref": "#/$defs/LastOfBlock"
+        },
+        {
+          "$ref": "#/$defs/ArrayBlock"
+        },
+        {
+          "$ref": "#/$defs/ObjectBlock"
+        },
+        {
+          "$ref": "#/$defs/MessageBlock"
+        },
+        {
+          "$ref": "#/$defs/ReadBlock"
+        },
+        {
+          "$ref": "#/$defs/IncludeBlock"
+        },
+        {
+          "$ref": "#/$defs/ImportBlock"
+        },
+        {
+          "$ref": "#/$defs/AggregatorBlock"
+        },
+        {
+          "$ref": "#/$defs/ErrorBlock"
+        },
+        {
+          "$ref": "#/$defs/EmptyBlock"
+        },
+        {
+          "type": "null"
+        }
+      ]
+    },
+    "CallBlock": {
+      "additionalProperties": false,
+      "description": "Calling a function.",
+      "properties": {
+        "description": {
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Documentation associated to the block.\n    ",
-          "title": "Description"
+          "description": "Documentation associated to the block.\n    "
         },
         "spec": {
           "$ref": "#/$defs/PdlTypeType",
@@ -978,86 +523,7 @@
         },
         "defs": {
           "additionalProperties": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/FunctionBlock"
-              },
-              {
-                "$ref": "#/$defs/CallBlock"
-              },
-              {
-                "$ref": "#/$defs/LitellmModelBlock"
-              },
-              {
-                "$ref": "#/$defs/GraniteioModelBlock"
-              },
-              {
-                "$ref": "#/$defs/CodeBlock"
-              },
-              {
-                "$ref": "#/$defs/ArgsBlock"
-              },
-              {
-                "$ref": "#/$defs/GetBlock"
-              },
-              {
-                "$ref": "#/$defs/DataBlock"
-              },
-              {
-                "$ref": "#/$defs/IfBlock"
-              },
-              {
-                "$ref": "#/$defs/MatchBlock"
-              },
-              {
-                "$ref": "#/$defs/RepeatBlock"
-              },
-              {
-                "$ref": "#/$defs/TextBlock"
-              },
-              {
-                "$ref": "#/$defs/LastOfBlock"
-              },
-              {
-                "$ref": "#/$defs/ArrayBlock"
-              },
-              {
-                "$ref": "#/$defs/ObjectBlock"
-              },
-              {
-                "$ref": "#/$defs/MessageBlock"
-              },
-              {
-                "$ref": "#/$defs/ReadBlock"
-              },
-              {
-                "$ref": "#/$defs/IncludeBlock"
-              },
-              {
-                "$ref": "#/$defs/ImportBlock"
-              },
-              {
-                "$ref": "#/$defs/ErrorBlock"
-              },
-              {
-                "$ref": "#/$defs/EmptyBlock"
-              },
-              {
-                "type": "null"
-              }
-            ]
+            "$ref": "#/$defs/BlockType"
           },
           "default": {},
           "description": "Set of definitions executed before the execution of the block.\n    ",
@@ -1065,17 +531,9 @@
           "type": "object"
         },
         "def": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Name of the variable used to store the result of the execution of the block.\n    ",
-          "title": "Def"
+          "description": "Name of the variable used to store the result of the execution of the block.\n    "
         },
         "contribute": {
           "default": [
@@ -1084,234 +542,64 @@
           ],
           "description": "Indicate if the block contributes to the result and background context.\n    ",
           "items": {
-            "anyOf": [
-              {
-                "$ref": "#/$defs/ContributeTarget"
-              },
-              {
-                "additionalProperties": {
-                  "$ref": "#/$defs/ContributeValue"
-                },
-                "type": "object"
-              }
-            ]
+            "$ref": "#/$defs/ContributeElement"
           },
           "title": "Contribute",
           "type": "array"
         },
         "parser": {
-          "anyOf": [
-            {
-              "enum": [
-                "json",
-                "jsonl",
-                "yaml"
-              ],
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/PdlParser"
-            },
-            {
-              "$ref": "#/$defs/RegexParser"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalParserType",
           "default": null,
-          "description": "Parser to use to construct a value out of a string result.",
-          "title": "Parser"
+          "description": "Parser to use to construct a value out of a string result."
         },
         "fallback": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBlockType",
           "default": null,
-          "description": "Block to execute in case of error.\n    ",
-          "title": "Fallback"
+          "description": "Block to execute in case of error.\n    "
         },
         "retry": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalInt",
           "default": null,
-          "description": "The maximum number of times to retry when an error occurs within a block.\n    ",
-          "title": "Retry"
+          "description": "The maximum number of times to retry when an error occurs within a block.\n    "
         },
         "trace_error_on_retry": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBoolOrStr",
           "default": null,
-          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    ",
-          "title": "Trace Error On Retry"
+          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    "
+        },
+        "requirements": {
+          "$ref": "#/$defs/RequirementsType",
+          "default": [],
+          "description": "Specify any requirements that the result of the block must satisfy.\n    "
         },
         "role": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.",
-          "title": "Role"
+          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`."
         },
         "pdl__context": {
-          "anyOf": [
-            {
-              "items": {
-                "additionalProperties": true,
-                "type": "object"
-              },
-              "type": "array"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalModelInput",
           "default": [],
-          "description": "Current context\n    ",
-          "title": "Pdl  Context"
+          "description": "Current context."
         },
         "pdl__id": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": "",
-          "description": "Unique identifier for this block\n    ",
-          "title": "Pdl  Id"
+          "description": "Unique identifier for this block."
         },
         "pdl__result": {
-          "anyOf": [
-            {},
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalAny",
           "default": null,
-          "description": "Result of the execution of the block",
-          "title": "Pdl  Result"
+          "description": "Result of the execution of the block."
         },
         "pdl__location": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlLocationType"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalPdlLocationType",
           "default": null
         },
         "pdl__timing": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlTiming"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null
+          "$ref": "#/$defs/OptionalPdlTiming",
+          "default": null,
+          "description": "Execution timing information."
         },
         "pdl__is_leaf": {
           "const": true,
@@ -1355,88 +643,8 @@
           "title": "Args"
         },
         "pdl__trace": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Pdl  Trace"
+          "$ref": "#/$defs/OptionalBlockType",
+          "default": null
         }
       },
       "required": [
@@ -1450,17 +658,9 @@
       "description": "Execute a piece of code.\n\nExample:\n```PDL\nlang: python\ncode: |\n    import random\n    # (In PDL, set `result` to the output you wish for your code block.)\n    result = random.randint(1, 20)\n```",
       "properties": {
         "description": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Documentation associated to the block.\n    ",
-          "title": "Description"
+          "description": "Documentation associated to the block.\n    "
         },
         "spec": {
           "$ref": "#/$defs/PdlTypeType",
@@ -1469,86 +669,7 @@
         },
         "defs": {
           "additionalProperties": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/FunctionBlock"
-              },
-              {
-                "$ref": "#/$defs/CallBlock"
-              },
-              {
-                "$ref": "#/$defs/LitellmModelBlock"
-              },
-              {
-                "$ref": "#/$defs/GraniteioModelBlock"
-              },
-              {
-                "$ref": "#/$defs/CodeBlock"
-              },
-              {
-                "$ref": "#/$defs/ArgsBlock"
-              },
-              {
-                "$ref": "#/$defs/GetBlock"
-              },
-              {
-                "$ref": "#/$defs/DataBlock"
-              },
-              {
-                "$ref": "#/$defs/IfBlock"
-              },
-              {
-                "$ref": "#/$defs/MatchBlock"
-              },
-              {
-                "$ref": "#/$defs/RepeatBlock"
-              },
-              {
-                "$ref": "#/$defs/TextBlock"
-              },
-              {
-                "$ref": "#/$defs/LastOfBlock"
-              },
-              {
-                "$ref": "#/$defs/ArrayBlock"
-              },
-              {
-                "$ref": "#/$defs/ObjectBlock"
-              },
-              {
-                "$ref": "#/$defs/MessageBlock"
-              },
-              {
-                "$ref": "#/$defs/ReadBlock"
-              },
-              {
-                "$ref": "#/$defs/IncludeBlock"
-              },
-              {
-                "$ref": "#/$defs/ImportBlock"
-              },
-              {
-                "$ref": "#/$defs/ErrorBlock"
-              },
-              {
-                "$ref": "#/$defs/EmptyBlock"
-              },
-              {
-                "type": "null"
-              }
-            ]
+            "$ref": "#/$defs/BlockType"
           },
           "default": {},
           "description": "Set of definitions executed before the execution of the block.\n    ",
@@ -1556,17 +677,9 @@
           "type": "object"
         },
         "def": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Name of the variable used to store the result of the execution of the block.\n    ",
-          "title": "Def"
+          "description": "Name of the variable used to store the result of the execution of the block.\n    "
         },
         "contribute": {
           "default": [
@@ -1575,234 +688,64 @@
           ],
           "description": "Indicate if the block contributes to the result and background context.\n    ",
           "items": {
-            "anyOf": [
-              {
-                "$ref": "#/$defs/ContributeTarget"
-              },
-              {
-                "additionalProperties": {
-                  "$ref": "#/$defs/ContributeValue"
-                },
-                "type": "object"
-              }
-            ]
+            "$ref": "#/$defs/ContributeElement"
           },
           "title": "Contribute",
           "type": "array"
         },
         "parser": {
-          "anyOf": [
-            {
-              "enum": [
-                "json",
-                "jsonl",
-                "yaml"
-              ],
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/PdlParser"
-            },
-            {
-              "$ref": "#/$defs/RegexParser"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalParserType",
           "default": null,
-          "description": "Parser to use to construct a value out of a string result.",
-          "title": "Parser"
+          "description": "Parser to use to construct a value out of a string result."
         },
         "fallback": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBlockType",
           "default": null,
-          "description": "Block to execute in case of error.\n    ",
-          "title": "Fallback"
+          "description": "Block to execute in case of error.\n    "
         },
         "retry": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalInt",
           "default": null,
-          "description": "The maximum number of times to retry when an error occurs within a block.\n    ",
-          "title": "Retry"
+          "description": "The maximum number of times to retry when an error occurs within a block.\n    "
         },
         "trace_error_on_retry": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBoolOrStr",
           "default": null,
-          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    ",
-          "title": "Trace Error On Retry"
+          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    "
+        },
+        "requirements": {
+          "$ref": "#/$defs/RequirementsType",
+          "default": [],
+          "description": "Specify any requirements that the result of the block must satisfy.\n    "
         },
         "role": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.",
-          "title": "Role"
+          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`."
         },
         "pdl__context": {
-          "anyOf": [
-            {
-              "items": {
-                "additionalProperties": true,
-                "type": "object"
-              },
-              "type": "array"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalModelInput",
           "default": [],
-          "description": "Current context\n    ",
-          "title": "Pdl  Context"
+          "description": "Current context."
         },
         "pdl__id": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": "",
-          "description": "Unique identifier for this block\n    ",
-          "title": "Pdl  Id"
+          "description": "Unique identifier for this block."
         },
         "pdl__result": {
-          "anyOf": [
-            {},
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalAny",
           "default": null,
-          "description": "Result of the execution of the block",
-          "title": "Pdl  Result"
+          "description": "Result of the execution of the block."
         },
         "pdl__location": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlLocationType"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalPdlLocationType",
           "default": null
         },
         "pdl__timing": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlTiming"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null
+          "$ref": "#/$defs/OptionalPdlTiming",
+          "default": null,
+          "description": "Execution timing information."
         },
         "pdl__is_leaf": {
           "const": true,
@@ -1829,88 +772,8 @@
           "type": "string"
         },
         "code": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "description": "Code to execute.\n    ",
-          "title": "Code"
+          "$ref": "#/$defs/BlockType",
+          "description": "Code to execute.\n    "
         }
       },
       "required": [
@@ -1920,11 +783,29 @@
       "title": "CodeBlock",
       "type": "object"
     },
+    "ContributeElement": {
+      "anyOf": [
+        {
+          "$ref": "#/$defs/ContributeTarget"
+        },
+        {
+          "type": "string"
+        },
+        {
+          "additionalProperties": {
+            "$ref": "#/$defs/ContributeValue"
+          },
+          "type": "object"
+        }
+      ]
+    },
     "ContributeTarget": {
       "description": "Values allowed in the `contribute` field.",
       "enum": [
         "result",
-        "context"
+        "context",
+        "stdout",
+        "stderr"
       ],
       "title": "ContributeTarget",
       "type": "string"
@@ -1938,10 +819,7 @@
             {
               "$ref": "#/$defs/LocalizedExpression_TypeVar_"
             },
-            {
-              "items": {},
-              "type": "array"
-            },
+            {},
             {
               "type": "string"
             }
@@ -1960,17 +838,9 @@
       "description": "Arbitrary value, equivalent to JSON.\n\nExample. As part of a `defs` section, set `numbers` to the list `[1, 2, 3, 4]`:\n```PDL\ndefs:\n  numbers:\n    data: [1, 2, 3, 4]\n```\n\nExample.  Evaluate `${ TEST.answer }` in\n[Jinja](https://jinja.palletsprojects.com/en/stable/), passing\nthe result to a regex parser with capture groups.  Set\n`EXTRACTED_GROUND_TRUTH` to an object with attribute `answer`,\na string, containing the value of the capture group.\n```PDL\n- data: ${ TEST.answer }\n  parser:\n    regex: \"(.|\\n)*#### (?P([0-9])*)\\n*\"\n    spec:\n      answer: string\n  def: EXTRACTED_GROUND_TRUTH\n```",
       "properties": {
         "description": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Documentation associated to the block.\n    ",
-          "title": "Description"
+          "description": "Documentation associated to the block.\n    "
         },
         "spec": {
           "$ref": "#/$defs/PdlTypeType",
@@ -1979,86 +849,7 @@
         },
         "defs": {
           "additionalProperties": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/FunctionBlock"
-              },
-              {
-                "$ref": "#/$defs/CallBlock"
-              },
-              {
-                "$ref": "#/$defs/LitellmModelBlock"
-              },
-              {
-                "$ref": "#/$defs/GraniteioModelBlock"
-              },
-              {
-                "$ref": "#/$defs/CodeBlock"
-              },
-              {
-                "$ref": "#/$defs/ArgsBlock"
-              },
-              {
-                "$ref": "#/$defs/GetBlock"
-              },
-              {
-                "$ref": "#/$defs/DataBlock"
-              },
-              {
-                "$ref": "#/$defs/IfBlock"
-              },
-              {
-                "$ref": "#/$defs/MatchBlock"
-              },
-              {
-                "$ref": "#/$defs/RepeatBlock"
-              },
-              {
-                "$ref": "#/$defs/TextBlock"
-              },
-              {
-                "$ref": "#/$defs/LastOfBlock"
-              },
-              {
-                "$ref": "#/$defs/ArrayBlock"
-              },
-              {
-                "$ref": "#/$defs/ObjectBlock"
-              },
-              {
-                "$ref": "#/$defs/MessageBlock"
-              },
-              {
-                "$ref": "#/$defs/ReadBlock"
-              },
-              {
-                "$ref": "#/$defs/IncludeBlock"
-              },
-              {
-                "$ref": "#/$defs/ImportBlock"
-              },
-              {
-                "$ref": "#/$defs/ErrorBlock"
-              },
-              {
-                "$ref": "#/$defs/EmptyBlock"
-              },
-              {
-                "type": "null"
-              }
-            ]
+            "$ref": "#/$defs/BlockType"
           },
           "default": {},
           "description": "Set of definitions executed before the execution of the block.\n    ",
@@ -2066,17 +857,9 @@
           "type": "object"
         },
         "def": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Name of the variable used to store the result of the execution of the block.\n    ",
-          "title": "Def"
+          "description": "Name of the variable used to store the result of the execution of the block.\n    "
         },
         "contribute": {
           "default": [
@@ -2085,234 +868,64 @@
           ],
           "description": "Indicate if the block contributes to the result and background context.\n    ",
           "items": {
-            "anyOf": [
-              {
-                "$ref": "#/$defs/ContributeTarget"
-              },
-              {
-                "additionalProperties": {
-                  "$ref": "#/$defs/ContributeValue"
-                },
-                "type": "object"
-              }
-            ]
+            "$ref": "#/$defs/ContributeElement"
           },
           "title": "Contribute",
           "type": "array"
         },
         "parser": {
-          "anyOf": [
-            {
-              "enum": [
-                "json",
-                "jsonl",
-                "yaml"
-              ],
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/PdlParser"
-            },
-            {
-              "$ref": "#/$defs/RegexParser"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalParserType",
           "default": null,
-          "description": "Parser to use to construct a value out of a string result.",
-          "title": "Parser"
+          "description": "Parser to use to construct a value out of a string result."
         },
         "fallback": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBlockType",
           "default": null,
-          "description": "Block to execute in case of error.\n    ",
-          "title": "Fallback"
+          "description": "Block to execute in case of error.\n    "
         },
         "retry": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalInt",
           "default": null,
-          "description": "The maximum number of times to retry when an error occurs within a block.\n    ",
-          "title": "Retry"
+          "description": "The maximum number of times to retry when an error occurs within a block.\n    "
         },
         "trace_error_on_retry": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBoolOrStr",
           "default": null,
-          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    ",
-          "title": "Trace Error On Retry"
+          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    "
+        },
+        "requirements": {
+          "$ref": "#/$defs/RequirementsType",
+          "default": [],
+          "description": "Specify any requirements that the result of the block must satisfy.\n    "
         },
         "role": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.",
-          "title": "Role"
+          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`."
         },
         "pdl__context": {
-          "anyOf": [
-            {
-              "items": {
-                "additionalProperties": true,
-                "type": "object"
-              },
-              "type": "array"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalModelInput",
           "default": [],
-          "description": "Current context\n    ",
-          "title": "Pdl  Context"
+          "description": "Current context."
         },
         "pdl__id": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": "",
-          "description": "Unique identifier for this block\n    ",
-          "title": "Pdl  Id"
+          "description": "Unique identifier for this block."
         },
         "pdl__result": {
-          "anyOf": [
-            {},
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalAny",
           "default": null,
-          "description": "Result of the execution of the block",
-          "title": "Pdl  Result"
+          "description": "Result of the execution of the block."
         },
         "pdl__location": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlLocationType"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalPdlLocationType",
           "default": null
         },
         "pdl__timing": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlTiming"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null
+          "$ref": "#/$defs/OptionalPdlTiming",
+          "default": null,
+          "description": "Execution timing information."
         },
         "pdl__is_leaf": {
           "const": true,
@@ -2357,17 +970,9 @@
       "description": "Block without an action. It can contain definitions.",
       "properties": {
         "description": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Documentation associated to the block.\n    ",
-          "title": "Description"
+          "description": "Documentation associated to the block.\n    "
         },
         "spec": {
           "$ref": "#/$defs/PdlTypeType",
@@ -2376,86 +981,7 @@
         },
         "defs": {
           "additionalProperties": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/FunctionBlock"
-              },
-              {
-                "$ref": "#/$defs/CallBlock"
-              },
-              {
-                "$ref": "#/$defs/LitellmModelBlock"
-              },
-              {
-                "$ref": "#/$defs/GraniteioModelBlock"
-              },
-              {
-                "$ref": "#/$defs/CodeBlock"
-              },
-              {
-                "$ref": "#/$defs/ArgsBlock"
-              },
-              {
-                "$ref": "#/$defs/GetBlock"
-              },
-              {
-                "$ref": "#/$defs/DataBlock"
-              },
-              {
-                "$ref": "#/$defs/IfBlock"
-              },
-              {
-                "$ref": "#/$defs/MatchBlock"
-              },
-              {
-                "$ref": "#/$defs/RepeatBlock"
-              },
-              {
-                "$ref": "#/$defs/TextBlock"
-              },
-              {
-                "$ref": "#/$defs/LastOfBlock"
-              },
-              {
-                "$ref": "#/$defs/ArrayBlock"
-              },
-              {
-                "$ref": "#/$defs/ObjectBlock"
-              },
-              {
-                "$ref": "#/$defs/MessageBlock"
-              },
-              {
-                "$ref": "#/$defs/ReadBlock"
-              },
-              {
-                "$ref": "#/$defs/IncludeBlock"
-              },
-              {
-                "$ref": "#/$defs/ImportBlock"
-              },
-              {
-                "$ref": "#/$defs/ErrorBlock"
-              },
-              {
-                "$ref": "#/$defs/EmptyBlock"
-              },
-              {
-                "type": "null"
-              }
-            ]
+            "$ref": "#/$defs/BlockType"
           },
           "default": {},
           "description": "Set of definitions executed before the execution of the block.\n    ",
@@ -2463,17 +989,9 @@
           "type": "object"
         },
         "def": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Name of the variable used to store the result of the execution of the block.\n    ",
-          "title": "Def"
+          "description": "Name of the variable used to store the result of the execution of the block.\n    "
         },
         "contribute": {
           "default": [
@@ -2482,234 +1000,64 @@
           ],
           "description": "Indicate if the block contributes to the result and background context.\n    ",
           "items": {
-            "anyOf": [
-              {
-                "$ref": "#/$defs/ContributeTarget"
-              },
-              {
-                "additionalProperties": {
-                  "$ref": "#/$defs/ContributeValue"
-                },
-                "type": "object"
-              }
-            ]
+            "$ref": "#/$defs/ContributeElement"
           },
           "title": "Contribute",
           "type": "array"
         },
         "parser": {
-          "anyOf": [
-            {
-              "enum": [
-                "json",
-                "jsonl",
-                "yaml"
-              ],
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/PdlParser"
-            },
-            {
-              "$ref": "#/$defs/RegexParser"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalParserType",
           "default": null,
-          "description": "Parser to use to construct a value out of a string result.",
-          "title": "Parser"
+          "description": "Parser to use to construct a value out of a string result."
         },
         "fallback": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBlockType",
           "default": null,
-          "description": "Block to execute in case of error.\n    ",
-          "title": "Fallback"
+          "description": "Block to execute in case of error.\n    "
         },
         "retry": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalInt",
           "default": null,
-          "description": "The maximum number of times to retry when an error occurs within a block.\n    ",
-          "title": "Retry"
+          "description": "The maximum number of times to retry when an error occurs within a block.\n    "
         },
         "trace_error_on_retry": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBoolOrStr",
           "default": null,
-          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    ",
-          "title": "Trace Error On Retry"
+          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    "
+        },
+        "requirements": {
+          "$ref": "#/$defs/RequirementsType",
+          "default": [],
+          "description": "Specify any requirements that the result of the block must satisfy.\n    "
         },
         "role": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.",
-          "title": "Role"
+          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`."
         },
         "pdl__context": {
-          "anyOf": [
-            {
-              "items": {
-                "additionalProperties": true,
-                "type": "object"
-              },
-              "type": "array"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalModelInput",
           "default": [],
-          "description": "Current context\n    ",
-          "title": "Pdl  Context"
+          "description": "Current context."
         },
         "pdl__id": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": "",
-          "description": "Unique identifier for this block\n    ",
-          "title": "Pdl  Id"
+          "description": "Unique identifier for this block."
         },
         "pdl__result": {
-          "anyOf": [
-            {},
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalAny",
           "default": null,
-          "description": "Result of the execution of the block",
-          "title": "Pdl  Result"
+          "description": "Result of the execution of the block."
         },
         "pdl__location": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlLocationType"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalPdlLocationType",
           "default": null
         },
         "pdl__timing": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlTiming"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null
+          "$ref": "#/$defs/OptionalPdlTiming",
+          "default": null,
+          "description": "Execution timing information."
         },
         "pdl__is_leaf": {
           "const": true,
@@ -2748,17 +1096,9 @@
       "description": "Block representing an error generated at runtime.",
       "properties": {
         "description": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Documentation associated to the block.\n    ",
-          "title": "Description"
+          "description": "Documentation associated to the block.\n    "
         },
         "spec": {
           "$ref": "#/$defs/PdlTypeType",
@@ -2767,86 +1107,7 @@
         },
         "defs": {
           "additionalProperties": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/FunctionBlock"
-              },
-              {
-                "$ref": "#/$defs/CallBlock"
-              },
-              {
-                "$ref": "#/$defs/LitellmModelBlock"
-              },
-              {
-                "$ref": "#/$defs/GraniteioModelBlock"
-              },
-              {
-                "$ref": "#/$defs/CodeBlock"
-              },
-              {
-                "$ref": "#/$defs/ArgsBlock"
-              },
-              {
-                "$ref": "#/$defs/GetBlock"
-              },
-              {
-                "$ref": "#/$defs/DataBlock"
-              },
-              {
-                "$ref": "#/$defs/IfBlock"
-              },
-              {
-                "$ref": "#/$defs/MatchBlock"
-              },
-              {
-                "$ref": "#/$defs/RepeatBlock"
-              },
-              {
-                "$ref": "#/$defs/TextBlock"
-              },
-              {
-                "$ref": "#/$defs/LastOfBlock"
-              },
-              {
-                "$ref": "#/$defs/ArrayBlock"
-              },
-              {
-                "$ref": "#/$defs/ObjectBlock"
-              },
-              {
-                "$ref": "#/$defs/MessageBlock"
-              },
-              {
-                "$ref": "#/$defs/ReadBlock"
-              },
-              {
-                "$ref": "#/$defs/IncludeBlock"
-              },
-              {
-                "$ref": "#/$defs/ImportBlock"
-              },
-              {
-                "$ref": "#/$defs/ErrorBlock"
-              },
-              {
-                "$ref": "#/$defs/EmptyBlock"
-              },
-              {
-                "type": "null"
-              }
-            ]
+            "$ref": "#/$defs/BlockType"
           },
           "default": {},
           "description": "Set of definitions executed before the execution of the block.\n    ",
@@ -2854,17 +1115,9 @@
           "type": "object"
         },
         "def": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Name of the variable used to store the result of the execution of the block.\n    ",
-          "title": "Def"
+          "description": "Name of the variable used to store the result of the execution of the block.\n    "
         },
         "contribute": {
           "default": [
@@ -2873,234 +1126,64 @@
           ],
           "description": "Indicate if the block contributes to the result and background context.\n    ",
           "items": {
-            "anyOf": [
-              {
-                "$ref": "#/$defs/ContributeTarget"
-              },
-              {
-                "additionalProperties": {
-                  "$ref": "#/$defs/ContributeValue"
-                },
-                "type": "object"
-              }
-            ]
+            "$ref": "#/$defs/ContributeElement"
           },
           "title": "Contribute",
           "type": "array"
         },
         "parser": {
-          "anyOf": [
-            {
-              "enum": [
-                "json",
-                "jsonl",
-                "yaml"
-              ],
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/PdlParser"
-            },
-            {
-              "$ref": "#/$defs/RegexParser"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalParserType",
           "default": null,
-          "description": "Parser to use to construct a value out of a string result.",
-          "title": "Parser"
+          "description": "Parser to use to construct a value out of a string result."
         },
         "fallback": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBlockType",
           "default": null,
-          "description": "Block to execute in case of error.\n    ",
-          "title": "Fallback"
+          "description": "Block to execute in case of error.\n    "
         },
         "retry": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalInt",
           "default": null,
-          "description": "The maximum number of times to retry when an error occurs within a block.\n    ",
-          "title": "Retry"
+          "description": "The maximum number of times to retry when an error occurs within a block.\n    "
         },
         "trace_error_on_retry": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBoolOrStr",
           "default": null,
-          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    ",
-          "title": "Trace Error On Retry"
+          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    "
+        },
+        "requirements": {
+          "$ref": "#/$defs/RequirementsType",
+          "default": [],
+          "description": "Specify any requirements that the result of the block must satisfy.\n    "
         },
         "role": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.",
-          "title": "Role"
+          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`."
         },
         "pdl__context": {
-          "anyOf": [
-            {
-              "items": {
-                "additionalProperties": true,
-                "type": "object"
-              },
-              "type": "array"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalModelInput",
           "default": [],
-          "description": "Current context\n    ",
-          "title": "Pdl  Context"
+          "description": "Current context."
         },
         "pdl__id": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": "",
-          "description": "Unique identifier for this block\n    ",
-          "title": "Pdl  Id"
+          "description": "Unique identifier for this block."
         },
         "pdl__result": {
-          "anyOf": [
-            {},
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalAny",
           "default": null,
-          "description": "Result of the execution of the block",
-          "title": "Pdl  Result"
+          "description": "Result of the execution of the block."
         },
         "pdl__location": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlLocationType"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalPdlLocationType",
           "default": null
         },
         "pdl__timing": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlTiming"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null
+          "$ref": "#/$defs/OptionalPdlTiming",
+          "default": null,
+          "description": "Execution timing information."
         },
         "pdl__is_leaf": {
           "const": true,
@@ -3120,95 +1203,157 @@
           "type": "string"
         },
         "program": {
+          "$ref": "#/$defs/BlockType",
+          "description": "Block that raised the error.\n    "
+        }
+      },
+      "required": [
+        "msg",
+        "program"
+      ],
+      "title": "ErrorBlock",
+      "type": "object"
+    },
+    "ExpressionBool": {
+      "anyOf": [
+        {
+          "$ref": "#/$defs/LocalizedExpression_TypeVar_"
+        },
+        {
+          "type": "boolean"
+        },
+        {
+          "type": "string"
+        }
+      ]
+    },
+    "ExpressionInt": {
+      "anyOf": [
+        {
+          "$ref": "#/$defs/LocalizedExpression_TypeVar_"
+        },
+        {
+          "type": "integer"
+        },
+        {
+          "type": "string"
+        }
+      ]
+    },
+    "ExpressionStr": {
+      "anyOf": [
+        {
+          "$ref": "#/$defs/LocalizedExpression_TypeVar_"
+        },
+        {
+          "type": "string"
+        }
+      ]
+    },
+    "FileAggregatorConfig": {
+      "additionalProperties": false,
+      "properties": {
+        "description": {
           "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
             {
               "type": "string"
             },
             {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
+              "type": "null"
+            }
+          ],
+          "default": null,
+          "description": "Documentation associated to the aggregator config.\n    ",
+          "title": "Description"
+        },
+        "file": {
+          "anyOf": [
             {
-              "$ref": "#/$defs/IfBlock"
+              "$ref": "#/$defs/LocalizedExpression_TypeVar_"
             },
             {
-              "$ref": "#/$defs/MatchBlock"
-            },
+              "type": "string"
+            }
+          ],
+          "description": "Name of the file to which contribute.",
+          "title": "File"
+        },
+        "mode": {
+          "anyOf": [
             {
-              "$ref": "#/$defs/RepeatBlock"
+              "$ref": "#/$defs/LocalizedExpression_TypeVar_"
             },
             {
-              "$ref": "#/$defs/TextBlock"
-            },
+              "type": "string"
+            }
+          ],
+          "default": "w",
+          "description": "File opening mode.",
+          "title": "Mode"
+        },
+        "encoding": {
+          "anyOf": [
             {
-              "$ref": "#/$defs/LastOfBlock"
+              "$ref": "#/$defs/LocalizedExpression_TypeVar_"
             },
             {
-              "$ref": "#/$defs/ArrayBlock"
+              "type": "string"
             },
             {
-              "$ref": "#/$defs/ObjectBlock"
-            },
+              "type": "null"
+            }
+          ],
+          "default": "utf-8",
+          "description": "File encoding.",
+          "title": "Encoding"
+        },
+        "prefix": {
+          "anyOf": [
             {
-              "$ref": "#/$defs/MessageBlock"
+              "$ref": "#/$defs/LocalizedExpression_TypeVar_"
             },
             {
-              "$ref": "#/$defs/ReadBlock"
-            },
+              "type": "string"
+            }
+          ],
+          "default": "",
+          "description": "Prefix to the contributed value.",
+          "title": "Prefix"
+        },
+        "suffix": {
+          "anyOf": [
             {
-              "$ref": "#/$defs/IncludeBlock"
+              "$ref": "#/$defs/LocalizedExpression_TypeVar_"
             },
             {
-              "$ref": "#/$defs/ImportBlock"
-            },
+              "type": "string"
+            }
+          ],
+          "default": "\n",
+          "description": "Suffix to the contributed value.",
+          "title": "Suffix"
+        },
+        "flush": {
+          "anyOf": [
             {
-              "$ref": "#/$defs/ErrorBlock"
+              "$ref": "#/$defs/LocalizedExpression_TypeVar_"
             },
             {
-              "$ref": "#/$defs/EmptyBlock"
+              "type": "boolean"
             },
             {
-              "type": "null"
+              "type": "string"
             }
           ],
-          "description": "Block that raised the error.\n    ",
-          "title": "Program"
+          "default": false,
+          "description": "Whether to forcibly flush the stream.",
+          "title": "Flush"
         }
       },
       "required": [
-        "msg",
-        "program"
+        "file"
       ],
-      "title": "ErrorBlock",
+      "title": "FileAggregatorConfig",
       "type": "object"
     },
     "FunctionBlock": {
@@ -3216,17 +1361,9 @@
       "description": "Function declaration.",
       "properties": {
         "description": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Documentation associated to the block.\n    ",
-          "title": "Description"
+          "description": "Documentation associated to the block.\n    "
         },
         "spec": {
           "$ref": "#/$defs/PdlTypeType",
@@ -3235,86 +1372,7 @@
         },
         "defs": {
           "additionalProperties": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/FunctionBlock"
-              },
-              {
-                "$ref": "#/$defs/CallBlock"
-              },
-              {
-                "$ref": "#/$defs/LitellmModelBlock"
-              },
-              {
-                "$ref": "#/$defs/GraniteioModelBlock"
-              },
-              {
-                "$ref": "#/$defs/CodeBlock"
-              },
-              {
-                "$ref": "#/$defs/ArgsBlock"
-              },
-              {
-                "$ref": "#/$defs/GetBlock"
-              },
-              {
-                "$ref": "#/$defs/DataBlock"
-              },
-              {
-                "$ref": "#/$defs/IfBlock"
-              },
-              {
-                "$ref": "#/$defs/MatchBlock"
-              },
-              {
-                "$ref": "#/$defs/RepeatBlock"
-              },
-              {
-                "$ref": "#/$defs/TextBlock"
-              },
-              {
-                "$ref": "#/$defs/LastOfBlock"
-              },
-              {
-                "$ref": "#/$defs/ArrayBlock"
-              },
-              {
-                "$ref": "#/$defs/ObjectBlock"
-              },
-              {
-                "$ref": "#/$defs/MessageBlock"
-              },
-              {
-                "$ref": "#/$defs/ReadBlock"
-              },
-              {
-                "$ref": "#/$defs/IncludeBlock"
-              },
-              {
-                "$ref": "#/$defs/ImportBlock"
-              },
-              {
-                "$ref": "#/$defs/ErrorBlock"
-              },
-              {
-                "$ref": "#/$defs/EmptyBlock"
-              },
-              {
-                "type": "null"
-              }
-            ]
+            "$ref": "#/$defs/BlockType"
           },
           "default": {},
           "description": "Set of definitions executed before the execution of the block.\n    ",
@@ -3322,17 +1380,9 @@
           "type": "object"
         },
         "def": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Name of the variable used to store the result of the execution of the block.\n    ",
-          "title": "Def"
+          "description": "Name of the variable used to store the result of the execution of the block.\n    "
         },
         "contribute": {
           "default": [
@@ -3341,234 +1391,64 @@
           ],
           "description": "Indicate if the block contributes to the result and background context.\n    ",
           "items": {
-            "anyOf": [
-              {
-                "$ref": "#/$defs/ContributeTarget"
-              },
-              {
-                "additionalProperties": {
-                  "$ref": "#/$defs/ContributeValue"
-                },
-                "type": "object"
-              }
-            ]
+            "$ref": "#/$defs/ContributeElement"
           },
           "title": "Contribute",
           "type": "array"
         },
         "parser": {
-          "anyOf": [
-            {
-              "enum": [
-                "json",
-                "jsonl",
-                "yaml"
-              ],
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/PdlParser"
-            },
-            {
-              "$ref": "#/$defs/RegexParser"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalParserType",
           "default": null,
-          "description": "Parser to use to construct a value out of a string result.",
-          "title": "Parser"
+          "description": "Parser to use to construct a value out of a string result."
         },
         "fallback": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBlockType",
           "default": null,
-          "description": "Block to execute in case of error.\n    ",
-          "title": "Fallback"
+          "description": "Block to execute in case of error.\n    "
         },
         "retry": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalInt",
           "default": null,
-          "description": "The maximum number of times to retry when an error occurs within a block.\n    ",
-          "title": "Retry"
+          "description": "The maximum number of times to retry when an error occurs within a block.\n    "
         },
         "trace_error_on_retry": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBoolOrStr",
           "default": null,
-          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    ",
-          "title": "Trace Error On Retry"
+          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    "
+        },
+        "requirements": {
+          "$ref": "#/$defs/RequirementsType",
+          "default": [],
+          "description": "Specify any requirements that the result of the block must satisfy.\n    "
         },
         "role": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.",
-          "title": "Role"
+          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`."
         },
         "pdl__context": {
-          "anyOf": [
-            {
-              "items": {
-                "additionalProperties": true,
-                "type": "object"
-              },
-              "type": "array"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalModelInput",
           "default": [],
-          "description": "Current context\n    ",
-          "title": "Pdl  Context"
+          "description": "Current context."
         },
         "pdl__id": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": "",
-          "description": "Unique identifier for this block\n    ",
-          "title": "Pdl  Id"
+          "description": "Unique identifier for this block."
         },
         "pdl__result": {
-          "anyOf": [
-            {},
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalAny",
           "default": null,
-          "description": "Result of the execution of the block",
-          "title": "Pdl  Result"
+          "description": "Result of the execution of the block."
         },
         "pdl__location": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlLocationType"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalPdlLocationType",
           "default": null
         },
         "pdl__timing": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlTiming"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null
+          "$ref": "#/$defs/OptionalPdlTiming",
+          "default": null,
+          "description": "Execution timing information."
         },
         "pdl__is_leaf": {
           "const": true,
@@ -3598,88 +1478,8 @@
           "title": "Function"
         },
         "return": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "description": "Body of the function.\n    ",
-          "title": "Return"
+          "$ref": "#/$defs/BlockType",
+          "description": "Body of the function.\n    "
         },
         "signature": {
           "anyOf": [
@@ -3709,17 +1509,9 @@
       "description": "Get the value of a variable.\n\nThe GetBlock is deprecated.  Use DataBlock instead.",
       "properties": {
         "description": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Documentation associated to the block.\n    ",
-          "title": "Description"
+          "description": "Documentation associated to the block.\n    "
         },
         "spec": {
           "$ref": "#/$defs/PdlTypeType",
@@ -3728,86 +1520,7 @@
         },
         "defs": {
           "additionalProperties": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/FunctionBlock"
-              },
-              {
-                "$ref": "#/$defs/CallBlock"
-              },
-              {
-                "$ref": "#/$defs/LitellmModelBlock"
-              },
-              {
-                "$ref": "#/$defs/GraniteioModelBlock"
-              },
-              {
-                "$ref": "#/$defs/CodeBlock"
-              },
-              {
-                "$ref": "#/$defs/ArgsBlock"
-              },
-              {
-                "$ref": "#/$defs/GetBlock"
-              },
-              {
-                "$ref": "#/$defs/DataBlock"
-              },
-              {
-                "$ref": "#/$defs/IfBlock"
-              },
-              {
-                "$ref": "#/$defs/MatchBlock"
-              },
-              {
-                "$ref": "#/$defs/RepeatBlock"
-              },
-              {
-                "$ref": "#/$defs/TextBlock"
-              },
-              {
-                "$ref": "#/$defs/LastOfBlock"
-              },
-              {
-                "$ref": "#/$defs/ArrayBlock"
-              },
-              {
-                "$ref": "#/$defs/ObjectBlock"
-              },
-              {
-                "$ref": "#/$defs/MessageBlock"
-              },
-              {
-                "$ref": "#/$defs/ReadBlock"
-              },
-              {
-                "$ref": "#/$defs/IncludeBlock"
-              },
-              {
-                "$ref": "#/$defs/ImportBlock"
-              },
-              {
-                "$ref": "#/$defs/ErrorBlock"
-              },
-              {
-                "$ref": "#/$defs/EmptyBlock"
-              },
-              {
-                "type": "null"
-              }
-            ]
+            "$ref": "#/$defs/BlockType"
           },
           "default": {},
           "description": "Set of definitions executed before the execution of the block.\n    ",
@@ -3815,17 +1528,9 @@
           "type": "object"
         },
         "def": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Name of the variable used to store the result of the execution of the block.\n    ",
-          "title": "Def"
+          "description": "Name of the variable used to store the result of the execution of the block.\n    "
         },
         "contribute": {
           "default": [
@@ -3834,234 +1539,64 @@
           ],
           "description": "Indicate if the block contributes to the result and background context.\n    ",
           "items": {
-            "anyOf": [
-              {
-                "$ref": "#/$defs/ContributeTarget"
-              },
-              {
-                "additionalProperties": {
-                  "$ref": "#/$defs/ContributeValue"
-                },
-                "type": "object"
-              }
-            ]
+            "$ref": "#/$defs/ContributeElement"
           },
           "title": "Contribute",
           "type": "array"
         },
         "parser": {
-          "anyOf": [
-            {
-              "enum": [
-                "json",
-                "jsonl",
-                "yaml"
-              ],
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/PdlParser"
-            },
-            {
-              "$ref": "#/$defs/RegexParser"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalParserType",
           "default": null,
-          "description": "Parser to use to construct a value out of a string result.",
-          "title": "Parser"
+          "description": "Parser to use to construct a value out of a string result."
         },
         "fallback": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBlockType",
           "default": null,
-          "description": "Block to execute in case of error.\n    ",
-          "title": "Fallback"
+          "description": "Block to execute in case of error.\n    "
         },
         "retry": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalInt",
           "default": null,
-          "description": "The maximum number of times to retry when an error occurs within a block.\n    ",
-          "title": "Retry"
+          "description": "The maximum number of times to retry when an error occurs within a block.\n    "
         },
         "trace_error_on_retry": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBoolOrStr",
           "default": null,
-          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    ",
-          "title": "Trace Error On Retry"
+          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    "
+        },
+        "requirements": {
+          "$ref": "#/$defs/RequirementsType",
+          "default": [],
+          "description": "Specify any requirements that the result of the block must satisfy.\n    "
         },
         "role": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.",
-          "title": "Role"
+          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`."
         },
         "pdl__context": {
-          "anyOf": [
-            {
-              "items": {
-                "additionalProperties": true,
-                "type": "object"
-              },
-              "type": "array"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalModelInput",
           "default": [],
-          "description": "Current context\n    ",
-          "title": "Pdl  Context"
+          "description": "Current context."
         },
         "pdl__id": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": "",
-          "description": "Unique identifier for this block\n    ",
-          "title": "Pdl  Id"
+          "description": "Unique identifier for this block."
         },
         "pdl__result": {
-          "anyOf": [
-            {},
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalAny",
           "default": null,
-          "description": "Result of the execution of the block",
-          "title": "Pdl  Result"
+          "description": "Result of the execution of the block."
         },
         "pdl__location": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlLocationType"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalPdlLocationType",
           "default": null
         },
         "pdl__timing": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlTiming"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null
+          "$ref": "#/$defs/OptionalPdlTiming",
+          "default": null,
+          "description": "Execution timing information."
         },
         "pdl__is_leaf": {
           "const": true,
@@ -4092,17 +1627,9 @@
       "description": "Call an LLM through the granite-io API.",
       "properties": {
         "description": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Documentation associated to the block.\n    ",
-          "title": "Description"
+          "description": "Documentation associated to the block.\n    "
         },
         "spec": {
           "$ref": "#/$defs/PdlTypeType",
@@ -4111,86 +1638,7 @@
         },
         "defs": {
           "additionalProperties": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/FunctionBlock"
-              },
-              {
-                "$ref": "#/$defs/CallBlock"
-              },
-              {
-                "$ref": "#/$defs/LitellmModelBlock"
-              },
-              {
-                "$ref": "#/$defs/GraniteioModelBlock"
-              },
-              {
-                "$ref": "#/$defs/CodeBlock"
-              },
-              {
-                "$ref": "#/$defs/ArgsBlock"
-              },
-              {
-                "$ref": "#/$defs/GetBlock"
-              },
-              {
-                "$ref": "#/$defs/DataBlock"
-              },
-              {
-                "$ref": "#/$defs/IfBlock"
-              },
-              {
-                "$ref": "#/$defs/MatchBlock"
-              },
-              {
-                "$ref": "#/$defs/RepeatBlock"
-              },
-              {
-                "$ref": "#/$defs/TextBlock"
-              },
-              {
-                "$ref": "#/$defs/LastOfBlock"
-              },
-              {
-                "$ref": "#/$defs/ArrayBlock"
-              },
-              {
-                "$ref": "#/$defs/ObjectBlock"
-              },
-              {
-                "$ref": "#/$defs/MessageBlock"
-              },
-              {
-                "$ref": "#/$defs/ReadBlock"
-              },
-              {
-                "$ref": "#/$defs/IncludeBlock"
-              },
-              {
-                "$ref": "#/$defs/ImportBlock"
-              },
-              {
-                "$ref": "#/$defs/ErrorBlock"
-              },
-              {
-                "$ref": "#/$defs/EmptyBlock"
-              },
-              {
-                "type": "null"
-              }
-            ]
+            "$ref": "#/$defs/BlockType"
           },
           "default": {},
           "description": "Set of definitions executed before the execution of the block.\n    ",
@@ -4198,17 +1646,9 @@
           "type": "object"
         },
         "def": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Name of the variable used to store the result of the execution of the block.\n    ",
-          "title": "Def"
+          "description": "Name of the variable used to store the result of the execution of the block.\n    "
         },
         "contribute": {
           "default": [
@@ -4217,234 +1657,64 @@
           ],
           "description": "Indicate if the block contributes to the result and background context.\n    ",
           "items": {
-            "anyOf": [
-              {
-                "$ref": "#/$defs/ContributeTarget"
-              },
-              {
-                "additionalProperties": {
-                  "$ref": "#/$defs/ContributeValue"
-                },
-                "type": "object"
-              }
-            ]
+            "$ref": "#/$defs/ContributeElement"
           },
           "title": "Contribute",
           "type": "array"
         },
         "parser": {
-          "anyOf": [
-            {
-              "enum": [
-                "json",
-                "jsonl",
-                "yaml"
-              ],
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/PdlParser"
-            },
-            {
-              "$ref": "#/$defs/RegexParser"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalParserType",
           "default": null,
-          "description": "Parser to use to construct a value out of a string result.",
-          "title": "Parser"
+          "description": "Parser to use to construct a value out of a string result."
         },
         "fallback": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBlockType",
           "default": null,
-          "description": "Block to execute in case of error.\n    ",
-          "title": "Fallback"
+          "description": "Block to execute in case of error.\n    "
         },
         "retry": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalInt",
           "default": null,
-          "description": "The maximum number of times to retry when an error occurs within a block.\n    ",
-          "title": "Retry"
+          "description": "The maximum number of times to retry when an error occurs within a block.\n    "
         },
         "trace_error_on_retry": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBoolOrStr",
           "default": null,
-          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    ",
-          "title": "Trace Error On Retry"
+          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    "
+        },
+        "requirements": {
+          "$ref": "#/$defs/RequirementsType",
+          "default": [],
+          "description": "Specify any requirements that the result of the block must satisfy.\n    "
         },
         "role": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.",
-          "title": "Role"
+          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`."
         },
         "pdl__context": {
-          "anyOf": [
-            {
-              "items": {
-                "additionalProperties": true,
-                "type": "object"
-              },
-              "type": "array"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalModelInput",
           "default": [],
-          "description": "Current context\n    ",
-          "title": "Pdl  Context"
+          "description": "Current context."
         },
         "pdl__id": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": "",
-          "description": "Unique identifier for this block\n    ",
-          "title": "Pdl  Id"
+          "description": "Unique identifier for this block."
         },
         "pdl__result": {
-          "anyOf": [
-            {},
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalAny",
           "default": null,
-          "description": "Result of the execution of the block",
-          "title": "Pdl  Result"
+          "description": "Result of the execution of the block."
         },
         "pdl__location": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlLocationType"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalPdlLocationType",
           "default": null
         },
         "pdl__timing": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlTiming"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null
+          "$ref": "#/$defs/OptionalPdlTiming",
+          "default": null,
+          "description": "Execution timing information."
         },
         "pdl__is_leaf": {
           "const": true,
@@ -4459,130 +1729,23 @@
           "type": "string"
         },
         "input": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/BlockType",
           "default": "${ pdl_context }",
-          "description": "Messages to send to the model.\n    ",
-          "title": "Input"
+          "description": "Messages to send to the model.\n    "
         },
         "modelResponse": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Variable where to store the raw response of the model.\n    ",
-          "title": "Modelresponse"
+          "description": "Variable where to store the raw response of the model.\n    "
         },
         "pdl__usage": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlUsage"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalPdlUsage",
           "default": null,
           "description": "Tokens consumed during model call\n    "
         },
         "pdl__model_input": {
-          "anyOf": [
-            {
-              "items": {
-                "additionalProperties": true,
-                "type": "object"
-              },
-              "type": "array"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Pdl  Model Input"
+          "$ref": "#/$defs/OptionalModelInput",
+          "default": null
         },
         "platform": {
           "const": "granite-io",
@@ -4637,34 +1800,12 @@
     "GraniteioProcessor": {
       "properties": {
         "type": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/LocalizedExpression_TypeVar_"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Type"
+          "$ref": "#/$defs/OptionalExpressionStr",
+          "default": null
         },
         "model": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/LocalizedExpression_TypeVar_"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Model"
+          "$ref": "#/$defs/OptionalExpressionStr",
+          "default": null
         },
         "backend": {
           "anyOf": [
@@ -4694,17 +1835,9 @@
       "description": "Conditional control structure.\n\nExample:\n```PDL\ndefs:\n  answer:\n    read:\n    message: \"Enter a number? \"\nif: ${ (answer | int) == 42 }\nthen: You won!\n```",
       "properties": {
         "description": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Documentation associated to the block.\n    ",
-          "title": "Description"
+          "description": "Documentation associated to the block.\n    "
         },
         "spec": {
           "$ref": "#/$defs/PdlTypeType",
@@ -4713,86 +1846,7 @@
         },
         "defs": {
           "additionalProperties": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/FunctionBlock"
-              },
-              {
-                "$ref": "#/$defs/CallBlock"
-              },
-              {
-                "$ref": "#/$defs/LitellmModelBlock"
-              },
-              {
-                "$ref": "#/$defs/GraniteioModelBlock"
-              },
-              {
-                "$ref": "#/$defs/CodeBlock"
-              },
-              {
-                "$ref": "#/$defs/ArgsBlock"
-              },
-              {
-                "$ref": "#/$defs/GetBlock"
-              },
-              {
-                "$ref": "#/$defs/DataBlock"
-              },
-              {
-                "$ref": "#/$defs/IfBlock"
-              },
-              {
-                "$ref": "#/$defs/MatchBlock"
-              },
-              {
-                "$ref": "#/$defs/RepeatBlock"
-              },
-              {
-                "$ref": "#/$defs/TextBlock"
-              },
-              {
-                "$ref": "#/$defs/LastOfBlock"
-              },
-              {
-                "$ref": "#/$defs/ArrayBlock"
-              },
-              {
-                "$ref": "#/$defs/ObjectBlock"
-              },
-              {
-                "$ref": "#/$defs/MessageBlock"
-              },
-              {
-                "$ref": "#/$defs/ReadBlock"
-              },
-              {
-                "$ref": "#/$defs/IncludeBlock"
-              },
-              {
-                "$ref": "#/$defs/ImportBlock"
-              },
-              {
-                "$ref": "#/$defs/ErrorBlock"
-              },
-              {
-                "$ref": "#/$defs/EmptyBlock"
-              },
-              {
-                "type": "null"
-              }
-            ]
+            "$ref": "#/$defs/BlockType"
           },
           "default": {},
           "description": "Set of definitions executed before the execution of the block.\n    ",
@@ -4800,17 +1854,9 @@
           "type": "object"
         },
         "def": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Name of the variable used to store the result of the execution of the block.\n    ",
-          "title": "Def"
+          "description": "Name of the variable used to store the result of the execution of the block.\n    "
         },
         "contribute": {
           "default": [
@@ -4819,234 +1865,64 @@
           ],
           "description": "Indicate if the block contributes to the result and background context.\n    ",
           "items": {
-            "anyOf": [
-              {
-                "$ref": "#/$defs/ContributeTarget"
-              },
-              {
-                "additionalProperties": {
-                  "$ref": "#/$defs/ContributeValue"
-                },
-                "type": "object"
-              }
-            ]
+            "$ref": "#/$defs/ContributeElement"
           },
           "title": "Contribute",
           "type": "array"
         },
         "parser": {
-          "anyOf": [
-            {
-              "enum": [
-                "json",
-                "jsonl",
-                "yaml"
-              ],
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/PdlParser"
-            },
-            {
-              "$ref": "#/$defs/RegexParser"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalParserType",
           "default": null,
-          "description": "Parser to use to construct a value out of a string result.",
-          "title": "Parser"
+          "description": "Parser to use to construct a value out of a string result."
         },
         "fallback": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBlockType",
           "default": null,
-          "description": "Block to execute in case of error.\n    ",
-          "title": "Fallback"
+          "description": "Block to execute in case of error.\n    "
         },
         "retry": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalInt",
           "default": null,
-          "description": "The maximum number of times to retry when an error occurs within a block.\n    ",
-          "title": "Retry"
+          "description": "The maximum number of times to retry when an error occurs within a block.\n    "
         },
         "trace_error_on_retry": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBoolOrStr",
           "default": null,
-          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    ",
-          "title": "Trace Error On Retry"
+          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    "
+        },
+        "requirements": {
+          "$ref": "#/$defs/RequirementsType",
+          "default": [],
+          "description": "Specify any requirements that the result of the block must satisfy.\n    "
         },
         "role": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.",
-          "title": "Role"
+          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`."
         },
         "pdl__context": {
-          "anyOf": [
-            {
-              "items": {
-                "additionalProperties": true,
-                "type": "object"
-              },
-              "type": "array"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalModelInput",
           "default": [],
-          "description": "Current context\n    ",
-          "title": "Pdl  Context"
+          "description": "Current context."
         },
         "pdl__id": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": "",
-          "description": "Unique identifier for this block\n    ",
-          "title": "Pdl  Id"
+          "description": "Unique identifier for this block."
         },
         "pdl__result": {
-          "anyOf": [
-            {},
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalAny",
           "default": null,
-          "description": "Result of the execution of the block",
-          "title": "Pdl  Result"
+          "description": "Result of the execution of the block."
         },
         "pdl__location": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlLocationType"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalPdlLocationType",
           "default": null
         },
         "pdl__timing": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlTiming"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null
+          "$ref": "#/$defs/OptionalPdlTiming",
+          "default": null,
+          "description": "Execution timing information."
         },
         "pdl__is_leaf": {
           "const": false,
@@ -5065,188 +1941,17 @@
           "type": "string"
         },
         "if": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/LocalizedExpression_TypeVar_"
-            },
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            }
-          ],
-          "description": "Condition.\n    ",
-          "title": "If"
+          "$ref": "#/$defs/ExpressionBool",
+          "description": "Condition.\n    "
         },
         "then": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "description": "Branch to execute if the condition is true.\n    ",
-          "title": "Then"
+          "$ref": "#/$defs/BlockType",
+          "description": "Branch to execute if the condition is true.\n    "
         },
         "else": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBlockType",
           "default": null,
-          "description": "Branch to execute if the condition is false.\n    ",
-          "title": "Else"
+          "description": "Branch to execute if the condition is false.\n    "
         }
       },
       "required": [
@@ -5261,17 +1966,9 @@
       "description": "Import a PDL file.",
       "properties": {
         "description": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Documentation associated to the block.\n    ",
-          "title": "Description"
+          "description": "Documentation associated to the block.\n    "
         },
         "spec": {
           "$ref": "#/$defs/PdlTypeType",
@@ -5280,86 +1977,7 @@
         },
         "defs": {
           "additionalProperties": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/FunctionBlock"
-              },
-              {
-                "$ref": "#/$defs/CallBlock"
-              },
-              {
-                "$ref": "#/$defs/LitellmModelBlock"
-              },
-              {
-                "$ref": "#/$defs/GraniteioModelBlock"
-              },
-              {
-                "$ref": "#/$defs/CodeBlock"
-              },
-              {
-                "$ref": "#/$defs/ArgsBlock"
-              },
-              {
-                "$ref": "#/$defs/GetBlock"
-              },
-              {
-                "$ref": "#/$defs/DataBlock"
-              },
-              {
-                "$ref": "#/$defs/IfBlock"
-              },
-              {
-                "$ref": "#/$defs/MatchBlock"
-              },
-              {
-                "$ref": "#/$defs/RepeatBlock"
-              },
-              {
-                "$ref": "#/$defs/TextBlock"
-              },
-              {
-                "$ref": "#/$defs/LastOfBlock"
-              },
-              {
-                "$ref": "#/$defs/ArrayBlock"
-              },
-              {
-                "$ref": "#/$defs/ObjectBlock"
-              },
-              {
-                "$ref": "#/$defs/MessageBlock"
-              },
-              {
-                "$ref": "#/$defs/ReadBlock"
-              },
-              {
-                "$ref": "#/$defs/IncludeBlock"
-              },
-              {
-                "$ref": "#/$defs/ImportBlock"
-              },
-              {
-                "$ref": "#/$defs/ErrorBlock"
-              },
-              {
-                "$ref": "#/$defs/EmptyBlock"
-              },
-              {
-                "type": "null"
-              }
-            ]
+            "$ref": "#/$defs/BlockType"
           },
           "default": {},
           "description": "Set of definitions executed before the execution of the block.\n    ",
@@ -5367,17 +1985,9 @@
           "type": "object"
         },
         "def": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Name of the variable used to store the result of the execution of the block.\n    ",
-          "title": "Def"
+          "description": "Name of the variable used to store the result of the execution of the block.\n    "
         },
         "contribute": {
           "default": [
@@ -5386,234 +1996,64 @@
           ],
           "description": "Indicate if the block contributes to the result and background context.\n    ",
           "items": {
-            "anyOf": [
-              {
-                "$ref": "#/$defs/ContributeTarget"
-              },
-              {
-                "additionalProperties": {
-                  "$ref": "#/$defs/ContributeValue"
-                },
-                "type": "object"
-              }
-            ]
+            "$ref": "#/$defs/ContributeElement"
           },
           "title": "Contribute",
           "type": "array"
         },
         "parser": {
-          "anyOf": [
-            {
-              "enum": [
-                "json",
-                "jsonl",
-                "yaml"
-              ],
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/PdlParser"
-            },
-            {
-              "$ref": "#/$defs/RegexParser"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalParserType",
           "default": null,
-          "description": "Parser to use to construct a value out of a string result.",
-          "title": "Parser"
+          "description": "Parser to use to construct a value out of a string result."
         },
         "fallback": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBlockType",
           "default": null,
-          "description": "Block to execute in case of error.\n    ",
-          "title": "Fallback"
+          "description": "Block to execute in case of error.\n    "
         },
         "retry": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalInt",
           "default": null,
-          "description": "The maximum number of times to retry when an error occurs within a block.\n    ",
-          "title": "Retry"
+          "description": "The maximum number of times to retry when an error occurs within a block.\n    "
         },
         "trace_error_on_retry": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBoolOrStr",
           "default": null,
-          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    ",
-          "title": "Trace Error On Retry"
+          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    "
+        },
+        "requirements": {
+          "$ref": "#/$defs/RequirementsType",
+          "default": [],
+          "description": "Specify any requirements that the result of the block must satisfy.\n    "
         },
         "role": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.",
-          "title": "Role"
+          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`."
         },
         "pdl__context": {
-          "anyOf": [
-            {
-              "items": {
-                "additionalProperties": true,
-                "type": "object"
-              },
-              "type": "array"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalModelInput",
           "default": [],
-          "description": "Current context\n    ",
-          "title": "Pdl  Context"
+          "description": "Current context."
         },
         "pdl__id": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": "",
-          "description": "Unique identifier for this block\n    ",
-          "title": "Pdl  Id"
+          "description": "Unique identifier for this block."
         },
         "pdl__result": {
-          "anyOf": [
-            {},
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalAny",
           "default": null,
-          "description": "Result of the execution of the block",
-          "title": "Pdl  Result"
+          "description": "Result of the execution of the block."
         },
         "pdl__location": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlLocationType"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalPdlLocationType",
           "default": null
         },
         "pdl__timing": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlTiming"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null
+          "$ref": "#/$defs/OptionalPdlTiming",
+          "default": null,
+          "description": "Execution timing information."
         },
         "pdl__is_leaf": {
           "const": true,
@@ -5633,88 +2073,8 @@
           "type": "string"
         },
         "pdl__trace": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Pdl  Trace"
+          "$ref": "#/$defs/OptionalBlockType",
+          "default": null
         }
       },
       "required": [
@@ -5728,17 +2088,9 @@
       "description": "Include a PDL file.",
       "properties": {
         "description": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Documentation associated to the block.\n    ",
-          "title": "Description"
+          "description": "Documentation associated to the block.\n    "
         },
         "spec": {
           "$ref": "#/$defs/PdlTypeType",
@@ -5747,86 +2099,7 @@
         },
         "defs": {
           "additionalProperties": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/FunctionBlock"
-              },
-              {
-                "$ref": "#/$defs/CallBlock"
-              },
-              {
-                "$ref": "#/$defs/LitellmModelBlock"
-              },
-              {
-                "$ref": "#/$defs/GraniteioModelBlock"
-              },
-              {
-                "$ref": "#/$defs/CodeBlock"
-              },
-              {
-                "$ref": "#/$defs/ArgsBlock"
-              },
-              {
-                "$ref": "#/$defs/GetBlock"
-              },
-              {
-                "$ref": "#/$defs/DataBlock"
-              },
-              {
-                "$ref": "#/$defs/IfBlock"
-              },
-              {
-                "$ref": "#/$defs/MatchBlock"
-              },
-              {
-                "$ref": "#/$defs/RepeatBlock"
-              },
-              {
-                "$ref": "#/$defs/TextBlock"
-              },
-              {
-                "$ref": "#/$defs/LastOfBlock"
-              },
-              {
-                "$ref": "#/$defs/ArrayBlock"
-              },
-              {
-                "$ref": "#/$defs/ObjectBlock"
-              },
-              {
-                "$ref": "#/$defs/MessageBlock"
-              },
-              {
-                "$ref": "#/$defs/ReadBlock"
-              },
-              {
-                "$ref": "#/$defs/IncludeBlock"
-              },
-              {
-                "$ref": "#/$defs/ImportBlock"
-              },
-              {
-                "$ref": "#/$defs/ErrorBlock"
-              },
-              {
-                "$ref": "#/$defs/EmptyBlock"
-              },
-              {
-                "type": "null"
-              }
-            ]
+            "$ref": "#/$defs/BlockType"
           },
           "default": {},
           "description": "Set of definitions executed before the execution of the block.\n    ",
@@ -5834,17 +2107,9 @@
           "type": "object"
         },
         "def": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Name of the variable used to store the result of the execution of the block.\n    ",
-          "title": "Def"
+          "description": "Name of the variable used to store the result of the execution of the block.\n    "
         },
         "contribute": {
           "default": [
@@ -5853,234 +2118,64 @@
           ],
           "description": "Indicate if the block contributes to the result and background context.\n    ",
           "items": {
-            "anyOf": [
-              {
-                "$ref": "#/$defs/ContributeTarget"
-              },
-              {
-                "additionalProperties": {
-                  "$ref": "#/$defs/ContributeValue"
-                },
-                "type": "object"
-              }
-            ]
+            "$ref": "#/$defs/ContributeElement"
           },
           "title": "Contribute",
           "type": "array"
         },
         "parser": {
-          "anyOf": [
-            {
-              "enum": [
-                "json",
-                "jsonl",
-                "yaml"
-              ],
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/PdlParser"
-            },
-            {
-              "$ref": "#/$defs/RegexParser"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalParserType",
           "default": null,
-          "description": "Parser to use to construct a value out of a string result.",
-          "title": "Parser"
+          "description": "Parser to use to construct a value out of a string result."
         },
         "fallback": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBlockType",
           "default": null,
-          "description": "Block to execute in case of error.\n    ",
-          "title": "Fallback"
+          "description": "Block to execute in case of error.\n    "
         },
         "retry": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalInt",
           "default": null,
-          "description": "The maximum number of times to retry when an error occurs within a block.\n    ",
-          "title": "Retry"
+          "description": "The maximum number of times to retry when an error occurs within a block.\n    "
         },
         "trace_error_on_retry": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBoolOrStr",
           "default": null,
-          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    ",
-          "title": "Trace Error On Retry"
+          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    "
+        },
+        "requirements": {
+          "$ref": "#/$defs/RequirementsType",
+          "default": [],
+          "description": "Specify any requirements that the result of the block must satisfy.\n    "
         },
         "role": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.",
-          "title": "Role"
+          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`."
         },
         "pdl__context": {
-          "anyOf": [
-            {
-              "items": {
-                "additionalProperties": true,
-                "type": "object"
-              },
-              "type": "array"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalModelInput",
           "default": [],
-          "description": "Current context\n    ",
-          "title": "Pdl  Context"
+          "description": "Current context."
         },
         "pdl__id": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": "",
-          "description": "Unique identifier for this block\n    ",
-          "title": "Pdl  Id"
+          "description": "Unique identifier for this block."
         },
         "pdl__result": {
-          "anyOf": [
-            {},
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalAny",
           "default": null,
-          "description": "Result of the execution of the block",
-          "title": "Pdl  Result"
+          "description": "Result of the execution of the block."
         },
         "pdl__location": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlLocationType"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalPdlLocationType",
           "default": null
         },
         "pdl__timing": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlTiming"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null
+          "$ref": "#/$defs/OptionalPdlTiming",
+          "default": null,
+          "description": "Execution timing information."
         },
         "pdl__is_leaf": {
           "const": false,
@@ -6104,88 +2199,8 @@
           "type": "string"
         },
         "pdl__trace": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Pdl  Trace"
+          "$ref": "#/$defs/OptionalBlockType",
+          "default": null
         }
       },
       "required": [
@@ -6253,6 +2268,35 @@
       "title": "JoinObject",
       "type": "object"
     },
+    "JoinReduce": {
+      "additionalProperties": false,
+      "description": "Join loop iterations as the value of the last iteration.",
+      "properties": {
+        "as": {
+          "const": "reduce",
+          "default": "reduce",
+          "title": "As",
+          "type": "string"
+        },
+        "reduce": {
+          "anyOf": [
+            {
+              "$ref": "#/$defs/LocalizedExpression_TypeVar_"
+            },
+            {
+              "type": "string"
+            }
+          ],
+          "description": "Function used to combine the results.",
+          "title": "Reduce"
+        }
+      },
+      "required": [
+        "reduce"
+      ],
+      "title": "JoinReduce",
+      "type": "object"
+    },
     "JoinText": {
       "additionalProperties": false,
       "description": "Join loop iterations as a string.",
@@ -6274,6 +2318,25 @@
       "title": "JoinText",
       "type": "object"
     },
+    "JoinType": {
+      "anyOf": [
+        {
+          "$ref": "#/$defs/JoinText"
+        },
+        {
+          "$ref": "#/$defs/JoinArray"
+        },
+        {
+          "$ref": "#/$defs/JoinObject"
+        },
+        {
+          "$ref": "#/$defs/JoinLastOf"
+        },
+        {
+          "$ref": "#/$defs/JoinReduce"
+        }
+      ]
+    },
     "JsonSchemaTypePdlType": {
       "additionalProperties": true,
       "description": "Json Schema with a type field.",
@@ -6304,17 +2367,9 @@
       "description": "Return the value of the last block if the list of blocks.",
       "properties": {
         "description": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Documentation associated to the block.\n    ",
-          "title": "Description"
+          "description": "Documentation associated to the block.\n    "
         },
         "spec": {
           "$ref": "#/$defs/PdlTypeType",
@@ -6323,86 +2378,7 @@
         },
         "defs": {
           "additionalProperties": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/FunctionBlock"
-              },
-              {
-                "$ref": "#/$defs/CallBlock"
-              },
-              {
-                "$ref": "#/$defs/LitellmModelBlock"
-              },
-              {
-                "$ref": "#/$defs/GraniteioModelBlock"
-              },
-              {
-                "$ref": "#/$defs/CodeBlock"
-              },
-              {
-                "$ref": "#/$defs/ArgsBlock"
-              },
-              {
-                "$ref": "#/$defs/GetBlock"
-              },
-              {
-                "$ref": "#/$defs/DataBlock"
-              },
-              {
-                "$ref": "#/$defs/IfBlock"
-              },
-              {
-                "$ref": "#/$defs/MatchBlock"
-              },
-              {
-                "$ref": "#/$defs/RepeatBlock"
-              },
-              {
-                "$ref": "#/$defs/TextBlock"
-              },
-              {
-                "$ref": "#/$defs/LastOfBlock"
-              },
-              {
-                "$ref": "#/$defs/ArrayBlock"
-              },
-              {
-                "$ref": "#/$defs/ObjectBlock"
-              },
-              {
-                "$ref": "#/$defs/MessageBlock"
-              },
-              {
-                "$ref": "#/$defs/ReadBlock"
-              },
-              {
-                "$ref": "#/$defs/IncludeBlock"
-              },
-              {
-                "$ref": "#/$defs/ImportBlock"
-              },
-              {
-                "$ref": "#/$defs/ErrorBlock"
-              },
-              {
-                "$ref": "#/$defs/EmptyBlock"
-              },
-              {
-                "type": "null"
-              }
-            ]
+            "$ref": "#/$defs/BlockType"
           },
           "default": {},
           "description": "Set of definitions executed before the execution of the block.\n    ",
@@ -6410,17 +2386,9 @@
           "type": "object"
         },
         "def": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Name of the variable used to store the result of the execution of the block.\n    ",
-          "title": "Def"
+          "description": "Name of the variable used to store the result of the execution of the block.\n    "
         },
         "contribute": {
           "default": [
@@ -6429,234 +2397,64 @@
           ],
           "description": "Indicate if the block contributes to the result and background context.\n    ",
           "items": {
-            "anyOf": [
-              {
-                "$ref": "#/$defs/ContributeTarget"
-              },
-              {
-                "additionalProperties": {
-                  "$ref": "#/$defs/ContributeValue"
-                },
-                "type": "object"
-              }
-            ]
+            "$ref": "#/$defs/ContributeElement"
           },
           "title": "Contribute",
           "type": "array"
         },
         "parser": {
-          "anyOf": [
-            {
-              "enum": [
-                "json",
-                "jsonl",
-                "yaml"
-              ],
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/PdlParser"
-            },
-            {
-              "$ref": "#/$defs/RegexParser"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalParserType",
           "default": null,
-          "description": "Parser to use to construct a value out of a string result.",
-          "title": "Parser"
+          "description": "Parser to use to construct a value out of a string result."
         },
         "fallback": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBlockType",
           "default": null,
-          "description": "Block to execute in case of error.\n    ",
-          "title": "Fallback"
+          "description": "Block to execute in case of error.\n    "
         },
         "retry": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalInt",
           "default": null,
-          "description": "The maximum number of times to retry when an error occurs within a block.\n    ",
-          "title": "Retry"
+          "description": "The maximum number of times to retry when an error occurs within a block.\n    "
         },
         "trace_error_on_retry": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBoolOrStr",
           "default": null,
-          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    ",
-          "title": "Trace Error On Retry"
+          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    "
+        },
+        "requirements": {
+          "$ref": "#/$defs/RequirementsType",
+          "default": [],
+          "description": "Specify any requirements that the result of the block must satisfy.\n    "
         },
         "role": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.",
-          "title": "Role"
+          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`."
         },
         "pdl__context": {
-          "anyOf": [
-            {
-              "items": {
-                "additionalProperties": true,
-                "type": "object"
-              },
-              "type": "array"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalModelInput",
           "default": [],
-          "description": "Current context\n    ",
-          "title": "Pdl  Context"
+          "description": "Current context."
         },
         "pdl__id": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": "",
-          "description": "Unique identifier for this block\n    ",
-          "title": "Pdl  Id"
+          "description": "Unique identifier for this block."
         },
         "pdl__result": {
-          "anyOf": [
-            {},
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalAny",
           "default": null,
-          "description": "Result of the execution of the block",
-          "title": "Pdl  Result"
+          "description": "Result of the execution of the block."
         },
         "pdl__location": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlLocationType"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalPdlLocationType",
           "default": null
         },
         "pdl__timing": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlTiming"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null
+          "$ref": "#/$defs/OptionalPdlTiming",
+          "default": null,
+          "description": "Execution timing information."
         },
         "pdl__is_leaf": {
           "const": false,
@@ -6677,86 +2475,7 @@
         "lastOf": {
           "description": "Sequence of blocks to execute.",
           "items": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/FunctionBlock"
-              },
-              {
-                "$ref": "#/$defs/CallBlock"
-              },
-              {
-                "$ref": "#/$defs/LitellmModelBlock"
-              },
-              {
-                "$ref": "#/$defs/GraniteioModelBlock"
-              },
-              {
-                "$ref": "#/$defs/CodeBlock"
-              },
-              {
-                "$ref": "#/$defs/ArgsBlock"
-              },
-              {
-                "$ref": "#/$defs/GetBlock"
-              },
-              {
-                "$ref": "#/$defs/DataBlock"
-              },
-              {
-                "$ref": "#/$defs/IfBlock"
-              },
-              {
-                "$ref": "#/$defs/MatchBlock"
-              },
-              {
-                "$ref": "#/$defs/RepeatBlock"
-              },
-              {
-                "$ref": "#/$defs/TextBlock"
-              },
-              {
-                "$ref": "#/$defs/LastOfBlock"
-              },
-              {
-                "$ref": "#/$defs/ArrayBlock"
-              },
-              {
-                "$ref": "#/$defs/ObjectBlock"
-              },
-              {
-                "$ref": "#/$defs/MessageBlock"
-              },
-              {
-                "$ref": "#/$defs/ReadBlock"
-              },
-              {
-                "$ref": "#/$defs/IncludeBlock"
-              },
-              {
-                "$ref": "#/$defs/ImportBlock"
-              },
-              {
-                "$ref": "#/$defs/ErrorBlock"
-              },
-              {
-                "$ref": "#/$defs/EmptyBlock"
-              },
-              {
-                "type": "null"
-              }
-            ]
+            "$ref": "#/$defs/BlockType"
           },
           "title": "Lastof",
           "type": "array"
@@ -6773,17 +2492,9 @@
       "description": "Call an LLM through [the LiteLLM API](https://docs.litellm.ai/).\n\nExample:\n```PDL\nmodel: ollama/granite-code:8b\nparameters:\n  stop: ['!']\n```",
       "properties": {
         "description": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Documentation associated to the block.\n    ",
-          "title": "Description"
+          "description": "Documentation associated to the block.\n    "
         },
         "spec": {
           "$ref": "#/$defs/PdlTypeType",
@@ -6792,86 +2503,7 @@
         },
         "defs": {
           "additionalProperties": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/FunctionBlock"
-              },
-              {
-                "$ref": "#/$defs/CallBlock"
-              },
-              {
-                "$ref": "#/$defs/LitellmModelBlock"
-              },
-              {
-                "$ref": "#/$defs/GraniteioModelBlock"
-              },
-              {
-                "$ref": "#/$defs/CodeBlock"
-              },
-              {
-                "$ref": "#/$defs/ArgsBlock"
-              },
-              {
-                "$ref": "#/$defs/GetBlock"
-              },
-              {
-                "$ref": "#/$defs/DataBlock"
-              },
-              {
-                "$ref": "#/$defs/IfBlock"
-              },
-              {
-                "$ref": "#/$defs/MatchBlock"
-              },
-              {
-                "$ref": "#/$defs/RepeatBlock"
-              },
-              {
-                "$ref": "#/$defs/TextBlock"
-              },
-              {
-                "$ref": "#/$defs/LastOfBlock"
-              },
-              {
-                "$ref": "#/$defs/ArrayBlock"
-              },
-              {
-                "$ref": "#/$defs/ObjectBlock"
-              },
-              {
-                "$ref": "#/$defs/MessageBlock"
-              },
-              {
-                "$ref": "#/$defs/ReadBlock"
-              },
-              {
-                "$ref": "#/$defs/IncludeBlock"
-              },
-              {
-                "$ref": "#/$defs/ImportBlock"
-              },
-              {
-                "$ref": "#/$defs/ErrorBlock"
-              },
-              {
-                "$ref": "#/$defs/EmptyBlock"
-              },
-              {
-                "type": "null"
-              }
-            ]
+            "$ref": "#/$defs/BlockType"
           },
           "default": {},
           "description": "Set of definitions executed before the execution of the block.\n    ",
@@ -6879,17 +2511,9 @@
           "type": "object"
         },
         "def": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Name of the variable used to store the result of the execution of the block.\n    ",
-          "title": "Def"
+          "description": "Name of the variable used to store the result of the execution of the block.\n    "
         },
         "contribute": {
           "default": [
@@ -6898,53 +2522,143 @@
           ],
           "description": "Indicate if the block contributes to the result and background context.\n    ",
           "items": {
-            "anyOf": [
-              {
-                "$ref": "#/$defs/ContributeTarget"
-              },
-              {
-                "additionalProperties": {
-                  "$ref": "#/$defs/ContributeValue"
-                },
-                "type": "object"
-              }
-            ]
+            "$ref": "#/$defs/ContributeElement"
           },
           "title": "Contribute",
           "type": "array"
         },
         "parser": {
+          "$ref": "#/$defs/OptionalParserType",
+          "default": null,
+          "description": "Parser to use to construct a value out of a string result."
+        },
+        "fallback": {
+          "$ref": "#/$defs/OptionalBlockType",
+          "default": null,
+          "description": "Block to execute in case of error.\n    "
+        },
+        "retry": {
+          "$ref": "#/$defs/OptionalInt",
+          "default": null,
+          "description": "The maximum number of times to retry when an error occurs within a block.\n    "
+        },
+        "trace_error_on_retry": {
+          "$ref": "#/$defs/OptionalBoolOrStr",
+          "default": null,
+          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    "
+        },
+        "requirements": {
+          "$ref": "#/$defs/RequirementsType",
+          "default": [],
+          "description": "Specify any requirements that the result of the block must satisfy.\n    "
+        },
+        "role": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": null,
+          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`."
+        },
+        "pdl__context": {
+          "$ref": "#/$defs/OptionalModelInput",
+          "default": [],
+          "description": "Current context."
+        },
+        "pdl__id": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": "",
+          "description": "Unique identifier for this block."
+        },
+        "pdl__result": {
+          "$ref": "#/$defs/OptionalAny",
+          "default": null,
+          "description": "Result of the execution of the block."
+        },
+        "pdl__location": {
+          "$ref": "#/$defs/OptionalPdlLocationType",
+          "default": null
+        },
+        "pdl__timing": {
+          "$ref": "#/$defs/OptionalPdlTiming",
+          "default": null,
+          "description": "Execution timing information."
+        },
+        "pdl__is_leaf": {
+          "const": true,
+          "default": true,
+          "title": "Pdl  Is Leaf",
+          "type": "boolean"
+        },
+        "kind": {
+          "const": "model",
+          "default": "model",
+          "title": "Kind",
+          "type": "string"
+        },
+        "input": {
+          "$ref": "#/$defs/BlockType",
+          "default": "${ pdl_context }",
+          "description": "Messages to send to the model.\n    "
+        },
+        "modelResponse": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": null,
+          "description": "Variable where to store the raw response of the model.\n    "
+        },
+        "pdl__usage": {
+          "$ref": "#/$defs/OptionalPdlUsage",
+          "default": null,
+          "description": "Tokens consumed during model call\n    "
+        },
+        "pdl__model_input": {
+          "$ref": "#/$defs/OptionalModelInput",
+          "default": null
+        },
+        "platform": {
+          "const": "litellm",
+          "default": "litellm",
+          "description": "Optional field to ensure that the block is using LiteLLM.\n    ",
+          "title": "Platform",
+          "type": "string"
+        },
+        "model": {
+          "$ref": "#/$defs/ExpressionStr",
+          "description": "Name of the model following the LiteLLM convention.\n    "
+        },
+        "parameters": {
           "anyOf": [
             {
-              "enum": [
-                "json",
-                "jsonl",
-                "yaml"
-              ],
-              "type": "string"
+              "$ref": "#/$defs/LitellmParameters"
+            },
+            {
+              "$ref": "#/$defs/LocalizedExpression_TypeVar_"
             },
             {
-              "$ref": "#/$defs/PdlParser"
+              "additionalProperties": true,
+              "type": "object"
             },
             {
-              "$ref": "#/$defs/RegexParser"
+              "type": "string"
             },
             {
               "type": "null"
             }
           ],
           "default": null,
-          "description": "Parser to use to construct a value out of a string result.",
-          "title": "Parser"
-        },
-        "fallback": {
+          "description": "Parameters to send to the model.\n    ",
+          "title": "Parameters"
+        }
+      },
+      "required": [
+        "model"
+      ],
+      "title": "LitellmModelBlock",
+      "type": "object"
+    },
+    "LitellmParameters": {
+      "additionalProperties": true,
+      "description": "Parameters passed to LiteLLM. More details at [https://docs.litellm.ai/docs/completion/input](https://docs.litellm.ai/docs/completion/input).\n\nNote that not all models and platforms accept all parameters.",
+      "properties": {
+        "timeout": {
           "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
             {
               "type": "number"
             },
@@ -6952,93 +2666,125 @@
               "type": "string"
             },
             {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
+              "type": "null"
+            }
+          ],
+          "default": null,
+          "title": "Timeout"
+        },
+        "temperature": {
+          "anyOf": [
             {
-              "$ref": "#/$defs/CodeBlock"
+              "type": "number"
             },
             {
-              "$ref": "#/$defs/ArgsBlock"
+              "type": "string"
             },
             {
-              "$ref": "#/$defs/GetBlock"
-            },
+              "type": "null"
+            }
+          ],
+          "default": null,
+          "title": "Temperature"
+        },
+        "top_p": {
+          "anyOf": [
             {
-              "$ref": "#/$defs/DataBlock"
+              "type": "number"
             },
             {
-              "$ref": "#/$defs/IfBlock"
+              "type": "string"
             },
             {
-              "$ref": "#/$defs/MatchBlock"
-            },
+              "type": "null"
+            }
+          ],
+          "default": null,
+          "title": "Top P"
+        },
+        "n": {
+          "anyOf": [
             {
-              "$ref": "#/$defs/RepeatBlock"
+              "type": "integer"
             },
             {
-              "$ref": "#/$defs/TextBlock"
+              "type": "string"
             },
             {
-              "$ref": "#/$defs/LastOfBlock"
-            },
+              "type": "null"
+            }
+          ],
+          "default": null,
+          "title": "N"
+        },
+        "stop": {
+          "anyOf": [
             {
-              "$ref": "#/$defs/ArrayBlock"
+              "type": "string"
             },
             {
-              "$ref": "#/$defs/ObjectBlock"
+              "items": {
+                "type": "string"
+              },
+              "type": "array"
             },
             {
-              "$ref": "#/$defs/MessageBlock"
-            },
+              "type": "null"
+            }
+          ],
+          "default": null,
+          "title": "Stop"
+        },
+        "max_tokens": {
+          "anyOf": [
             {
-              "$ref": "#/$defs/ReadBlock"
+              "type": "integer"
             },
             {
-              "$ref": "#/$defs/IncludeBlock"
+              "type": "string"
             },
             {
-              "$ref": "#/$defs/ImportBlock"
-            },
+              "type": "null"
+            }
+          ],
+          "default": null,
+          "title": "Max Tokens"
+        },
+        "presence_penalty": {
+          "anyOf": [
             {
-              "$ref": "#/$defs/ErrorBlock"
+              "type": "number"
             },
             {
-              "$ref": "#/$defs/EmptyBlock"
+              "type": "string"
             },
             {
               "type": "null"
             }
           ],
           "default": null,
-          "description": "Block to execute in case of error.\n    ",
-          "title": "Fallback"
+          "title": "Presence Penalty"
         },
-        "retry": {
+        "frequency_penalty": {
           "anyOf": [
             {
-              "type": "integer"
+              "type": "number"
+            },
+            {
+              "type": "string"
             },
             {
               "type": "null"
             }
           ],
           "default": null,
-          "description": "The maximum number of times to retry when an error occurs within a block.\n    ",
-          "title": "Retry"
+          "title": "Frequency Penalty"
         },
-        "trace_error_on_retry": {
+        "logit_bias": {
           "anyOf": [
             {
-              "type": "boolean"
+              "additionalProperties": true,
+              "type": "object"
             },
             {
               "type": "string"
@@ -7048,10 +2794,9 @@
             }
           ],
           "default": null,
-          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    ",
-          "title": "Trace Error On Retry"
+          "title": "Logit Bias"
         },
-        "role": {
+        "user": {
           "anyOf": [
             {
               "type": "string"
@@ -7061,28 +2806,29 @@
             }
           ],
           "default": null,
-          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.",
-          "title": "Role"
+          "title": "User"
         },
-        "pdl__context": {
+        "response_format": {
           "anyOf": [
             {
-              "items": {
-                "additionalProperties": true,
-                "type": "object"
-              },
-              "type": "array"
+              "additionalProperties": true,
+              "type": "object"
+            },
+            {
+              "type": "string"
             },
             {
               "type": "null"
             }
           ],
-          "default": [],
-          "description": "Current context\n    ",
-          "title": "Pdl  Context"
+          "default": null,
+          "title": "Response Format"
         },
-        "pdl__id": {
+        "seed": {
           "anyOf": [
+            {
+              "type": "integer"
+            },
             {
               "type": "string"
             },
@@ -7090,142 +2836,15 @@
               "type": "null"
             }
           ],
-          "default": "",
-          "description": "Unique identifier for this block\n    ",
-          "title": "Pdl  Id"
-        },
-        "pdl__result": {
-          "anyOf": [
-            {},
-            {
-              "type": "null"
-            }
-          ],
           "default": null,
-          "description": "Result of the execution of the block",
-          "title": "Pdl  Result"
-        },
-        "pdl__location": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlLocationType"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null
-        },
-        "pdl__timing": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlTiming"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null
-        },
-        "pdl__is_leaf": {
-          "const": true,
-          "default": true,
-          "title": "Pdl  Is Leaf",
-          "type": "boolean"
-        },
-        "kind": {
-          "const": "model",
-          "default": "model",
-          "title": "Kind",
-          "type": "string"
+          "title": "Seed"
         },
-        "input": {
+        "tools": {
           "anyOf": [
             {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
+              "items": {},
+              "type": "array"
             },
-            {
-              "type": "null"
-            }
-          ],
-          "default": "${ pdl_context }",
-          "description": "Messages to send to the model.\n    ",
-          "title": "Input"
-        },
-        "modelResponse": {
-          "anyOf": [
             {
               "type": "string"
             },
@@ -7234,67 +2853,28 @@
             }
           ],
           "default": null,
-          "description": "Variable where to store the raw response of the model.\n    ",
-          "title": "Modelresponse"
+          "title": "Tools"
         },
-        "pdl__usage": {
+        "tool_choice": {
           "anyOf": [
             {
-              "$ref": "#/$defs/PdlUsage"
+              "type": "string"
             },
             {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "description": "Tokens consumed during model call\n    "
-        },
-        "pdl__model_input": {
-          "anyOf": [
-            {
-              "items": {
-                "additionalProperties": true,
-                "type": "object"
-              },
-              "type": "array"
+              "additionalProperties": true,
+              "type": "object"
             },
             {
               "type": "null"
             }
           ],
           "default": null,
-          "title": "Pdl  Model Input"
-        },
-        "platform": {
-          "const": "litellm",
-          "default": "litellm",
-          "description": "Optional field to ensure that the block is using LiteLLM.\n    ",
-          "title": "Platform",
-          "type": "string"
-        },
-        "model": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/LocalizedExpression_TypeVar_"
-            },
-            {
-              "type": "string"
-            }
-          ],
-          "description": "Name of the model following the LiteLLM convention.\n    ",
-          "title": "Model"
+          "title": "Tool Choice"
         },
-        "parameters": {
+        "logprobs": {
           "anyOf": [
             {
-              "$ref": "#/$defs/LitellmParameters"
-            },
-            {
-              "$ref": "#/$defs/LocalizedExpression_TypeVar_"
-            },
-            {
-              "additionalProperties": true,
-              "type": "object"
+              "type": "boolean"
             },
             {
               "type": "string"
@@ -7304,24 +2884,12 @@
             }
           ],
           "default": null,
-          "description": "Parameters to send to the model.\n    ",
-          "title": "Parameters"
-        }
-      },
-      "required": [
-        "model"
-      ],
-      "title": "LitellmModelBlock",
-      "type": "object"
-    },
-    "LitellmParameters": {
-      "additionalProperties": true,
-      "description": "Parameters passed to LiteLLM. More details at [https://docs.litellm.ai/docs/completion/input](https://docs.litellm.ai/docs/completion/input).\n\nNote that not all models and platforms accept all parameters.",
-      "properties": {
-        "timeout": {
+          "title": "Logprobs"
+        },
+        "top_logprobs": {
           "anyOf": [
             {
-              "type": "number"
+              "type": "integer"
             },
             {
               "type": "string"
@@ -7331,12 +2899,12 @@
             }
           ],
           "default": null,
-          "title": "Timeout"
+          "title": "Top Logprobs"
         },
-        "temperature": {
+        "parallel_tool_calls": {
           "anyOf": [
             {
-              "type": "number"
+              "type": "boolean"
             },
             {
               "type": "string"
@@ -7346,12 +2914,13 @@
             }
           ],
           "default": null,
-          "title": "Temperature"
+          "title": "Parallel Tool Calls"
         },
-        "top_p": {
+        "extra_headers": {
           "anyOf": [
             {
-              "type": "number"
+              "additionalProperties": true,
+              "type": "object"
             },
             {
               "type": "string"
@@ -7361,12 +2930,13 @@
             }
           ],
           "default": null,
-          "title": "Top P"
+          "title": "Extra Headers"
         },
-        "n": {
+        "functions": {
           "anyOf": [
             {
-              "type": "integer"
+              "items": {},
+              "type": "array"
             },
             {
               "type": "string"
@@ -7376,31 +2946,22 @@
             }
           ],
           "default": null,
-          "title": "N"
+          "title": "Functions"
         },
-        "stop": {
+        "function_call": {
           "anyOf": [
             {
               "type": "string"
             },
-            {
-              "items": {
-                "type": "string"
-              },
-              "type": "array"
-            },
             {
               "type": "null"
             }
           ],
           "default": null,
-          "title": "Stop"
+          "title": "Function Call"
         },
-        "max_tokens": {
+        "base_url": {
           "anyOf": [
-            {
-              "type": "integer"
-            },
             {
               "type": "string"
             },
@@ -7409,13 +2970,10 @@
             }
           ],
           "default": null,
-          "title": "Max Tokens"
+          "title": "Base Url"
         },
-        "presence_penalty": {
+        "api_version": {
           "anyOf": [
-            {
-              "type": "number"
-            },
             {
               "type": "string"
             },
@@ -7424,13 +2982,10 @@
             }
           ],
           "default": null,
-          "title": "Presence Penalty"
+          "title": "Api Version"
         },
-        "frequency_penalty": {
+        "api_key": {
           "anyOf": [
-            {
-              "type": "number"
-            },
             {
               "type": "string"
             },
@@ -7439,13 +2994,13 @@
             }
           ],
           "default": null,
-          "title": "Frequency Penalty"
+          "title": "Api Key"
         },
-        "logit_bias": {
+        "model_list": {
           "anyOf": [
             {
-              "additionalProperties": true,
-              "type": "object"
+              "items": {},
+              "type": "array"
             },
             {
               "type": "string"
@@ -7455,9 +3010,9 @@
             }
           ],
           "default": null,
-          "title": "Logit Bias"
+          "title": "Model List"
         },
-        "user": {
+        "mock_response": {
           "anyOf": [
             {
               "type": "string"
@@ -7467,14 +3022,10 @@
             }
           ],
           "default": null,
-          "title": "User"
+          "title": "Mock Response"
         },
-        "response_format": {
+        "custom_llm_provider": {
           "anyOf": [
-            {
-              "additionalProperties": true,
-              "type": "object"
-            },
             {
               "type": "string"
             },
@@ -7483,221 +3034,9 @@
             }
           ],
           "default": null,
-          "title": "Response Format"
+          "title": "Custom Llm Provider"
         },
-        "seed": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Seed"
-        },
-        "tools": {
-          "anyOf": [
-            {
-              "items": {},
-              "type": "array"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Tools"
-        },
-        "tool_choice": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "additionalProperties": true,
-              "type": "object"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Tool Choice"
-        },
-        "logprobs": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Logprobs"
-        },
-        "top_logprobs": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Top Logprobs"
-        },
-        "parallel_tool_calls": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Parallel Tool Calls"
-        },
-        "extra_headers": {
-          "anyOf": [
-            {
-              "additionalProperties": true,
-              "type": "object"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Extra Headers"
-        },
-        "functions": {
-          "anyOf": [
-            {
-              "items": {},
-              "type": "array"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Functions"
-        },
-        "function_call": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Function Call"
-        },
-        "base_url": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Base Url"
-        },
-        "api_version": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Api Version"
-        },
-        "api_key": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Api Key"
-        },
-        "model_list": {
-          "anyOf": [
-            {
-              "items": {},
-              "type": "array"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Model List"
-        },
-        "mock_response": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Mock Response"
-        },
-        "custom_llm_provider": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Custom Llm Provider"
-        },
-        "max_retries": {
+        "max_retries": {
           "anyOf": [
             {
               "type": "integer"
@@ -7733,14 +3072,7 @@
           "title": "Pdl  Result"
         },
         "pdl__location": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlLocationType"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalPdlLocationType",
           "default": null
         }
       },
@@ -7750,22 +3082,14 @@
       "title": "LocalizedExpression",
       "type": "object"
     },
-    "MatchBlock": {
+    "MapBlock": {
       "additionalProperties": false,
-      "description": "Match control structure.\n\nExample:\n```PDL\ndefs:\n  answer:\n    read:\n    message: \"Enter a number? \"\nmatch: ${ (answer | int) }\nwith:\n- case: 42\n  then: You won!\n- case:\n    any:\n    def: x\n  if: ${ x > 42 }\n  then: Too high\n- then: Too low",
+      "description": "Independent executions of  a block.\nRepeat the execution of a block starting from the initial scope\nand `pdl_context`.\n\nFor loop example:\n```PDL\nfor:\n    number: [1, 2, 3, 4]\n    name: [\"Bob\", \"Carol\", \"David\", \"Ernest\"]\nmap:\n    \"${ name }'s number is ${ number }\\n\"\n```\n\nBounded loop:\n```PDL\nindex: i\nmaxIterations: 5\nmap:\n    ${ i }\njoin:\n  as: array\n```",
       "properties": {
         "description": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Documentation associated to the block.\n    ",
-          "title": "Description"
+          "description": "Documentation associated to the block.\n    "
         },
         "spec": {
           "$ref": "#/$defs/PdlTypeType",
@@ -7774,86 +3098,7 @@
         },
         "defs": {
           "additionalProperties": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/FunctionBlock"
-              },
-              {
-                "$ref": "#/$defs/CallBlock"
-              },
-              {
-                "$ref": "#/$defs/LitellmModelBlock"
-              },
-              {
-                "$ref": "#/$defs/GraniteioModelBlock"
-              },
-              {
-                "$ref": "#/$defs/CodeBlock"
-              },
-              {
-                "$ref": "#/$defs/ArgsBlock"
-              },
-              {
-                "$ref": "#/$defs/GetBlock"
-              },
-              {
-                "$ref": "#/$defs/DataBlock"
-              },
-              {
-                "$ref": "#/$defs/IfBlock"
-              },
-              {
-                "$ref": "#/$defs/MatchBlock"
-              },
-              {
-                "$ref": "#/$defs/RepeatBlock"
-              },
-              {
-                "$ref": "#/$defs/TextBlock"
-              },
-              {
-                "$ref": "#/$defs/LastOfBlock"
-              },
-              {
-                "$ref": "#/$defs/ArrayBlock"
-              },
-              {
-                "$ref": "#/$defs/ObjectBlock"
-              },
-              {
-                "$ref": "#/$defs/MessageBlock"
-              },
-              {
-                "$ref": "#/$defs/ReadBlock"
-              },
-              {
-                "$ref": "#/$defs/IncludeBlock"
-              },
-              {
-                "$ref": "#/$defs/ImportBlock"
-              },
-              {
-                "$ref": "#/$defs/ErrorBlock"
-              },
-              {
-                "$ref": "#/$defs/EmptyBlock"
-              },
-              {
-                "type": "null"
-              }
-            ]
+            "$ref": "#/$defs/BlockType"
           },
           "default": {},
           "description": "Set of definitions executed before the execution of the block.\n    ",
@@ -7861,17 +3106,9 @@
           "type": "object"
         },
         "def": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Name of the variable used to store the result of the execution of the block.\n    ",
-          "title": "Def"
+          "description": "Name of the variable used to store the result of the execution of the block.\n    "
         },
         "contribute": {
           "default": [
@@ -7880,178 +3117,140 @@
           ],
           "description": "Indicate if the block contributes to the result and background context.\n    ",
           "items": {
-            "anyOf": [
-              {
-                "$ref": "#/$defs/ContributeTarget"
-              },
-              {
-                "additionalProperties": {
-                  "$ref": "#/$defs/ContributeValue"
-                },
-                "type": "object"
-              }
-            ]
+            "$ref": "#/$defs/ContributeElement"
           },
           "title": "Contribute",
           "type": "array"
         },
         "parser": {
-          "anyOf": [
-            {
-              "enum": [
-                "json",
-                "jsonl",
-                "yaml"
-              ],
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/PdlParser"
-            },
-            {
-              "$ref": "#/$defs/RegexParser"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalParserType",
           "default": null,
-          "description": "Parser to use to construct a value out of a string result.",
-          "title": "Parser"
+          "description": "Parser to use to construct a value out of a string result."
         },
         "fallback": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBlockType",
           "default": null,
-          "description": "Block to execute in case of error.\n    ",
-          "title": "Fallback"
+          "description": "Block to execute in case of error.\n    "
         },
         "retry": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalInt",
           "default": null,
-          "description": "The maximum number of times to retry when an error occurs within a block.\n    ",
-          "title": "Retry"
+          "description": "The maximum number of times to retry when an error occurs within a block.\n    "
         },
         "trace_error_on_retry": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBoolOrStr",
           "default": null,
-          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    ",
-          "title": "Trace Error On Retry"
+          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    "
+        },
+        "requirements": {
+          "$ref": "#/$defs/RequirementsType",
+          "default": [],
+          "description": "Specify any requirements that the result of the block must satisfy.\n    "
         },
         "role": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": null,
+          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`."
+        },
+        "pdl__context": {
+          "$ref": "#/$defs/OptionalModelInput",
+          "default": [],
+          "description": "Current context."
+        },
+        "pdl__id": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": "",
+          "description": "Unique identifier for this block."
+        },
+        "pdl__result": {
+          "$ref": "#/$defs/OptionalAny",
+          "default": null,
+          "description": "Result of the execution of the block."
+        },
+        "pdl__location": {
+          "$ref": "#/$defs/OptionalPdlLocationType",
+          "default": null
+        },
+        "pdl__timing": {
+          "$ref": "#/$defs/OptionalPdlTiming",
+          "default": null,
+          "description": "Execution timing information."
+        },
+        "pdl__is_leaf": {
+          "const": false,
+          "default": false,
+          "title": "Pdl  Is Leaf",
+          "type": "boolean"
+        },
+        "context": {
+          "$ref": "#/$defs/IndependentEnum",
+          "default": "dependent"
+        },
+        "kind": {
+          "const": "map",
+          "default": "map",
+          "title": "Kind",
+          "type": "string"
+        },
+        "for": {
           "anyOf": [
             {
-              "type": "string"
+              "additionalProperties": {
+                "anyOf": [
+                  {
+                    "$ref": "#/$defs/LocalizedExpression_TypeVar_"
+                  },
+                  {
+                    "items": {},
+                    "type": "array"
+                  },
+                  {
+                    "type": "string"
+                  }
+                ]
+              },
+              "type": "object"
             },
             {
               "type": "null"
             }
           ],
           "default": null,
-          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.",
-          "title": "Role"
+          "description": "Arrays to iterate over.\n    ",
+          "title": "For"
+        },
+        "index": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": null,
+          "description": "Name of the variable containing the loop iteration.\n    "
         },
-        "pdl__context": {
+        "map": {
+          "$ref": "#/$defs/BlockType",
+          "description": "Body of the iterator.\n    "
+        },
+        "maxIterations": {
+          "$ref": "#/$defs/OptionalExpressionInt",
+          "default": null,
+          "description": "Maximal number of iterations to perform.\n    "
+        },
+        "join": {
+          "$ref": "#/$defs/JoinType",
+          "default": {
+            "as": "text",
+            "with": ""
+          },
+          "description": "Define how to combine the result of each iteration.\n    "
+        },
+        "maxWorkers": {
+          "$ref": "#/$defs/OptionalInt",
+          "default": null,
+          "description": "Maximal number of workers to execute the map in parallel. Is it is set to `0`, the execution is sequential otherwise it is given as argument to the `ThreadPoolExecutor`.\n    "
+        },
+        "pdl__trace": {
           "anyOf": [
             {
               "items": {
-                "additionalProperties": true,
-                "type": "object"
+                "$ref": "#/$defs/BlockType"
               },
               "type": "array"
             },
@@ -8059,55 +3258,109 @@
               "type": "null"
             }
           ],
+          "default": null,
+          "title": "Pdl  Trace"
+        }
+      },
+      "required": [
+        "map"
+      ],
+      "title": "MapBlock",
+      "type": "object"
+    },
+    "MatchBlock": {
+      "additionalProperties": false,
+      "description": "Match control structure.\n\nExample:\n```PDL\ndefs:\n  answer:\n    read:\n    message: \"Enter a number? \"\nmatch: ${ (answer | int) }\nwith:\n- case: 42\n  then: You won!\n- case:\n    any:\n    def: x\n  if: ${ x > 42 }\n  then: Too high\n- then: Too low",
+      "properties": {
+        "description": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": null,
+          "description": "Documentation associated to the block.\n    "
+        },
+        "spec": {
+          "$ref": "#/$defs/PdlTypeType",
+          "default": null,
+          "description": "Type specification of the result of the block.\n    "
+        },
+        "defs": {
+          "additionalProperties": {
+            "$ref": "#/$defs/BlockType"
+          },
+          "default": {},
+          "description": "Set of definitions executed before the execution of the block.\n    ",
+          "title": "Defs",
+          "type": "object"
+        },
+        "def": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": null,
+          "description": "Name of the variable used to store the result of the execution of the block.\n    "
+        },
+        "contribute": {
+          "default": [
+            "result",
+            "context"
+          ],
+          "description": "Indicate if the block contributes to the result and background context.\n    ",
+          "items": {
+            "$ref": "#/$defs/ContributeElement"
+          },
+          "title": "Contribute",
+          "type": "array"
+        },
+        "parser": {
+          "$ref": "#/$defs/OptionalParserType",
+          "default": null,
+          "description": "Parser to use to construct a value out of a string result."
+        },
+        "fallback": {
+          "$ref": "#/$defs/OptionalBlockType",
+          "default": null,
+          "description": "Block to execute in case of error.\n    "
+        },
+        "retry": {
+          "$ref": "#/$defs/OptionalInt",
+          "default": null,
+          "description": "The maximum number of times to retry when an error occurs within a block.\n    "
+        },
+        "trace_error_on_retry": {
+          "$ref": "#/$defs/OptionalBoolOrStr",
+          "default": null,
+          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    "
+        },
+        "requirements": {
+          "$ref": "#/$defs/RequirementsType",
           "default": [],
-          "description": "Current context\n    ",
-          "title": "Pdl  Context"
+          "description": "Specify any requirements that the result of the block must satisfy.\n    "
+        },
+        "role": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": null,
+          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`."
+        },
+        "pdl__context": {
+          "$ref": "#/$defs/OptionalModelInput",
+          "default": [],
+          "description": "Current context."
         },
         "pdl__id": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": "",
-          "description": "Unique identifier for this block\n    ",
-          "title": "Pdl  Id"
+          "description": "Unique identifier for this block."
         },
         "pdl__result": {
-          "anyOf": [
-            {},
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalAny",
           "default": null,
-          "description": "Result of the execution of the block",
-          "title": "Pdl  Result"
+          "description": "Result of the execution of the block."
         },
         "pdl__location": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlLocationType"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalPdlLocationType",
           "default": null
         },
         "pdl__timing": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlTiming"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null
+          "$ref": "#/$defs/OptionalPdlTiming",
+          "default": null,
+          "description": "Execution timing information."
         },
         "pdl__is_leaf": {
           "const": false,
@@ -8161,136 +3414,20 @@
         "case": {
           "anyOf": [
             {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/OrPattern"
-            },
-            {
-              "$ref": "#/$defs/ArrayPattern"
-            },
-            {
-              "$ref": "#/$defs/ObjectPattern"
-            },
-            {
-              "$ref": "#/$defs/AnyPattern"
+              "$ref": "#/$defs/PatternType"
             },
             {
               "type": "null"
             }
           ],
-          "default": null,
-          "title": "Case"
+          "default": null
         },
         "if": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/LocalizedExpression_TypeVar_"
-            },
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "If"
+          "$ref": "#/$defs/OptionalExpressionBool",
+          "default": null
         },
         "then": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "title": "Then"
+          "$ref": "#/$defs/BlockType"
         },
         "pdl__case_result": {
           "anyOf": [
@@ -8340,17 +3477,9 @@
       "description": "Create a message.",
       "properties": {
         "description": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Documentation associated to the block.\n    ",
-          "title": "Description"
+          "description": "Documentation associated to the block.\n    "
         },
         "spec": {
           "$ref": "#/$defs/PdlTypeType",
@@ -8359,86 +3488,7 @@
         },
         "defs": {
           "additionalProperties": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/FunctionBlock"
-              },
-              {
-                "$ref": "#/$defs/CallBlock"
-              },
-              {
-                "$ref": "#/$defs/LitellmModelBlock"
-              },
-              {
-                "$ref": "#/$defs/GraniteioModelBlock"
-              },
-              {
-                "$ref": "#/$defs/CodeBlock"
-              },
-              {
-                "$ref": "#/$defs/ArgsBlock"
-              },
-              {
-                "$ref": "#/$defs/GetBlock"
-              },
-              {
-                "$ref": "#/$defs/DataBlock"
-              },
-              {
-                "$ref": "#/$defs/IfBlock"
-              },
-              {
-                "$ref": "#/$defs/MatchBlock"
-              },
-              {
-                "$ref": "#/$defs/RepeatBlock"
-              },
-              {
-                "$ref": "#/$defs/TextBlock"
-              },
-              {
-                "$ref": "#/$defs/LastOfBlock"
-              },
-              {
-                "$ref": "#/$defs/ArrayBlock"
-              },
-              {
-                "$ref": "#/$defs/ObjectBlock"
-              },
-              {
-                "$ref": "#/$defs/MessageBlock"
-              },
-              {
-                "$ref": "#/$defs/ReadBlock"
-              },
-              {
-                "$ref": "#/$defs/IncludeBlock"
-              },
-              {
-                "$ref": "#/$defs/ImportBlock"
-              },
-              {
-                "$ref": "#/$defs/ErrorBlock"
-              },
-              {
-                "$ref": "#/$defs/EmptyBlock"
-              },
-              {
-                "type": "null"
-              }
-            ]
+            "$ref": "#/$defs/BlockType"
           },
           "default": {},
           "description": "Set of definitions executed before the execution of the block.\n    ",
@@ -8446,17 +3496,9 @@
           "type": "object"
         },
         "def": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Name of the variable used to store the result of the execution of the block.\n    ",
-          "title": "Def"
+          "description": "Name of the variable used to store the result of the execution of the block.\n    "
         },
         "contribute": {
           "default": [
@@ -8465,234 +3507,64 @@
           ],
           "description": "Indicate if the block contributes to the result and background context.\n    ",
           "items": {
-            "anyOf": [
-              {
-                "$ref": "#/$defs/ContributeTarget"
-              },
-              {
-                "additionalProperties": {
-                  "$ref": "#/$defs/ContributeValue"
-                },
-                "type": "object"
-              }
-            ]
+            "$ref": "#/$defs/ContributeElement"
           },
           "title": "Contribute",
           "type": "array"
         },
         "parser": {
-          "anyOf": [
-            {
-              "enum": [
-                "json",
-                "jsonl",
-                "yaml"
-              ],
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/PdlParser"
-            },
-            {
-              "$ref": "#/$defs/RegexParser"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalParserType",
           "default": null,
-          "description": "Parser to use to construct a value out of a string result.",
-          "title": "Parser"
+          "description": "Parser to use to construct a value out of a string result."
         },
         "fallback": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBlockType",
           "default": null,
-          "description": "Block to execute in case of error.\n    ",
-          "title": "Fallback"
+          "description": "Block to execute in case of error.\n    "
         },
         "retry": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalInt",
           "default": null,
-          "description": "The maximum number of times to retry when an error occurs within a block.\n    ",
-          "title": "Retry"
+          "description": "The maximum number of times to retry when an error occurs within a block.\n    "
         },
         "trace_error_on_retry": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBoolOrStr",
           "default": null,
-          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    ",
-          "title": "Trace Error On Retry"
+          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    "
+        },
+        "requirements": {
+          "$ref": "#/$defs/RequirementsType",
+          "default": [],
+          "description": "Specify any requirements that the result of the block must satisfy.\n    "
         },
         "role": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.",
-          "title": "Role"
+          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`."
         },
         "pdl__context": {
-          "anyOf": [
-            {
-              "items": {
-                "additionalProperties": true,
-                "type": "object"
-              },
-              "type": "array"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalModelInput",
           "default": [],
-          "description": "Current context\n    ",
-          "title": "Pdl  Context"
+          "description": "Current context."
         },
         "pdl__id": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": "",
-          "description": "Unique identifier for this block\n    ",
-          "title": "Pdl  Id"
+          "description": "Unique identifier for this block."
         },
         "pdl__result": {
-          "anyOf": [
-            {},
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalAny",
           "default": null,
-          "description": "Result of the execution of the block",
-          "title": "Pdl  Result"
+          "description": "Result of the execution of the block."
         },
         "pdl__location": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlLocationType"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalPdlLocationType",
           "default": null
         },
         "pdl__timing": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlTiming"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null
+          "$ref": "#/$defs/OptionalPdlTiming",
+          "default": null,
+          "description": "Execution timing information."
         },
         "pdl__is_leaf": {
           "const": true,
@@ -8707,120 +3579,18 @@
           "type": "string"
         },
         "content": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "description": "Content of the message.",
-          "title": "Content"
+          "$ref": "#/$defs/BlockType",
+          "description": "Content of the message."
         },
         "name": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/LocalizedExpression_TypeVar_"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalExpressionStr",
           "default": null,
-          "description": "For example, the name of the tool that was invoked, for which this message is the tool response.",
-          "title": "Name"
+          "description": "For example, the name of the tool that was invoked, for which this message is the tool response."
         },
         "tool_call_id": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/LocalizedExpression_TypeVar_"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalExpressionStr",
           "default": null,
-          "description": "The id of the tool invocation for which this message is the tool response.",
-          "title": "Tool Call Id"
+          "description": "The id of the tool invocation for which this message is the tool response."
         }
       },
       "required": [
@@ -8829,22 +3599,21 @@
       "title": "MessageBlock",
       "type": "object"
     },
+    "ModelInput": {
+      "items": {
+        "additionalProperties": true,
+        "type": "object"
+      },
+      "type": "array"
+    },
     "ObjectBlock": {
       "additionalProperties": false,
       "description": "Return the object where the value of each field is defined by a block. If the body of the object is an array, the resulting object is the union of the objects computed by each element of the array.",
       "properties": {
         "description": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Documentation associated to the block.\n    ",
-          "title": "Description"
+          "description": "Documentation associated to the block.\n    "
         },
         "spec": {
           "$ref": "#/$defs/PdlTypeType",
@@ -8853,86 +3622,7 @@
         },
         "defs": {
           "additionalProperties": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/FunctionBlock"
-              },
-              {
-                "$ref": "#/$defs/CallBlock"
-              },
-              {
-                "$ref": "#/$defs/LitellmModelBlock"
-              },
-              {
-                "$ref": "#/$defs/GraniteioModelBlock"
-              },
-              {
-                "$ref": "#/$defs/CodeBlock"
-              },
-              {
-                "$ref": "#/$defs/ArgsBlock"
-              },
-              {
-                "$ref": "#/$defs/GetBlock"
-              },
-              {
-                "$ref": "#/$defs/DataBlock"
-              },
-              {
-                "$ref": "#/$defs/IfBlock"
-              },
-              {
-                "$ref": "#/$defs/MatchBlock"
-              },
-              {
-                "$ref": "#/$defs/RepeatBlock"
-              },
-              {
-                "$ref": "#/$defs/TextBlock"
-              },
-              {
-                "$ref": "#/$defs/LastOfBlock"
-              },
-              {
-                "$ref": "#/$defs/ArrayBlock"
-              },
-              {
-                "$ref": "#/$defs/ObjectBlock"
-              },
-              {
-                "$ref": "#/$defs/MessageBlock"
-              },
-              {
-                "$ref": "#/$defs/ReadBlock"
-              },
-              {
-                "$ref": "#/$defs/IncludeBlock"
-              },
-              {
-                "$ref": "#/$defs/ImportBlock"
-              },
-              {
-                "$ref": "#/$defs/ErrorBlock"
-              },
-              {
-                "$ref": "#/$defs/EmptyBlock"
-              },
-              {
-                "type": "null"
-              }
-            ]
+            "$ref": "#/$defs/BlockType"
           },
           "default": {},
           "description": "Set of definitions executed before the execution of the block.\n    ",
@@ -8940,17 +3630,9 @@
           "type": "object"
         },
         "def": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Name of the variable used to store the result of the execution of the block.\n    ",
-          "title": "Def"
+          "description": "Name of the variable used to store the result of the execution of the block.\n    "
         },
         "contribute": {
           "default": [
@@ -8959,234 +3641,64 @@
           ],
           "description": "Indicate if the block contributes to the result and background context.\n    ",
           "items": {
-            "anyOf": [
-              {
-                "$ref": "#/$defs/ContributeTarget"
-              },
-              {
-                "additionalProperties": {
-                  "$ref": "#/$defs/ContributeValue"
-                },
-                "type": "object"
-              }
-            ]
+            "$ref": "#/$defs/ContributeElement"
           },
           "title": "Contribute",
           "type": "array"
         },
         "parser": {
-          "anyOf": [
-            {
-              "enum": [
-                "json",
-                "jsonl",
-                "yaml"
-              ],
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/PdlParser"
-            },
-            {
-              "$ref": "#/$defs/RegexParser"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalParserType",
           "default": null,
-          "description": "Parser to use to construct a value out of a string result.",
-          "title": "Parser"
+          "description": "Parser to use to construct a value out of a string result."
         },
         "fallback": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBlockType",
           "default": null,
-          "description": "Block to execute in case of error.\n    ",
-          "title": "Fallback"
+          "description": "Block to execute in case of error.\n    "
         },
         "retry": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalInt",
           "default": null,
-          "description": "The maximum number of times to retry when an error occurs within a block.\n    ",
-          "title": "Retry"
+          "description": "The maximum number of times to retry when an error occurs within a block.\n    "
         },
         "trace_error_on_retry": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalBoolOrStr",
           "default": null,
-          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    ",
-          "title": "Trace Error On Retry"
+          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    "
+        },
+        "requirements": {
+          "$ref": "#/$defs/RequirementsType",
+          "default": [],
+          "description": "Specify any requirements that the result of the block must satisfy.\n    "
         },
         "role": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.",
-          "title": "Role"
+          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`."
         },
         "pdl__context": {
-          "anyOf": [
-            {
-              "items": {
-                "additionalProperties": true,
-                "type": "object"
-              },
-              "type": "array"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalModelInput",
           "default": [],
-          "description": "Current context\n    ",
-          "title": "Pdl  Context"
+          "description": "Current context."
         },
         "pdl__id": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": "",
-          "description": "Unique identifier for this block\n    ",
-          "title": "Pdl  Id"
+          "description": "Unique identifier for this block."
         },
         "pdl__result": {
-          "anyOf": [
-            {},
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalAny",
           "default": null,
-          "description": "Result of the execution of the block",
-          "title": "Pdl  Result"
+          "description": "Result of the execution of the block."
         },
         "pdl__location": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlLocationType"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalPdlLocationType",
           "default": null
         },
         "pdl__timing": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlTiming"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null
+          "$ref": "#/$defs/OptionalPdlTiming",
+          "default": null,
+          "description": "Execution timing information."
         },
         "pdl__is_leaf": {
           "const": false,
@@ -9208,171 +3720,13 @@
           "anyOf": [
             {
               "additionalProperties": {
-                "anyOf": [
-                  {
-                    "type": "boolean"
-                  },
-                  {
-                    "type": "integer"
-                  },
-                  {
-                    "type": "number"
-                  },
-                  {
-                    "type": "string"
-                  },
-                  {
-                    "$ref": "#/$defs/FunctionBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/CallBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/LitellmModelBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/GraniteioModelBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/CodeBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/ArgsBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/GetBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/DataBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/IfBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/MatchBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/RepeatBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/TextBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/LastOfBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/ArrayBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/ObjectBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/MessageBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/ReadBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/IncludeBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/ImportBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/ErrorBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/EmptyBlock"
-                  },
-                  {
-                    "type": "null"
-                  }
-                ]
+                "$ref": "#/$defs/BlockType"
               },
               "type": "object"
             },
             {
               "items": {
-                "anyOf": [
-                  {
-                    "type": "boolean"
-                  },
-                  {
-                    "type": "integer"
-                  },
-                  {
-                    "type": "number"
-                  },
-                  {
-                    "type": "string"
-                  },
-                  {
-                    "$ref": "#/$defs/FunctionBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/CallBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/LitellmModelBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/GraniteioModelBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/CodeBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/ArgsBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/GetBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/DataBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/IfBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/MatchBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/RepeatBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/TextBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/LastOfBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/ArrayBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/ObjectBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/MessageBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/ReadBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/IncludeBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/ImportBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/ErrorBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/EmptyBlock"
-                  },
-                  {
-                    "type": "null"
-                  }
-                ]
+                "$ref": "#/$defs/BlockType"
               },
               "type": "array"
             }
@@ -9391,48 +3745,12 @@
       "description": "Match an object.",
       "properties": {
         "def": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Def"
+          "$ref": "#/$defs/OptionalStr",
+          "default": null
         },
         "object": {
           "additionalProperties": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/OrPattern"
-              },
-              {
-                "$ref": "#/$defs/ArrayPattern"
-              },
-              {
-                "$ref": "#/$defs/ObjectPattern"
-              },
-              {
-                "$ref": "#/$defs/AnyPattern"
-              },
-              {
-                "type": "null"
-              }
-            ]
+            "$ref": "#/$defs/PatternType"
           },
           "title": "Object",
           "type": "object"
@@ -9462,159 +3780,224 @@
       "title": "ObjectPdlType",
       "type": "object"
     },
-    "OptionalPdlType": {
-      "additionalProperties": false,
-      "description": "Optional type.",
-      "properties": {
-        "optional": {
-          "$ref": "#/$defs/PdlTypeType"
+    "OptionalAny": {
+      "anyOf": [
+        {},
+        {
+          "type": "null"
         }
-      },
-      "required": [
-        "optional"
-      ],
-      "title": "OptionalPdlType",
-      "type": "object"
+      ]
     },
-    "OrPattern": {
-      "additionalProperties": false,
-      "description": "Match any of the patterns.",
-      "properties": {
-        "def": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Def"
+    "OptionalBlockType": {
+      "anyOf": [
+        {
+          "$ref": "#/$defs/BlockType"
         },
-        "anyOf": {
-          "items": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/OrPattern"
-              },
-              {
-                "$ref": "#/$defs/ArrayPattern"
-              },
-              {
-                "$ref": "#/$defs/ObjectPattern"
-              },
-              {
-                "$ref": "#/$defs/AnyPattern"
-              },
-              {
-                "type": "null"
-              }
-            ]
-          },
-          "title": "Anyof",
-          "type": "array"
+        {
+          "type": "null"
         }
-      },
-      "required": [
-        "anyOf"
-      ],
-      "title": "OrPattern",
-      "type": "object"
+      ]
     },
-    "PdlBlock": {
+    "OptionalBoolOrStr": {
       "anyOf": [
         {
           "type": "boolean"
         },
         {
-          "type": "integer"
+          "type": "string"
         },
         {
-          "type": "number"
-        },
+          "type": "null"
+        }
+      ]
+    },
+    "OptionalExpressionBool": {
+      "anyOf": [
         {
-          "type": "string"
+          "$ref": "#/$defs/ExpressionBool"
         },
         {
-          "$ref": "#/$defs/FunctionBlock"
-        },
+          "type": "null"
+        }
+      ]
+    },
+    "OptionalExpressionInt": {
+      "anyOf": [
         {
-          "$ref": "#/$defs/CallBlock"
+          "$ref": "#/$defs/ExpressionInt"
         },
         {
-          "$ref": "#/$defs/LitellmModelBlock"
-        },
+          "type": "null"
+        }
+      ]
+    },
+    "OptionalExpressionStr": {
+      "anyOf": [
         {
-          "$ref": "#/$defs/GraniteioModelBlock"
+          "$ref": "#/$defs/ExpressionStr"
         },
         {
-          "$ref": "#/$defs/CodeBlock"
+          "type": "null"
+        }
+      ]
+    },
+    "OptionalInt": {
+      "anyOf": [
+        {
+          "type": "integer"
         },
         {
-          "$ref": "#/$defs/ArgsBlock"
+          "type": "null"
+        }
+      ]
+    },
+    "OptionalModelInput": {
+      "anyOf": [
+        {
+          "$ref": "#/$defs/ModelInput"
         },
         {
-          "$ref": "#/$defs/GetBlock"
+          "type": "null"
+        }
+      ]
+    },
+    "OptionalParserType": {
+      "anyOf": [
+        {
+          "$ref": "#/$defs/ParserType"
         },
         {
-          "$ref": "#/$defs/DataBlock"
+          "type": "null"
+        }
+      ]
+    },
+    "OptionalPdlLocationType": {
+      "anyOf": [
+        {
+          "$ref": "#/$defs/PdlLocationType"
         },
         {
-          "$ref": "#/$defs/IfBlock"
+          "type": "null"
+        }
+      ]
+    },
+    "OptionalPdlTiming": {
+      "anyOf": [
+        {
+          "$ref": "#/$defs/PdlTiming"
         },
         {
-          "$ref": "#/$defs/MatchBlock"
+          "type": "null"
+        }
+      ]
+    },
+    "OptionalPdlType": {
+      "additionalProperties": false,
+      "description": "Optional type.",
+      "properties": {
+        "optional": {
+          "$ref": "#/$defs/PdlTypeType"
+        }
+      },
+      "required": [
+        "optional"
+      ],
+      "title": "OptionalPdlType",
+      "type": "object"
+    },
+    "OptionalPdlUsage": {
+      "anyOf": [
+        {
+          "$ref": "#/$defs/PdlUsage"
         },
         {
-          "$ref": "#/$defs/RepeatBlock"
+          "type": "null"
+        }
+      ]
+    },
+    "OptionalStr": {
+      "anyOf": [
+        {
+          "type": "string"
         },
         {
-          "$ref": "#/$defs/TextBlock"
+          "type": "null"
+        }
+      ]
+    },
+    "OrPattern": {
+      "additionalProperties": false,
+      "description": "Match any of the patterns.",
+      "properties": {
+        "def": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": null
         },
+        "anyOf": {
+          "items": {
+            "$ref": "#/$defs/PatternType"
+          },
+          "title": "Anyof",
+          "type": "array"
+        }
+      },
+      "required": [
+        "anyOf"
+      ],
+      "title": "OrPattern",
+      "type": "object"
+    },
+    "ParserType": {
+      "anyOf": [
         {
-          "$ref": "#/$defs/LastOfBlock"
+          "enum": [
+            "json",
+            "jsonl",
+            "yaml"
+          ],
+          "type": "string"
         },
         {
-          "$ref": "#/$defs/ArrayBlock"
+          "$ref": "#/$defs/PdlParser"
         },
         {
-          "$ref": "#/$defs/ObjectBlock"
+          "$ref": "#/$defs/RegexParser"
+        }
+      ]
+    },
+    "PatternType": {
+      "anyOf": [
+        {
+          "type": "boolean"
         },
         {
-          "$ref": "#/$defs/MessageBlock"
+          "type": "integer"
         },
         {
-          "$ref": "#/$defs/ReadBlock"
+          "type": "number"
         },
         {
-          "$ref": "#/$defs/IncludeBlock"
+          "type": "string"
         },
         {
-          "$ref": "#/$defs/ImportBlock"
+          "$ref": "#/$defs/OrPattern"
         },
         {
-          "$ref": "#/$defs/ErrorBlock"
+          "$ref": "#/$defs/ArrayPattern"
         },
         {
-          "$ref": "#/$defs/EmptyBlock"
+          "$ref": "#/$defs/ObjectPattern"
+        },
+        {
+          "$ref": "#/$defs/AnyPattern"
         },
         {
           "type": "null"
         }
-      ],
+      ]
+    },
+    "PdlBlock": {
+      "$ref": "#/$defs/BlockType",
       "title": "PdlBlock"
     },
     "PdlLocationType": {
@@ -9653,103 +4036,15 @@
       "description": "Use a PDL program as a parser specification (experimental).",
       "properties": {
         "description": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Description"
+          "$ref": "#/$defs/OptionalStr",
+          "default": null
         },
         "spec": {
           "$ref": "#/$defs/PdlTypeType",
           "default": null
         },
         "pdl": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "title": "Pdl"
+          "$ref": "#/$defs/BlockType"
         }
       },
       "required": [
@@ -9763,52 +4058,20 @@
       "description": "Internal data structure to record timing information in the trace.",
       "properties": {
         "start_nanos": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": 0,
-          "title": "Start Nanos"
+          "$ref": "#/$defs/OptionalInt",
+          "default": 0
         },
         "end_nanos": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": 0,
-          "title": "End Nanos"
+          "$ref": "#/$defs/OptionalInt",
+          "default": 0
         },
         "first_use_nanos": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": 0,
-          "title": "First Use Nanos"
+          "$ref": "#/$defs/OptionalInt",
+          "default": 0
         },
         "timezone": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": "",
-          "title": "Timezone"
+          "$ref": "#/$defs/OptionalStr",
+          "default": ""
         }
       },
       "title": "PdlTiming",
@@ -9867,133 +4130,193 @@
       "description": "Internal data structure to record token consumption usage information.",
       "properties": {
         "completion_tokens": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": 0,
-          "title": "Completion Tokens"
+          "$ref": "#/$defs/OptionalInt",
+          "default": 0
         },
         "prompt_tokens": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": 0,
-          "title": "Prompt Tokens"
+          "$ref": "#/$defs/OptionalInt",
+          "default": 0
         }
       },
       "title": "PdlUsage",
       "type": "object"
     },
     "Program": {
-      "anyOf": [
-        {
-          "type": "boolean"
+      "$ref": "#/$defs/BlockType",
+      "description": "Prompt Declaration Language program (PDL)",
+      "title": "Program"
+    },
+    "ReadBlock": {
+      "additionalProperties": false,
+      "description": "Read from a file or standard input.\n\nExample. Read from the standard input with a prompt starting with `> `.\n```PDL\nread:\nmessage: \"> \"\n```\n\nExample. Read the file `./data.yaml` in the same directory of the PDL file containing the block and parse it into YAML.\n```PDL\nread: ./data.yaml\nparser: yaml\n```",
+      "properties": {
+        "description": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": null,
+          "description": "Documentation associated to the block.\n    "
         },
-        {
-          "type": "integer"
+        "spec": {
+          "$ref": "#/$defs/PdlTypeType",
+          "default": null,
+          "description": "Type specification of the result of the block.\n    "
         },
-        {
-          "type": "number"
+        "defs": {
+          "additionalProperties": {
+            "$ref": "#/$defs/BlockType"
+          },
+          "default": {},
+          "description": "Set of definitions executed before the execution of the block.\n    ",
+          "title": "Defs",
+          "type": "object"
         },
-        {
-          "type": "string"
-        },
-        {
-          "$ref": "#/$defs/FunctionBlock"
-        },
-        {
-          "$ref": "#/$defs/CallBlock"
+        "def": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": null,
+          "description": "Name of the variable used to store the result of the execution of the block.\n    "
         },
-        {
-          "$ref": "#/$defs/LitellmModelBlock"
+        "contribute": {
+          "default": [
+            "result",
+            "context"
+          ],
+          "description": "Indicate if the block contributes to the result and background context.\n    ",
+          "items": {
+            "$ref": "#/$defs/ContributeElement"
+          },
+          "title": "Contribute",
+          "type": "array"
         },
-        {
-          "$ref": "#/$defs/GraniteioModelBlock"
+        "parser": {
+          "$ref": "#/$defs/OptionalParserType",
+          "default": null,
+          "description": "Parser to use to construct a value out of a string result."
         },
-        {
-          "$ref": "#/$defs/CodeBlock"
+        "fallback": {
+          "$ref": "#/$defs/OptionalBlockType",
+          "default": null,
+          "description": "Block to execute in case of error.\n    "
         },
-        {
-          "$ref": "#/$defs/ArgsBlock"
+        "retry": {
+          "$ref": "#/$defs/OptionalInt",
+          "default": null,
+          "description": "The maximum number of times to retry when an error occurs within a block.\n    "
         },
-        {
-          "$ref": "#/$defs/GetBlock"
+        "trace_error_on_retry": {
+          "$ref": "#/$defs/OptionalBoolOrStr",
+          "default": null,
+          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    "
         },
-        {
-          "$ref": "#/$defs/DataBlock"
+        "requirements": {
+          "$ref": "#/$defs/RequirementsType",
+          "default": [],
+          "description": "Specify any requirements that the result of the block must satisfy.\n    "
         },
-        {
-          "$ref": "#/$defs/IfBlock"
+        "role": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": null,
+          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`."
         },
-        {
-          "$ref": "#/$defs/MatchBlock"
+        "pdl__context": {
+          "$ref": "#/$defs/OptionalModelInput",
+          "default": [],
+          "description": "Current context."
         },
-        {
-          "$ref": "#/$defs/RepeatBlock"
+        "pdl__id": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": "",
+          "description": "Unique identifier for this block."
         },
-        {
-          "$ref": "#/$defs/TextBlock"
+        "pdl__result": {
+          "$ref": "#/$defs/OptionalAny",
+          "default": null,
+          "description": "Result of the execution of the block."
         },
-        {
-          "$ref": "#/$defs/LastOfBlock"
+        "pdl__location": {
+          "$ref": "#/$defs/OptionalPdlLocationType",
+          "default": null
         },
-        {
-          "$ref": "#/$defs/ArrayBlock"
+        "pdl__timing": {
+          "$ref": "#/$defs/OptionalPdlTiming",
+          "default": null,
+          "description": "Execution timing information."
         },
-        {
-          "$ref": "#/$defs/ObjectBlock"
+        "pdl__is_leaf": {
+          "const": true,
+          "default": true,
+          "title": "Pdl  Is Leaf",
+          "type": "boolean"
         },
-        {
-          "$ref": "#/$defs/MessageBlock"
+        "kind": {
+          "const": "read",
+          "default": "read",
+          "title": "Kind",
+          "type": "string"
         },
-        {
-          "$ref": "#/$defs/ReadBlock"
+        "read": {
+          "$ref": "#/$defs/OptionalExpressionStr",
+          "description": "Name of the file to read. If `None`, read the standard input.\n    "
         },
-        {
-          "$ref": "#/$defs/IncludeBlock"
+        "message": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": null,
+          "description": "Message to prompt the user to enter a value.\n    "
         },
-        {
-          "$ref": "#/$defs/ImportBlock"
+        "multiline": {
+          "default": false,
+          "description": "Indicate if one or multiple lines should be read.\n    ",
+          "title": "Multiline",
+          "type": "boolean"
+        }
+      },
+      "required": [
+        "read"
+      ],
+      "title": "ReadBlock",
+      "type": "object"
+    },
+    "RegexParser": {
+      "additionalProperties": false,
+      "description": "A regular expression parser.",
+      "properties": {
+        "description": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": null
         },
-        {
-          "$ref": "#/$defs/ErrorBlock"
+        "spec": {
+          "$ref": "#/$defs/PdlTypeType",
+          "default": null
         },
-        {
-          "$ref": "#/$defs/EmptyBlock"
+        "regex": {
+          "title": "Regex",
+          "type": "string"
         },
-        {
-          "type": "null"
+        "mode": {
+          "default": "fullmatch",
+          "enum": [
+            "search",
+            "match",
+            "fullmatch",
+            "split",
+            "findall"
+          ],
+          "title": "Mode",
+          "type": "string"
         }
+      },
+      "required": [
+        "regex"
       ],
-      "description": "Prompt Declaration Language program (PDL)",
-      "title": "Program"
+      "title": "RegexParser",
+      "type": "object"
     },
-    "ReadBlock": {
+    "RepeatBlock": {
       "additionalProperties": false,
-      "description": "Read from a file or standard input.\n\nExample. Read from the standard input with a prompt starting with `> `.\n```PDL\nread:\nmessage: \"> \"\n```\n\nExample. Read the file `./data.yaml` in the same directory of the PDL file containing the block and parse it into YAML.\n```PDL\nread: ./data.yaml\nparser: yaml\n```",
+      "description": "Repeat the execution of a block sequentially.\nThe scope and `pdl_context` are accumulated in between iterations.\n\nFor loop example:\n```PDL\nfor:\n    number: [1, 2, 3, 4]\n    name: [\"Bob\", \"Carol\", \"David\", \"Ernest\"]\nrepeat:\n    \"${ name }'s number is ${ number }\\n\"\n```\n\nWhile loop:\n```PDL\ndefs:\n  i: 0\nwhile: ${i < 5}\nrepeat:\n    defs:\n      i: ${ i + 1}\n    data: ${ i }\njoin:\n  as: array\n```",
       "properties": {
         "description": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Documentation associated to the block.\n    ",
-          "title": "Description"
+          "description": "Documentation associated to the block.\n    "
         },
         "spec": {
           "$ref": "#/$defs/PdlTypeType",
@@ -10002,86 +4325,7 @@
         },
         "defs": {
           "additionalProperties": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/FunctionBlock"
-              },
-              {
-                "$ref": "#/$defs/CallBlock"
-              },
-              {
-                "$ref": "#/$defs/LitellmModelBlock"
-              },
-              {
-                "$ref": "#/$defs/GraniteioModelBlock"
-              },
-              {
-                "$ref": "#/$defs/CodeBlock"
-              },
-              {
-                "$ref": "#/$defs/ArgsBlock"
-              },
-              {
-                "$ref": "#/$defs/GetBlock"
-              },
-              {
-                "$ref": "#/$defs/DataBlock"
-              },
-              {
-                "$ref": "#/$defs/IfBlock"
-              },
-              {
-                "$ref": "#/$defs/MatchBlock"
-              },
-              {
-                "$ref": "#/$defs/RepeatBlock"
-              },
-              {
-                "$ref": "#/$defs/TextBlock"
-              },
-              {
-                "$ref": "#/$defs/LastOfBlock"
-              },
-              {
-                "$ref": "#/$defs/ArrayBlock"
-              },
-              {
-                "$ref": "#/$defs/ObjectBlock"
-              },
-              {
-                "$ref": "#/$defs/MessageBlock"
-              },
-              {
-                "$ref": "#/$defs/ReadBlock"
-              },
-              {
-                "$ref": "#/$defs/IncludeBlock"
-              },
-              {
-                "$ref": "#/$defs/ImportBlock"
-              },
-              {
-                "$ref": "#/$defs/ErrorBlock"
-              },
-              {
-                "$ref": "#/$defs/EmptyBlock"
-              },
-              {
-                "type": "null"
-              }
-            ]
+            "$ref": "#/$defs/BlockType"
           },
           "default": {},
           "description": "Set of definitions executed before the execution of the block.\n    ",
@@ -10089,17 +4333,9 @@
           "type": "object"
         },
         "def": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Name of the variable used to store the result of the execution of the block.\n    ",
-          "title": "Def"
+          "description": "Name of the variable used to store the result of the execution of the block.\n    "
         },
         "contribute": {
           "default": [
@@ -10108,1275 +4344,185 @@
           ],
           "description": "Indicate if the block contributes to the result and background context.\n    ",
           "items": {
-            "anyOf": [
-              {
-                "$ref": "#/$defs/ContributeTarget"
-              },
-              {
-                "additionalProperties": {
-                  "$ref": "#/$defs/ContributeValue"
-                },
-                "type": "object"
-              }
-            ]
+            "$ref": "#/$defs/ContributeElement"
           },
           "title": "Contribute",
           "type": "array"
         },
         "parser": {
+          "$ref": "#/$defs/OptionalParserType",
+          "default": null,
+          "description": "Parser to use to construct a value out of a string result."
+        },
+        "fallback": {
+          "$ref": "#/$defs/OptionalBlockType",
+          "default": null,
+          "description": "Block to execute in case of error.\n    "
+        },
+        "retry": {
+          "$ref": "#/$defs/OptionalInt",
+          "default": null,
+          "description": "The maximum number of times to retry when an error occurs within a block.\n    "
+        },
+        "trace_error_on_retry": {
+          "$ref": "#/$defs/OptionalBoolOrStr",
+          "default": null,
+          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    "
+        },
+        "requirements": {
+          "$ref": "#/$defs/RequirementsType",
+          "default": [],
+          "description": "Specify any requirements that the result of the block must satisfy.\n    "
+        },
+        "role": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": null,
+          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`."
+        },
+        "pdl__context": {
+          "$ref": "#/$defs/OptionalModelInput",
+          "default": [],
+          "description": "Current context."
+        },
+        "pdl__id": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": "",
+          "description": "Unique identifier for this block."
+        },
+        "pdl__result": {
+          "$ref": "#/$defs/OptionalAny",
+          "default": null,
+          "description": "Result of the execution of the block."
+        },
+        "pdl__location": {
+          "$ref": "#/$defs/OptionalPdlLocationType",
+          "default": null
+        },
+        "pdl__timing": {
+          "$ref": "#/$defs/OptionalPdlTiming",
+          "default": null,
+          "description": "Execution timing information."
+        },
+        "pdl__is_leaf": {
+          "const": false,
+          "default": false,
+          "title": "Pdl  Is Leaf",
+          "type": "boolean"
+        },
+        "context": {
+          "$ref": "#/$defs/IndependentEnum",
+          "default": "dependent"
+        },
+        "kind": {
+          "const": "repeat",
+          "default": "repeat",
+          "title": "Kind",
+          "type": "string"
+        },
+        "for": {
           "anyOf": [
             {
-              "enum": [
-                "json",
-                "jsonl",
-                "yaml"
-              ],
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/PdlParser"
-            },
-            {
-              "$ref": "#/$defs/RegexParser"
+              "additionalProperties": {
+                "anyOf": [
+                  {
+                    "$ref": "#/$defs/LocalizedExpression_TypeVar_"
+                  },
+                  {
+                    "items": {},
+                    "type": "array"
+                  },
+                  {
+                    "type": "string"
+                  }
+                ]
+              },
+              "type": "object"
             },
             {
               "type": "null"
             }
           ],
           "default": null,
-          "description": "Parser to use to construct a value out of a string result.",
-          "title": "Parser"
+          "description": "Arrays to iterate over.\n    ",
+          "title": "For"
         },
-        "fallback": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "description": "Block to execute in case of error.\n    ",
-          "title": "Fallback"
-        },
-        "retry": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "description": "The maximum number of times to retry when an error occurs within a block.\n    ",
-          "title": "Retry"
-        },
-        "trace_error_on_retry": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    ",
-          "title": "Trace Error On Retry"
-        },
-        "role": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.",
-          "title": "Role"
-        },
-        "pdl__context": {
-          "anyOf": [
-            {
-              "items": {
-                "additionalProperties": true,
-                "type": "object"
-              },
-              "type": "array"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": [],
-          "description": "Current context\n    ",
-          "title": "Pdl  Context"
-        },
-        "pdl__id": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": "",
-          "description": "Unique identifier for this block\n    ",
-          "title": "Pdl  Id"
-        },
-        "pdl__result": {
-          "anyOf": [
-            {},
-            {
-              "type": "null"
-            }
-          ],
+        "index": {
+          "$ref": "#/$defs/OptionalStr",
           "default": null,
-          "description": "Result of the execution of the block",
-          "title": "Pdl  Result"
-        },
-        "pdl__location": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlLocationType"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null
-        },
-        "pdl__timing": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlTiming"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null
+          "description": "Name of the variable containing the loop iteration.\n    "
         },
-        "pdl__is_leaf": {
-          "const": true,
+        "while": {
+          "$ref": "#/$defs/ExpressionBool",
           "default": true,
-          "title": "Pdl  Is Leaf",
-          "type": "boolean"
-        },
-        "kind": {
-          "const": "read",
-          "default": "read",
-          "title": "Kind",
-          "type": "string"
-        },
-        "read": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/LocalizedExpression_TypeVar_"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "description": "Name of the file to read. If `None`, read the standard input.\n    ",
-          "title": "Read"
+          "description": "Condition to stay at the beginning of the loop.\n    "
         },
-        "message": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "description": "Message to prompt the user to enter a value.\n    ",
-          "title": "Message"
+        "repeat": {
+          "$ref": "#/$defs/BlockType",
+          "description": "Body of the loop.\n    "
         },
-        "multiline": {
+        "until": {
+          "$ref": "#/$defs/ExpressionBool",
           "default": false,
-          "description": "Indicate if one or multiple lines should be read.\n    ",
-          "title": "Multiline",
-          "type": "boolean"
-        }
-      },
-      "required": [
-        "read"
-      ],
-      "title": "ReadBlock",
-      "type": "object"
-    },
-    "RegexParser": {
-      "additionalProperties": false,
-      "description": "A regular expression parser.",
-      "properties": {
-        "description": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Description"
-        },
-        "spec": {
-          "$ref": "#/$defs/PdlTypeType",
-          "default": null
-        },
-        "regex": {
-          "title": "Regex",
-          "type": "string"
-        },
-        "mode": {
-          "default": "fullmatch",
-          "enum": [
-            "search",
-            "match",
-            "fullmatch",
-            "split",
-            "findall"
-          ],
-          "title": "Mode",
-          "type": "string"
-        }
-      },
-      "required": [
-        "regex"
-      ],
-      "title": "RegexParser",
-      "type": "object"
-    },
-    "RepeatBlock": {
-      "additionalProperties": false,
-      "description": "Repeat the execution of a block.\n\nFor loop example:\n```PDL\nfor:\n    number: [1, 2, 3, 4]\n    name: [\"Bob\", \"Carol\", \"David\", \"Ernest\"]\nrepeat:\n    \"${ name }'s number is ${ number }\\n\"\n```\n\nBounded loop:\n```PDL\nindex: i\nmaxIterations: 5\nrepeat:\n    ${ i }\njoin:\n  as: array\n```",
-      "properties": {
-        "description": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "description": "Documentation associated to the block.\n    ",
-          "title": "Description"
+          "description": "Condition to exit at the end of the loop.\n    "
         },
-        "spec": {
-          "$ref": "#/$defs/PdlTypeType",
-          "default": null,
-          "description": "Type specification of the result of the block.\n    "
-        },
-        "defs": {
-          "additionalProperties": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/FunctionBlock"
-              },
-              {
-                "$ref": "#/$defs/CallBlock"
-              },
-              {
-                "$ref": "#/$defs/LitellmModelBlock"
-              },
-              {
-                "$ref": "#/$defs/GraniteioModelBlock"
-              },
-              {
-                "$ref": "#/$defs/CodeBlock"
-              },
-              {
-                "$ref": "#/$defs/ArgsBlock"
-              },
-              {
-                "$ref": "#/$defs/GetBlock"
-              },
-              {
-                "$ref": "#/$defs/DataBlock"
-              },
-              {
-                "$ref": "#/$defs/IfBlock"
-              },
-              {
-                "$ref": "#/$defs/MatchBlock"
-              },
-              {
-                "$ref": "#/$defs/RepeatBlock"
-              },
-              {
-                "$ref": "#/$defs/TextBlock"
-              },
-              {
-                "$ref": "#/$defs/LastOfBlock"
-              },
-              {
-                "$ref": "#/$defs/ArrayBlock"
-              },
-              {
-                "$ref": "#/$defs/ObjectBlock"
-              },
-              {
-                "$ref": "#/$defs/MessageBlock"
-              },
-              {
-                "$ref": "#/$defs/ReadBlock"
-              },
-              {
-                "$ref": "#/$defs/IncludeBlock"
-              },
-              {
-                "$ref": "#/$defs/ImportBlock"
-              },
-              {
-                "$ref": "#/$defs/ErrorBlock"
-              },
-              {
-                "$ref": "#/$defs/EmptyBlock"
-              },
-              {
-                "type": "null"
-              }
-            ]
-          },
-          "default": {},
-          "description": "Set of definitions executed before the execution of the block.\n    ",
-          "title": "Defs",
-          "type": "object"
-        },
-        "def": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "description": "Name of the variable used to store the result of the execution of the block.\n    ",
-          "title": "Def"
-        },
-        "contribute": {
-          "default": [
-            "result",
-            "context"
-          ],
-          "description": "Indicate if the block contributes to the result and background context.\n    ",
-          "items": {
-            "anyOf": [
-              {
-                "$ref": "#/$defs/ContributeTarget"
-              },
-              {
-                "additionalProperties": {
-                  "$ref": "#/$defs/ContributeValue"
-                },
-                "type": "object"
-              }
-            ]
-          },
-          "title": "Contribute",
-          "type": "array"
-        },
-        "parser": {
-          "anyOf": [
-            {
-              "enum": [
-                "json",
-                "jsonl",
-                "yaml"
-              ],
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/PdlParser"
-            },
-            {
-              "$ref": "#/$defs/RegexParser"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "description": "Parser to use to construct a value out of a string result.",
-          "title": "Parser"
-        },
-        "fallback": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "description": "Block to execute in case of error.\n    ",
-          "title": "Fallback"
-        },
-        "retry": {
-          "anyOf": [
-            {
-              "type": "integer"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "description": "The maximum number of times to retry when an error occurs within a block.\n    ",
-          "title": "Retry"
-        },
-        "trace_error_on_retry": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    ",
-          "title": "Trace Error On Retry"
-        },
-        "role": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.",
-          "title": "Role"
-        },
-        "pdl__context": {
-          "anyOf": [
-            {
-              "items": {
-                "additionalProperties": true,
-                "type": "object"
-              },
-              "type": "array"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": [],
-          "description": "Current context\n    ",
-          "title": "Pdl  Context"
-        },
-        "pdl__id": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": "",
-          "description": "Unique identifier for this block\n    ",
-          "title": "Pdl  Id"
-        },
-        "pdl__result": {
-          "anyOf": [
-            {},
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "description": "Result of the execution of the block",
-          "title": "Pdl  Result"
-        },
-        "pdl__location": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlLocationType"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null
-        },
-        "pdl__timing": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlTiming"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null
-        },
-        "pdl__is_leaf": {
-          "const": false,
-          "default": false,
-          "title": "Pdl  Is Leaf",
-          "type": "boolean"
-        },
-        "context": {
-          "$ref": "#/$defs/IndependentEnum",
-          "default": "dependent"
-        },
-        "kind": {
-          "const": "repeat",
-          "default": "repeat",
-          "title": "Kind",
-          "type": "string"
-        },
-        "for": {
-          "anyOf": [
-            {
-              "additionalProperties": {
-                "anyOf": [
-                  {
-                    "$ref": "#/$defs/LocalizedExpression_TypeVar_"
-                  },
-                  {
-                    "items": {},
-                    "type": "array"
-                  },
-                  {
-                    "type": "string"
-                  }
-                ]
-              },
-              "type": "object"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "description": "Arrays to iterate over.\n    ",
-          "title": "For"
-        },
-        "index": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "description": "Name of the variable containing the loop iteration.\n    ",
-          "title": "Index"
-        },
-        "while": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/LocalizedExpression_TypeVar_"
-            },
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            }
-          ],
-          "default": true,
-          "description": "Condition to stay at the beginning of the loop.\n    ",
-          "title": "While"
-        },
-        "repeat": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "description": "Body of the loop.\n    ",
-          "title": "Repeat"
-        },
-        "until": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/LocalizedExpression_TypeVar_"
-            },
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "string"
-            }
-          ],
-          "default": false,
-          "description": "Condition to exit at the end of the loop.\n    ",
-          "title": "Until"
-        },
-        "maxIterations": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/LocalizedExpression_TypeVar_"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "description": "Maximal number of iterations to perform.\n    ",
-          "title": "Maxiterations"
-        },
-        "join": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/JoinText"
-            },
-            {
-              "$ref": "#/$defs/JoinArray"
-            },
-            {
-              "$ref": "#/$defs/JoinObject"
-            },
-            {
-              "$ref": "#/$defs/JoinLastOf"
-            }
-          ],
-          "default": {
-            "as": "text",
-            "with": ""
-          },
-          "description": "Define how to combine the result of each iteration.\n    ",
-          "title": "Join"
-        },
-        "pdl__trace": {
-          "anyOf": [
-            {
-              "items": {
-                "anyOf": [
-                  {
-                    "type": "boolean"
-                  },
-                  {
-                    "type": "integer"
-                  },
-                  {
-                    "type": "number"
-                  },
-                  {
-                    "type": "string"
-                  },
-                  {
-                    "$ref": "#/$defs/FunctionBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/CallBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/LitellmModelBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/GraniteioModelBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/CodeBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/ArgsBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/GetBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/DataBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/IfBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/MatchBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/RepeatBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/TextBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/LastOfBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/ArrayBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/ObjectBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/MessageBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/ReadBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/IncludeBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/ImportBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/ErrorBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/EmptyBlock"
-                  },
-                  {
-                    "type": "null"
-                  }
-                ]
-              },
-              "type": "array"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "title": "Pdl  Trace"
-        }
-      },
-      "required": [
-        "repeat"
-      ],
-      "title": "RepeatBlock",
-      "type": "object"
-    },
-    "TextBlock": {
-      "additionalProperties": false,
-      "description": "Create the concatenation of the stringify version of the result of each block of the list of blocks.",
-      "properties": {
-        "description": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "description": "Documentation associated to the block.\n    ",
-          "title": "Description"
-        },
-        "spec": {
-          "$ref": "#/$defs/PdlTypeType",
-          "default": null,
-          "description": "Type specification of the result of the block.\n    "
-        },
-        "defs": {
-          "additionalProperties": {
-            "anyOf": [
-              {
-                "type": "boolean"
-              },
-              {
-                "type": "integer"
-              },
-              {
-                "type": "number"
-              },
-              {
-                "type": "string"
-              },
-              {
-                "$ref": "#/$defs/FunctionBlock"
-              },
-              {
-                "$ref": "#/$defs/CallBlock"
-              },
-              {
-                "$ref": "#/$defs/LitellmModelBlock"
-              },
-              {
-                "$ref": "#/$defs/GraniteioModelBlock"
-              },
-              {
-                "$ref": "#/$defs/CodeBlock"
-              },
-              {
-                "$ref": "#/$defs/ArgsBlock"
-              },
-              {
-                "$ref": "#/$defs/GetBlock"
-              },
-              {
-                "$ref": "#/$defs/DataBlock"
-              },
-              {
-                "$ref": "#/$defs/IfBlock"
-              },
-              {
-                "$ref": "#/$defs/MatchBlock"
-              },
-              {
-                "$ref": "#/$defs/RepeatBlock"
-              },
-              {
-                "$ref": "#/$defs/TextBlock"
-              },
-              {
-                "$ref": "#/$defs/LastOfBlock"
-              },
-              {
-                "$ref": "#/$defs/ArrayBlock"
-              },
-              {
-                "$ref": "#/$defs/ObjectBlock"
-              },
-              {
-                "$ref": "#/$defs/MessageBlock"
-              },
-              {
-                "$ref": "#/$defs/ReadBlock"
-              },
-              {
-                "$ref": "#/$defs/IncludeBlock"
-              },
-              {
-                "$ref": "#/$defs/ImportBlock"
-              },
-              {
-                "$ref": "#/$defs/ErrorBlock"
-              },
-              {
-                "$ref": "#/$defs/EmptyBlock"
-              },
-              {
-                "type": "null"
-              }
-            ]
-          },
-          "default": {},
-          "description": "Set of definitions executed before the execution of the block.\n    ",
-          "title": "Defs",
-          "type": "object"
-        },
-        "def": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "description": "Name of the variable used to store the result of the execution of the block.\n    ",
-          "title": "Def"
-        },
-        "contribute": {
-          "default": [
-            "result",
-            "context"
-          ],
-          "description": "Indicate if the block contributes to the result and background context.\n    ",
-          "items": {
-            "anyOf": [
-              {
-                "$ref": "#/$defs/ContributeTarget"
-              },
-              {
-                "additionalProperties": {
-                  "$ref": "#/$defs/ContributeValue"
-                },
-                "type": "object"
-              }
-            ]
-          },
-          "title": "Contribute",
-          "type": "array"
-        },
-        "parser": {
-          "anyOf": [
-            {
-              "enum": [
-                "json",
-                "jsonl",
-                "yaml"
-              ],
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/PdlParser"
-            },
-            {
-              "$ref": "#/$defs/RegexParser"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null,
-          "description": "Parser to use to construct a value out of a string result.",
-          "title": "Parser"
-        },
-        "fallback": {
-          "anyOf": [
-            {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
+        "maxIterations": {
+          "$ref": "#/$defs/OptionalExpressionInt",
+          "default": null,
+          "description": "Maximal number of iterations to perform.\n    "
+        },
+        "join": {
+          "$ref": "#/$defs/JoinType",
+          "default": {
+            "as": "text",
+            "with": ""
+          },
+          "description": "Define how to combine the result of each iteration.\n    "
+        },
+        "pdl__trace": {
+          "anyOf": [
             {
-              "$ref": "#/$defs/EmptyBlock"
+              "items": {
+                "$ref": "#/$defs/BlockType"
+              },
+              "type": "array"
             },
             {
               "type": "null"
             }
           ],
           "default": null,
-          "description": "Block to execute in case of error.\n    ",
-          "title": "Fallback"
-        },
-        "retry": {
+          "title": "Pdl  Trace"
+        }
+      },
+      "required": [
+        "repeat"
+      ],
+      "title": "RepeatBlock",
+      "type": "object"
+    },
+    "RequirementType": {
+      "additionalProperties": false,
+      "description": "Single requirement definition.",
+      "properties": {
+        "expect": {
           "anyOf": [
             {
-              "type": "integer"
+              "$ref": "#/$defs/LocalizedExpression_TypeVar_"
             },
+            {},
             {
-              "type": "null"
+              "type": "string"
             }
           ],
-          "default": null,
-          "description": "The maximum number of times to retry when an error occurs within a block.\n    ",
-          "title": "Retry"
+          "title": "Expect"
         },
-        "trace_error_on_retry": {
+        "evaluate": {
           "anyOf": [
             {
-              "type": "boolean"
+              "$ref": "#/$defs/LocalizedExpression_TypeVar_"
+            },
+            {
+              "$ref": "#/$defs/FunctionBlock"
             },
             {
               "type": "string"
@@ -11386,11 +4532,16 @@
             }
           ],
           "default": null,
-          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    ",
-          "title": "Trace Error On Retry"
+          "title": "Evaluate"
         },
-        "role": {
+        "transformContext": {
           "anyOf": [
+            {
+              "$ref": "#/$defs/LocalizedExpression_TypeVar_"
+            },
+            {
+              "$ref": "#/$defs/FunctionBlock"
+            },
             {
               "type": "string"
             },
@@ -11399,71 +4550,114 @@
             }
           ],
           "default": null,
-          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.",
-          "title": "Role"
+          "title": "Transformcontext"
+        }
+      },
+      "required": [
+        "expect"
+      ],
+      "title": "RequirementType",
+      "type": "object"
+    },
+    "RequirementsType": {
+      "items": {
+        "$ref": "#/$defs/RequirementType"
+      },
+      "type": "array"
+    },
+    "TextBlock": {
+      "additionalProperties": false,
+      "description": "Create the concatenation of the stringify version of the result of each block of the list of blocks.",
+      "properties": {
+        "description": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": null,
+          "description": "Documentation associated to the block.\n    "
         },
-        "pdl__context": {
-          "anyOf": [
-            {
-              "items": {
-                "additionalProperties": true,
-                "type": "object"
-              },
-              "type": "array"
-            },
-            {
-              "type": "null"
-            }
+        "spec": {
+          "$ref": "#/$defs/PdlTypeType",
+          "default": null,
+          "description": "Type specification of the result of the block.\n    "
+        },
+        "defs": {
+          "additionalProperties": {
+            "$ref": "#/$defs/BlockType"
+          },
+          "default": {},
+          "description": "Set of definitions executed before the execution of the block.\n    ",
+          "title": "Defs",
+          "type": "object"
+        },
+        "def": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": null,
+          "description": "Name of the variable used to store the result of the execution of the block.\n    "
+        },
+        "contribute": {
+          "default": [
+            "result",
+            "context"
           ],
+          "description": "Indicate if the block contributes to the result and background context.\n    ",
+          "items": {
+            "$ref": "#/$defs/ContributeElement"
+          },
+          "title": "Contribute",
+          "type": "array"
+        },
+        "parser": {
+          "$ref": "#/$defs/OptionalParserType",
+          "default": null,
+          "description": "Parser to use to construct a value out of a string result."
+        },
+        "fallback": {
+          "$ref": "#/$defs/OptionalBlockType",
+          "default": null,
+          "description": "Block to execute in case of error.\n    "
+        },
+        "retry": {
+          "$ref": "#/$defs/OptionalInt",
+          "default": null,
+          "description": "The maximum number of times to retry when an error occurs within a block.\n    "
+        },
+        "trace_error_on_retry": {
+          "$ref": "#/$defs/OptionalBoolOrStr",
+          "default": null,
+          "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n    "
+        },
+        "requirements": {
+          "$ref": "#/$defs/RequirementsType",
+          "default": [],
+          "description": "Specify any requirements that the result of the block must satisfy.\n    "
+        },
+        "role": {
+          "$ref": "#/$defs/OptionalStr",
+          "default": null,
+          "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`."
+        },
+        "pdl__context": {
+          "$ref": "#/$defs/OptionalModelInput",
           "default": [],
-          "description": "Current context\n    ",
-          "title": "Pdl  Context"
+          "description": "Current context."
         },
         "pdl__id": {
-          "anyOf": [
-            {
-              "type": "string"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalStr",
           "default": "",
-          "description": "Unique identifier for this block\n    ",
-          "title": "Pdl  Id"
+          "description": "Unique identifier for this block."
         },
         "pdl__result": {
-          "anyOf": [
-            {},
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalAny",
           "default": null,
-          "description": "Result of the execution of the block",
-          "title": "Pdl  Result"
+          "description": "Result of the execution of the block."
         },
         "pdl__location": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlLocationType"
-            },
-            {
-              "type": "null"
-            }
-          ],
+          "$ref": "#/$defs/OptionalPdlLocationType",
           "default": null
         },
         "pdl__timing": {
-          "anyOf": [
-            {
-              "$ref": "#/$defs/PdlTiming"
-            },
-            {
-              "type": "null"
-            }
-          ],
-          "default": null
+          "$ref": "#/$defs/OptionalPdlTiming",
+          "default": null,
+          "description": "Execution timing information."
         },
         "pdl__is_leaf": {
           "const": false,
@@ -11484,167 +4678,13 @@
         "text": {
           "anyOf": [
             {
-              "type": "boolean"
-            },
-            {
-              "type": "integer"
-            },
-            {
-              "type": "number"
-            },
-            {
-              "type": "string"
-            },
-            {
-              "$ref": "#/$defs/FunctionBlock"
-            },
-            {
-              "$ref": "#/$defs/CallBlock"
-            },
-            {
-              "$ref": "#/$defs/LitellmModelBlock"
-            },
-            {
-              "$ref": "#/$defs/GraniteioModelBlock"
-            },
-            {
-              "$ref": "#/$defs/CodeBlock"
-            },
-            {
-              "$ref": "#/$defs/ArgsBlock"
-            },
-            {
-              "$ref": "#/$defs/GetBlock"
-            },
-            {
-              "$ref": "#/$defs/DataBlock"
-            },
-            {
-              "$ref": "#/$defs/IfBlock"
-            },
-            {
-              "$ref": "#/$defs/MatchBlock"
-            },
-            {
-              "$ref": "#/$defs/RepeatBlock"
-            },
-            {
-              "$ref": "#/$defs/TextBlock"
-            },
-            {
-              "$ref": "#/$defs/LastOfBlock"
-            },
-            {
-              "$ref": "#/$defs/ArrayBlock"
-            },
-            {
-              "$ref": "#/$defs/ObjectBlock"
-            },
-            {
-              "$ref": "#/$defs/MessageBlock"
-            },
-            {
-              "$ref": "#/$defs/ReadBlock"
-            },
-            {
-              "$ref": "#/$defs/IncludeBlock"
-            },
-            {
-              "$ref": "#/$defs/ImportBlock"
-            },
-            {
-              "$ref": "#/$defs/ErrorBlock"
-            },
-            {
-              "$ref": "#/$defs/EmptyBlock"
+              "$ref": "#/$defs/BlockType"
             },
             {
               "items": {
-                "anyOf": [
-                  {
-                    "type": "boolean"
-                  },
-                  {
-                    "type": "integer"
-                  },
-                  {
-                    "type": "number"
-                  },
-                  {
-                    "type": "string"
-                  },
-                  {
-                    "$ref": "#/$defs/FunctionBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/CallBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/LitellmModelBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/GraniteioModelBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/CodeBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/ArgsBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/GetBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/DataBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/IfBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/MatchBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/RepeatBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/TextBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/LastOfBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/ArrayBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/ObjectBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/MessageBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/ReadBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/IncludeBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/ImportBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/ErrorBlock"
-                  },
-                  {
-                    "$ref": "#/$defs/EmptyBlock"
-                  },
-                  {
-                    "type": "null"
-                  }
-                ]
+                "$ref": "#/$defs/BlockType"
               },
               "type": "array"
-            },
-            {
-              "type": "null"
             }
           ],
           "description": "Body of the text.\n    ",
diff --git a/src/pdl/pdl.py b/src/pdl/pdl.py
index f2c08ebf6..f9559df76 100644
--- a/src/pdl/pdl.py
+++ b/src/pdl/pdl.py
@@ -160,6 +160,14 @@ def exec_file(
     return result
 
 
+def pdl(func):
+    def pdl_wrapper(scope):
+        result = exec_str(prog=func.__doc__, scope=scope)
+        return result
+
+    return pdl_wrapper
+
+
 def main():
     parser = argparse.ArgumentParser("")
     parser.add_argument(
diff --git a/src/pdl/pdl_ast.py b/src/pdl/pdl_ast.py
index 396fe7570..9f13293eb 100644
--- a/src/pdl/pdl_ast.py
+++ b/src/pdl/pdl_ast.py
@@ -5,6 +5,7 @@
 from typing import (
     Annotated,
     Any,
+    Callable,
     Generic,
     Literal,
     Mapping,
@@ -24,7 +25,6 @@
     RootModel,
     TypeAdapter,
 )
-from pydantic.json_schema import SkipJsonSchema
 from typing_extensions import TypeAliasType
 
 from .pdl_context import PDLContext
@@ -37,13 +37,28 @@ def _ensure_lower(value):
     return value
 
 
-ScopeType: TypeAlias = PdlDict[str, Any]
+OptionalStr = TypeAliasType("OptionalStr", Optional[str])
+"""Optional string."""
+OptionalInt = TypeAliasType("OptionalInt", Optional[int])
+"""Optional integer."""
+OptionalBoolOrStr = TypeAliasType("OptionalBoolOrStr", Optional[Union[bool, str]])
+"""Optional boolean or string."""
+OptionalAny = TypeAliasType("OptionalAny", Optional[Any])
+"""Optional value of any type."""
 
+OptionalBlockType = TypeAliasType("OptionalBlockType", Optional["BlockType"])
+"""Optional block."""
 
-ModelInput: TypeAlias = Sequence[Mapping[str, Any]]
 
+ScopeType = TypeAliasType("ScopeType", PdlDict[str, Any])
+"""Type of the execution environment."""
 
-LazyMessage: TypeAlias = PdlLazy[dict[str, Any]]
+ModelInput = TypeAliasType("ModelInput", Sequence[Mapping[str, Any]])
+"""Type of the input of an LLM call."""
+OptionalModelInput = TypeAliasType("OptionalModelInput", Optional[ModelInput])
+"""Optional value of type ModelInput."""
+
+LazyMessage = TypeAliasType("LazyMessage", PdlLazy[dict[str, Any]])
 LazyMessages: TypeAlias = PDLContext
 
 
@@ -62,9 +77,11 @@ class BlockKind(StrEnum):
     IF = "if"
     MATCH = "match"
     REPEAT = "repeat"
+    MAP = "map"
     READ = "read"
     INCLUDE = "include"
     IMPORT = "import"
+    AGGREGATOR = "aggregator"
     EMPTY = "empty"
     ERROR = "error"
 
@@ -78,6 +95,12 @@ class PdlLocationType(BaseModel):
     table: dict[str, int]
 
 
+OptionalPdlLocationType = TypeAliasType(
+    "OptionalPdlLocationType", Optional[PdlLocationType]
+)
+"""Optional location type."""
+
+
 empty_block_location = PdlLocationType(file="", path=[], table={})
 
 
@@ -95,19 +118,39 @@ class LocalizedExpression(BaseModel, Generic[LocalizedExpressionT]):
     )
     pdl__expr: Any
     pdl__result: Optional[LocalizedExpressionT] = None
-    pdl__location: Optional[PdlLocationType] = None
+    pdl__location: OptionalPdlLocationType = None
 
 
 ExpressionTypeT = TypeVar("ExpressionTypeT")
 ExpressionType: TypeAlias = LocalizedExpression[ExpressionTypeT] | ExpressionTypeT | str
 """Expressions are represented Jinja as strings in between `${` and `}`."""
 
+ExpressionStr = TypeAliasType("ExpressionStr", ExpressionType[str])
+"""Expression evaluating into a string."""
+
+OptionalExpressionStr = TypeAliasType("OptionalExpressionStr", Optional[ExpressionStr])
+"""Optional expression evaluating into a string."""
+
+ExpressionInt = TypeAliasType("ExpressionInt", ExpressionType[int])
+"""Expression evaluating into an int."""
+
+OptionalExpressionInt = TypeAliasType("OptionalExpressionInt", Optional[ExpressionInt])
+"""Optional expression evaluating into an int."""
+
+ExpressionBool = TypeAliasType("ExpressionBool", ExpressionType[bool])
+"""Expression evaluating into a bool."""
+
+OptionalExpressionBool = TypeAliasType(
+    "OptionalExpressionBool", Optional[ExpressionBool]
+)
+"""Optional expression evaluating into a bool."""
+
 
 class Pattern(BaseModel):
     """Common fields for structured patterns."""
 
     model_config = ConfigDict(extra="forbid")
-    def_: Optional[str] = Field(default=None, alias="def")
+    def_: OptionalStr = Field(default=None, alias="def")
     """Name of the variable used to store the value matched by the pattern.
     """
 
@@ -139,16 +182,11 @@ class AnyPattern(Pattern):
     any: Literal[None]
 
 
-PatternType: TypeAlias = (
-    None
-    | bool
-    | int
-    | float
-    | str
-    | OrPattern
-    | ArrayPattern
-    | ObjectPattern
-    | AnyPattern
+PatternType = TypeAliasType(
+    "PatternType",
+    Union[
+        None, bool, int, float, str, OrPattern, ArrayPattern, ObjectPattern, AnyPattern
+    ],
 )
 """Patterns allowed to match values in a `case` clause."""
 
@@ -233,7 +271,7 @@ class Parser(BaseModel):
     """Common fields for all parsers (`parser` field)."""
 
     model_config = ConfigDict(extra="forbid")
-    description: Optional[str] = None
+    description: OptionalStr = None
     """Documentation associated to the parser.
     """
     spec: PdlTypeType = None
@@ -260,10 +298,14 @@ class RegexParser(Parser):
     """Function used to parse to value (https://docs.python.org/3/library/re.html)."""
 
 
-ParserType: TypeAlias = Literal["json", "jsonl", "yaml"] | PdlParser | RegexParser
-
+ParserType = TypeAliasType(
+    "ParserType", Union[Literal["json", "jsonl", "yaml"], PdlParser, RegexParser]
+)
+"""Different parsers."""
+OptionalParserType = TypeAliasType("OptionalParserType", Optional[ParserType])
+"""Optional parser."""
 
-RoleType: TypeAlias = Optional[str]
+RoleType: TypeAlias = OptionalStr
 """Role name."""
 
 
@@ -272,6 +314,8 @@ class ContributeTarget(StrEnum):
 
     RESULT = "result"
     CONTEXT = "context"
+    STDOUT = "stdout"
+    STDERR = "stderr"
 
 
 class ContributeValue(BaseModel):
@@ -279,39 +323,72 @@ class ContributeValue(BaseModel):
 
     model_config = ConfigDict(extra="forbid")
 
-    value: ExpressionType[list[Any]]
+    value: ExpressionType[Any]
     """Value to contribute."""
 
 
+ContributeElement = TypeAliasType(
+    "ContributeElement", Union[ContributeTarget, str, dict[str, ContributeValue]]
+)
+"""Type of the contribute field."""
+
+
+class RequirementType(BaseModel):
+    """Single requirement definition."""
+
+    model_config = ConfigDict(extra="forbid")
+
+    expect: ExpressionType
+    """English description of the requirement"""
+
+    evaluate: Optional[ExpressionType["FunctionBlock"]] = None
+    """Evaluation function for the requirement"""
+
+    transformContext: Optional[ExpressionType["FunctionBlock"]] = None
+    """Function to transform the context for the requirement"""
+
+
+RequirementsType = TypeAliasType("RequirementsType", Sequence[RequirementType])
+"""Type of requirements field"""
+
+
 class PdlTiming(BaseModel):
     """Internal data structure to record timing information in the trace."""
 
     model_config = ConfigDict(extra="forbid")
-    start_nanos: Optional[int] = 0
+    start_nanos: OptionalInt = 0
     """Time at which block execution began.
     """
-    end_nanos: Optional[int] = 0
+    end_nanos: OptionalInt = 0
     """Time at which block execution ended.
     """
-    first_use_nanos: Optional[int] = 0
+    first_use_nanos: OptionalInt = 0
     """Time at which the value of the block was needed for the first time.
     """
-    timezone: Optional[str] = ""
+    timezone: OptionalStr = ""
     """Timezone of start_nanos and end_nanos.
     """
 
 
+OptionalPdlTiming = TypeAliasType("OptionalPdlTiming", Optional[PdlTiming])
+"""Optional execution time information."""
+
+
 class PdlUsage(BaseModel):
     """Internal data structure to record token consumption usage information."""
 
-    completion_tokens: Optional[int] = 0
+    completion_tokens: OptionalInt = 0
     """Completion tokens consumed
     """
-    prompt_tokens: Optional[int] = 0
+    prompt_tokens: OptionalInt = 0
     """Prompt tokens consumed
     """
 
 
+OptionalPdlUsage = TypeAliasType("OptionalPdlUsage", Optional[PdlUsage])
+"""Optional usage of statistics of an LLM call."""
+
+
 class Block(BaseModel):
     """Common fields for all PDL blocks."""
 
@@ -319,9 +396,10 @@ class Block(BaseModel):
         extra="forbid",
         use_attribute_docstrings=True,
         arbitrary_types_allowed=True,
+        validate_by_name=True,
     )
 
-    description: Optional[str] = None
+    description: OptionalStr = None
     """Documentation associated to the block.
     """
     spec: PdlTypeType = None
@@ -330,42 +408,46 @@ class Block(BaseModel):
     defs: dict[str, "BlockType"] = {}
     """Set of definitions executed before the execution of the block.
     """
-    def_: Optional[str] = Field(default=None, alias="def")
+    def_: OptionalStr = Field(default=None, alias="def")
     """Name of the variable used to store the result of the execution of the block.
     """
-    contribute: Sequence[ContributeTarget | dict[str, ContributeValue]] = [
+    contribute: Sequence[ContributeElement] = [
         ContributeTarget.RESULT,
         ContributeTarget.CONTEXT,
     ]
     """Indicate if the block contributes to the result and background context.
     """
-    parser: Annotated[Optional[ParserType], BeforeValidator(_ensure_lower)] = None
+    parser: Annotated[OptionalParserType, BeforeValidator(_ensure_lower)] = None
     """Parser to use to construct a value out of a string result."""
-    fallback: Optional["BlockType"] = None
+    fallback: OptionalBlockType = None
     """Block to execute in case of error.
     """
-    retry: Optional[int] = None
+    retry: OptionalInt = None
     """The maximum number of times to retry when an error occurs within a block.
     """
-    trace_error_on_retry: Optional[bool] | str = None
+    trace_error_on_retry: OptionalBoolOrStr = None
     """Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.
     """
+
+    requirements: RequirementsType = []
+    """Specify any requirements that the result of the block must satisfy.
+    """
+
     role: RoleType = None
     """Role associated to the block and sub-blocks.
     Typical roles are `system`, `user`, and `assistant`,
     but there may be other roles such as `available_tools`.
     """
     # Fields for internal use
-    pdl__context: Optional[ModelInput] = []
-    """Current context
-    """
-    pdl__id: Optional[str] = ""
-    """Unique identifier for this block
-    """
-    pdl__result: Optional[Any] = None
-    """Result of the execution of the block"""
-    pdl__location: Optional[PdlLocationType] = None
-    pdl__timing: Optional[PdlTiming] = None
+    pdl__context: OptionalModelInput = []
+    """Current context."""
+    pdl__id: OptionalStr = ""
+    """Unique identifier for this block."""
+    pdl__result: OptionalAny = None
+    """Result of the execution of the block."""
+    pdl__location: OptionalPdlLocationType = None
+    pdl__timing: OptionalPdlTiming = None
+    """Execution timing information."""
 
 
 class LeafBlock(Block):
@@ -398,9 +480,6 @@ class FunctionBlock(LeafBlock):
     """Function signature computed from the function definition.
     """
 
-    # Field for internal use
-    pdl__scope: SkipJsonSchema[Optional[ScopeType]] = Field(default=None, repr=False)
-
 
 class CallBlock(LeafBlock):
     """Calling a function."""
@@ -413,7 +492,7 @@ class CallBlock(LeafBlock):
     """Arguments of the function with their values.
     """
     # Field for internal use
-    pdl__trace: Optional["BlockType"] = None
+    pdl__trace: OptionalBlockType = None
 
 
 class LitellmParameters(BaseModel):
@@ -519,14 +598,14 @@ class ModelBlock(LeafBlock):
     input: "BlockType" = "${ pdl_context }"
     """Messages to send to the model.
     """
-    modelResponse: Optional[str] = None
+    modelResponse: OptionalStr = None
     """Variable where to store the raw response of the model.
     """
     # Field for internal use
-    pdl__usage: Optional[PdlUsage] = None
+    pdl__usage: OptionalPdlUsage = None
     """Tokens consumed during model call
     """
-    pdl__model_input: Optional[ModelInput] = None
+    pdl__model_input: OptionalModelInput = None
 
 
 class LitellmModelBlock(ModelBlock):
@@ -544,7 +623,7 @@ class LitellmModelBlock(ModelBlock):
     platform: Literal[ModelPlatform.LITELLM] = ModelPlatform.LITELLM
     """Optional field to ensure that the block is using LiteLLM.
     """
-    model: ExpressionType[str]
+    model: ExpressionStr
     """Name of the model following the LiteLLM convention.
     """
     parameters: Optional[LitellmParameters | ExpressionType[dict]] = None
@@ -553,10 +632,10 @@ class LitellmModelBlock(ModelBlock):
 
 
 class GraniteioProcessor(BaseModel):
-    type: Optional[ExpressionType[str]] = None
+    type: OptionalExpressionStr = None
     """Type of IO processor.
     """
-    model: Optional[ExpressionType[str]] = None
+    model: OptionalExpressionStr = None
     """Model name used by the backend.
     """
     backend: ExpressionType[str | dict[str, Any] | object]
@@ -621,7 +700,7 @@ class ArgsBlock(BaseCodeBlock):
     """
 
     lang: Annotated[Literal["command"], BeforeValidator(_ensure_lower)] = "command"
-    args: list[ExpressionType[str]]
+    args: list[ExpressionStr]
     """The argument vector to spawn.
     """
 
@@ -709,9 +788,9 @@ class MessageBlock(LeafBlock):
     kind: Literal[BlockKind.MESSAGE] = BlockKind.MESSAGE
     content: "BlockType"
     """Content of the message."""
-    name: Optional[ExpressionType[str]] = None
+    name: OptionalExpressionStr = None
     """For example, the name of the tool that was invoked, for which this message is the tool response."""
-    tool_call_id: Optional[ExpressionType[str]] = None
+    tool_call_id: OptionalExpressionStr = None
     """The id of the tool invocation for which this message is the tool response."""
 
 
@@ -731,13 +810,13 @@ class IfBlock(StructuredBlock):
     """
 
     kind: Literal[BlockKind.IF] = BlockKind.IF
-    condition: ExpressionType[bool] = Field(alias="if")
+    condition: ExpressionBool = Field(alias="if")
     """Condition.
     """
     then: "BlockType"
     """Branch to execute if the condition is true.
     """
-    else_: Optional["BlockType"] = Field(default=None, alias="else")
+    else_: OptionalBlockType = Field(default=None, alias="else")
     """Branch to execute if the condition is false.
     """
 
@@ -749,7 +828,7 @@ class MatchCase(BaseModel):
     case: Optional[PatternType] = None
     """Value to match.
     """
-    if_: Optional[ExpressionType[bool]] = Field(default=None, alias="if")
+    if_: OptionalExpressionBool = Field(default=None, alias="if")
     """Boolean condition to satisfy.
     """
     then: "BlockType"
@@ -791,23 +870,18 @@ class MatchBlock(StructuredBlock):
     """
 
 
-class IterationType(StrEnum):
-    LASTOF = "lastOf"
-    ARRAY = "array"
-    OBJECT = "object"
-    TEXT = "text"
-
-
 class JoinConfig(BaseModel):
     """Configure how loop iterations should be combined."""
 
-    model_config = ConfigDict(extra="forbid", use_attribute_docstrings=True)
+    model_config = ConfigDict(
+        extra="forbid", use_attribute_docstrings=True, validate_by_name=True
+    )
 
 
 class JoinText(JoinConfig):
     """Join loop iterations as a string."""
 
-    as_: Literal[IterationType.TEXT] = Field(alias="as", default=IterationType.TEXT)
+    as_: Literal["text"] = Field(alias="as", default="text")
     """String concatenation of the result of each iteration.
     """
 
@@ -819,7 +893,7 @@ class JoinText(JoinConfig):
 class JoinArray(JoinConfig):
     """Join loop iterations as an array."""
 
-    as_: Literal[IterationType.ARRAY] = Field(alias="as")
+    as_: Literal["array"] = Field(alias="as")
     """Return the result of each iteration as an array.
     """
 
@@ -827,7 +901,7 @@ class JoinArray(JoinConfig):
 class JoinObject(JoinConfig):
     """Join loop iterations as an object."""
 
-    as_: Literal[IterationType.OBJECT] = Field(alias="as")
+    as_: Literal["object"] = Field(alias="as")
     """Return the union of the objects created at each iteration.
     """
 
@@ -835,18 +909,30 @@ class JoinObject(JoinConfig):
 class JoinLastOf(JoinConfig):
     """Join loop iterations as the value of the last iteration."""
 
-    as_: Literal[IterationType.LASTOF] = Field(alias="as")
+    as_: Literal["lastOf"] = Field(alias="as")
     """Return the result of the last iteration.
     """
 
 
-JoinType: TypeAlias = JoinText | JoinArray | JoinObject | JoinLastOf
+class JoinReduce(JoinConfig):
+    """Join loop iterations as the value of the last iteration."""
+
+    as_: Literal["reduce"] = Field(alias="as", default="reduce")
+
+    reduce: ExpressionType[Callable]
+    """Function used to combine the results."""
+
+
+JoinType = TypeAliasType(
+    "JoinType", Union[JoinText, JoinArray, JoinObject, JoinLastOf, JoinReduce]
+)
 """Different ways to join loop iterations."""
 
 
 class RepeatBlock(StructuredBlock):
     """
-    Repeat the execution of a block.
+    Repeat the execution of a block sequentially.
+    The scope and `pdl_context` are accumulated in between iterations.
 
     For loop example:
     ```PDL
@@ -857,12 +943,15 @@ class RepeatBlock(StructuredBlock):
         "${ name }'s number is ${ number }\\n"
     ```
 
-    Bounded loop:
+    While loop:
     ```PDL
-    index: i
-    maxIterations: 5
+    defs:
+      i: 0
+    while: ${i < 5}
     repeat:
-        ${ i }
+        defs:
+          i: ${ i + 1}
+        data: ${ i }
     join:
       as: array
     ```
@@ -872,24 +961,73 @@ class RepeatBlock(StructuredBlock):
     for_: Optional[dict[str, ExpressionType[list]]] = Field(default=None, alias="for")
     """Arrays to iterate over.
     """
-    index: Optional[str] = None
+    index: OptionalStr = None
     """Name of the variable containing the loop iteration.
     """
-    while_: ExpressionType[bool] = Field(default=True, alias="while")
+    while_: ExpressionBool = Field(default=True, alias="while")
     """Condition to stay at the beginning of the loop.
     """
     repeat: "BlockType"
     """Body of the loop.
     """
-    until: ExpressionType[bool] = False
+    until: ExpressionBool = False
     """Condition to exit at the end of the loop.
     """
-    maxIterations: Optional[ExpressionType[int]] = None
+    maxIterations: OptionalExpressionInt = None
+    """Maximal number of iterations to perform.
+    """
+    join: JoinType = JoinText()
+    """Define how to combine the result of each iteration.
+    """
+    # Field for internal use
+    pdl__trace: Optional[list["BlockType"]] = None
+
+
+class MapBlock(StructuredBlock):
+    """
+    Independent executions of  a block.
+    Repeat the execution of a block starting from the initial scope
+    and `pdl_context`.
+
+    For loop example:
+    ```PDL
+    for:
+        number: [1, 2, 3, 4]
+        name: ["Bob", "Carol", "David", "Ernest"]
+    map:
+        "${ name }'s number is ${ number }\\n"
+    ```
+
+    Bounded loop:
+    ```PDL
+    index: i
+    maxIterations: 5
+    map:
+        ${ i }
+    join:
+      as: array
+    ```
+    """
+
+    kind: Literal[BlockKind.MAP] = BlockKind.MAP
+    for_: Optional[dict[str, ExpressionType[list]]] = Field(default=None, alias="for")
+    """Arrays to iterate over.
+    """
+    index: OptionalStr = None
+    """Name of the variable containing the loop iteration.
+    """
+    map: "BlockType"
+    """Body of the iterator.
+    """
+    maxIterations: OptionalExpressionInt = None
     """Maximal number of iterations to perform.
     """
     join: JoinType = JoinText()
     """Define how to combine the result of each iteration.
     """
+    maxWorkers: OptionalInt = None
+    """Maximal number of workers to execute the map in parallel. Is it is set to `0`, the execution is sequential otherwise it is given as argument to the `ThreadPoolExecutor`.
+    """
     # Field for internal use
     pdl__trace: Optional[list["BlockType"]] = None
 
@@ -911,10 +1049,10 @@ class ReadBlock(LeafBlock):
     """
 
     kind: Literal[BlockKind.READ] = BlockKind.READ
-    read: ExpressionType[str] | None
+    read: OptionalExpressionStr
     """Name of the file to read. If `None`, read the standard input.
     """
-    message: Optional[str] = None
+    message: OptionalStr = None
     """Message to prompt the user to enter a value.
     """
     multiline: bool = False
@@ -930,7 +1068,7 @@ class IncludeBlock(StructuredBlock):
     """Name of the file to include.
     """
     # Field for internal use
-    pdl__trace: Optional["BlockType"] = None
+    pdl__trace: OptionalBlockType = None
 
 
 class ImportBlock(LeafBlock):
@@ -941,7 +1079,46 @@ class ImportBlock(LeafBlock):
     """Name of the file to import.
     """
     # Field for internal use
-    pdl__trace: Optional["BlockType"] = None
+    pdl__trace: OptionalBlockType = None
+
+
+class AggregatorConfig(BaseModel):
+    """Common fields for all aggregator configurations."""
+
+    model_config = ConfigDict(
+        extra="forbid",
+        use_attribute_docstrings=True,
+        arbitrary_types_allowed=True,
+    )
+
+    description: Optional[str] = None
+    """Documentation associated to the aggregator config.
+    """
+
+
+class FileAggregatorConfig(AggregatorConfig):
+    file: ExpressionType[str]
+    """Name of the file to which contribute."""
+    mode: ExpressionType[str] = "w"
+    """File opening mode."""
+    encoding: ExpressionType[Optional[str]] = "utf-8"
+    """File encoding."""
+    prefix: ExpressionType[str] = ""
+    """Prefix to the contributed value."""
+    suffix: ExpressionType[str] = "\n"
+    """Suffix to the contributed value."""
+    flush: ExpressionType[bool] = False
+    """Whether to forcibly flush the stream."""
+
+
+AggregatorType: TypeAlias = Literal["context"] | FileAggregatorConfig
+
+
+class AggregatorBlock(LeafBlock):
+    """Create a new aggregator that can be use in the `contribute` field."""
+
+    kind: Literal[BlockKind.AGGREGATOR] = BlockKind.AGGREGATOR
+    aggregator: AggregatorType
 
 
 class ErrorBlock(LeafBlock):
@@ -974,6 +1151,7 @@ class EmptyBlock(LeafBlock):
     | IfBlock
     | MatchBlock
     | RepeatBlock
+    | MapBlock
     | TextBlock
     | LastOfBlock
     | ArrayBlock
@@ -982,12 +1160,15 @@ class EmptyBlock(LeafBlock):
     | ReadBlock
     | IncludeBlock
     | ImportBlock
+    | AggregatorBlock
     | ErrorBlock
     | EmptyBlock
 )
 """Different types of structured blocks.
 """
-BlockType: TypeAlias = None | bool | int | float | str | AdvancedBlockType
+BlockType = TypeAliasType(
+    "BlockType", Union[None, bool, int, float, str, AdvancedBlockType]
+)
 """All kinds of blocks.
 """
 BlockOrBlocksType: TypeAlias = BlockType | list[BlockType]  # pyright: ignore
@@ -1022,7 +1203,7 @@ def __init__(
         message: str,
         loc: Optional[PdlLocationType] = None,
         trace: Optional[BlockType] = None,
-        fallback: Optional[Any] = None,
+        fallback: OptionalAny = None,
     ):
         super().__init__(message)
         self.loc = loc
@@ -1045,7 +1226,7 @@ def __init__(
         message: str,
         blocks: list[BlockType],
         loc: Optional[PdlLocationType] = None,
-        fallback: Optional[Any] = None,
+        fallback: OptionalAny = None,
     ):
         super().__init__(message)
         self.loc = loc
diff --git a/src/pdl/pdl_ast_utils.py b/src/pdl/pdl_ast_utils.py
index 241662680..88b4ab31c 100644
--- a/src/pdl/pdl_ast_utils.py
+++ b/src/pdl/pdl_ast_utils.py
@@ -1,6 +1,7 @@
 from typing import Callable, Sequence
 
 from .pdl_ast import (
+    AggregatorBlock,
     ArrayBlock,
     Block,
     BlockType,
@@ -19,6 +20,7 @@
     IncludeBlock,
     LastOfBlock,
     LitellmModelBlock,
+    MapBlock,
     MatchBlock,
     MatchCase,
     MessageBlock,
@@ -85,6 +87,11 @@ def iter_block_children(f: Callable[[BlockType], None], block: BlockType) -> Non
             if block.pdl__trace is not None:
                 for trace in block.pdl__trace:
                     f(trace)
+        case MapBlock():
+            f(block.map)
+            if block.pdl__trace is not None:
+                for trace in block.pdl__trace:
+                    f(trace)
         case ErrorBlock():
             f(block.program)
         case ReadBlock():
@@ -95,6 +102,8 @@ def iter_block_children(f: Callable[[BlockType], None], block: BlockType) -> Non
         case ImportBlock():
             if block.pdl__trace is not None:
                 f(block.pdl__trace)
+        case AggregatorBlock():
+            pass
         case EmptyBlock():
             pass
         case _:
@@ -191,6 +200,12 @@ def map_block_children(f: MappedFunctions, block: BlockType) -> BlockType:
             block.until = f.f_expr(block.until)
             if block.pdl__trace is not None:
                 block.pdl__trace = [f.f_block(trace) for trace in block.pdl__trace]
+        case MapBlock():
+            if block.for_ is not None:
+                block.for_ = {x: f.f_expr(blocks) for x, blocks in block.for_.items()}
+            block.map = f.f_block(block.map)
+            if block.pdl__trace is not None:
+                block.pdl__trace = [f.f_block(trace) for trace in block.pdl__trace]
         case ErrorBlock():
             block.program = f.f_block(block.program)
         case ReadBlock():
@@ -201,6 +216,8 @@ def map_block_children(f: MappedFunctions, block: BlockType) -> BlockType:
         case ImportBlock():
             if block.pdl__trace is not None:
                 block.pdl__trace = f.f_block(block.pdl__trace)
+        case AggregatorBlock():
+            pass
         case EmptyBlock():
             pass
         case _:
diff --git a/src/pdl/pdl_compilers/to_regex.py b/src/pdl/pdl_compilers/to_regex.py
index 602e81a0c..51aeb13e0 100644
--- a/src/pdl/pdl_compilers/to_regex.py
+++ b/src/pdl/pdl_compilers/to_regex.py
@@ -4,6 +4,7 @@
 from typing import Sequence, TypeAlias
 
 from ..pdl_ast import (
+    AggregatorBlock,
     Block,
     BlockType,
     CallBlock,
@@ -18,6 +19,7 @@
     LitellmModelBlock,
     LitellmParameters,
     LocalizedExpression,
+    MapBlock,
     ModelBlock,
     ReadBlock,
     RepeatBlock,
@@ -312,12 +314,18 @@ def compile_block(
             body, scope = compile_block(scope, block.repeat)
             # XXX TODO: join char in text mode XXX
             regex = ReStar(body)
+        case MapBlock():
+            body, scope = compile_block(scope, block.map)
+            # XXX TODO: join char in text mode XXX
+            regex = ReStar(body)
         case ReadBlock():
             regex = ReStar(ReAnyChar())
         case IncludeBlock():
             regex = ReStar(ReAnyChar())  # XXX TODO XXX
         case ImportBlock():
             regex = ReStar(ReAnyChar())  # XXX TODO XXX
+        case AggregatorBlock():
+            regex = ReStar(ReAnyChar())  # XXX TODO XXX
         case FunctionBlock():
             regex = ReStar(ReAnyChar())  # XXX TODO XXX
             # scope = scope | {x: ReStar(ReAnyChar) for x in block.function.keys()}
diff --git a/src/pdl/pdl_context.py b/src/pdl/pdl_context.py
index 941df2abd..26909d109 100644
--- a/src/pdl/pdl_context.py
+++ b/src/pdl/pdl_context.py
@@ -40,8 +40,11 @@ def __mul__(self, value: "PDLContext"):
 class SingletonContext(PDLContext):
     message: PdlLazy[dict[str, Any]]
 
-    def __init__(self, message: PdlLazy[dict[str, Any]]):
-        self.message = message
+    def __init__(self, message: PdlLazy[dict[str, Any]] | dict[str, Any]):
+        if isinstance(message, PdlLazy):
+            self.message = message
+        else:
+            self.message = PdlConst(message)
 
     def serialize(self, mode: SerializeMode) -> list[dict[str, Any]]:
         result = self.message.result()
@@ -60,20 +63,23 @@ def __repr__(self):  # pyright: ignore
 class IndependentContext(PDLContext):
     context: PdlLazy[list[PDLContext]]
 
-    def __init__(self, context: list[PDLContext]):
+    def __init__(self, context: list[PDLContext | dict[str, Any]]):
         ret: list[PDLContext] = []
         for item in context:
-            if isinstance(item, IndependentContext):
-                ret += item.context.data
-            elif isinstance(item, SingletonContext):
-                ret += [item]
-            elif isinstance(item, DependentContext) and len(item) == 0:
-                pass
-            else:
-                # Not all elements of the list are Independent, so return
-                self.context = PdlList(context)
-                return
-        # All elements of the list are Independent
+            match item:
+                case IndependentContext():
+                    ret = ret + item.context.data
+                case SingletonContext():
+                    ret = ret + [item]
+                case DependentContext():
+                    if len(item) == 0:
+                        pass
+                    else:
+                        ret = ret + [item]
+                case dict():
+                    ret = ret + [SingletonContext(item)]
+                case _:
+                    assert False
         self.context = PdlList(ret)
 
     def serialize(self, mode: SerializeMode) -> list[dict[str, Any]]:
@@ -92,27 +98,30 @@ def __getitem__(self, index: int | slice):  # pyright: ignore
 
     def __repr__(self):  # pyright: ignore
         ret = "{"
-        ret += ",".join([i.__repr__() for i in self.context.result()])
+        ret = ret + ",".join([i.__repr__() for i in self.context.result()])
         return ret + "}"
 
 
 class DependentContext(PDLContext):
     context: PdlLazy[list[PDLContext]]
 
-    def __init__(self, context: list[PDLContext]):
+    def __init__(self, context: list[PDLContext | dict[str, Any]]):
         ret: list[PDLContext] = []
         for item in context:
-            if isinstance(item, DependentContext):
-                ret += item.context.data
-            elif isinstance(item, SingletonContext):
-                ret += [item]
-            elif isinstance(item, IndependentContext) and len(item) == 0:
-                pass
-            else:
-                # Not all elements of the list are Dependent, so return
-                self.context = PdlList(context)
-                return
-        # All elements of the list are Dependent
+            match item:
+                case DependentContext():
+                    ret = ret + item.context.data
+                case SingletonContext():
+                    ret = ret + [item]
+                case IndependentContext():
+                    if len(item) == 0:
+                        pass
+                    else:
+                        ret = ret + [item]
+                case dict():
+                    ret = ret + [SingletonContext(item)]
+                case _:
+                    assert False
         self.context = PdlList(ret)
 
     def serialize(self, mode: SerializeMode) -> list[dict[str, Any]]:
@@ -129,7 +138,7 @@ def __getitem__(self, index: int | slice):  # pyright: ignore
 
     def __repr__(self):  # pyright: ignore
         ret = "["
-        ret += ",".join([i.__repr__() for i in self.context.result()])
+        ret = ret + ",".join([i.__repr__() for i in self.context.result()])
         return ret + "]"
 
 
diff --git a/src/pdl/pdl_dumper.py b/src/pdl/pdl_dumper.py
index bcd3f9379..0eb8b108a 100644
--- a/src/pdl/pdl_dumper.py
+++ b/src/pdl/pdl_dumper.py
@@ -8,6 +8,8 @@
 
 from . import pdl_ast
 from .pdl_ast import (
+    AggregatorBlock,
+    AggregatorType,
     AnyPattern,
     ArgsBlock,
     ArrayBlock,
@@ -15,13 +17,14 @@
     Block,
     CallBlock,
     CodeBlock,
+    ContributeElement,
     ContributeTarget,
-    ContributeValue,
     DataBlock,
     EmptyBlock,
     EnumPdlType,
     ErrorBlock,
     ExpressionType,
+    FileAggregatorConfig,
     FunctionBlock,
     GetBlock,
     GraniteioModelBlock,
@@ -29,6 +32,10 @@
     IfBlock,
     ImportBlock,
     IncludeBlock,
+    JoinArray,
+    JoinLastOf,
+    JoinObject,
+    JoinReduce,
     JoinText,
     JoinType,
     JsonSchemaTypePdlType,
@@ -36,6 +43,7 @@
     LitellmModelBlock,
     LitellmParameters,
     LocalizedExpression,
+    MapBlock,
     MatchBlock,
     MessageBlock,
     ObjectBlock,
@@ -54,6 +62,7 @@
     ReadBlock,
     RegexParser,
     RepeatBlock,
+    RequirementType,
     StructuredBlock,
     TextBlock,
 )
@@ -213,6 +222,8 @@ def block_to_dict(  # noqa: C901
             d["import"] = block.import_
             if block.pdl__trace:
                 d["pdl__trace"] = block_to_dict(block.pdl__trace, json_compatible)
+        case AggregatorBlock():
+            d["aggregator"] = aggregator_to_dict(block.aggregator)
         case IfBlock():
             d["if"] = expr_to_dict(block.condition, json_compatible)
             d["then"] = block_to_dict(block.then, json_compatible)
@@ -243,7 +254,22 @@ def block_to_dict(  # noqa: C901
                 d["until"] = expr_to_dict(block.until, json_compatible)
             if block.maxIterations is not None:
                 d["maxIterations"] = expr_to_dict(block.maxIterations, json_compatible)
-            d["join"] = join_to_dict(block.join)
+            d["join"] = join_to_dict(block.join, json_compatible)
+            if block.pdl__trace is not None:
+                d["pdl__trace"] = [
+                    block_to_dict(b, json_compatible) for b in block.pdl__trace
+                ]
+        case MapBlock():
+            if block.for_ is not None:
+                d["for"] = expr_to_dict(block.for_, json_compatible)
+            if block.index is not None:
+                d["index"] = block.index
+            if block.maxWorkers is not None:
+                d["maxWorkers"] = expr_to_dict(block.maxWorkers, json_compatible)
+            d["map"] = block_to_dict(block.map, json_compatible)
+            if block.maxIterations is not None:
+                d["maxIterations"] = expr_to_dict(block.maxIterations, json_compatible)
+            d["join"] = join_to_dict(block.join, json_compatible)
             if block.pdl__trace is not None:
                 d["pdl__trace"] = [
                     block_to_dict(b, json_compatible) for b in block.pdl__trace
@@ -279,6 +305,10 @@ def block_to_dict(  # noqa: C901
         d["pdl__result"] = data_to_dict(block.pdl__result.result(), json_compatible)
     if block.parser is not None:
         d["parser"] = parser_to_dict(block.parser)
+    if block.requirements is not None:
+        d["requirements"] = [
+            requirement_to_dict(b, json_compatible) for b in block.requirements
+        ]
     # if block.pdl__location is not None:
     #     d["pdl__location"] = location_to_dict(block.pdl__location)
     if block.fallback is not None:
@@ -380,6 +410,16 @@ def usage_to_dict(usage: PdlUsage) -> dict:
     return d
 
 
+def requirement_to_dict(req: RequirementType, json_compatible: bool) -> dict:
+    d: dict = {}
+    d["expect"] = req.expect
+    if req.evaluate is not None:
+        d["evaluate"] = expr_to_dict(req.evaluate, json_compatible)
+    if req.transformContext is not None:
+        d["transformContext"] = expr_to_dict(req.transformContext, json_compatible)
+    return d
+
+
 def pattern_to_dict(pattern: PatternType):
     if not isinstance(pattern, pdl_ast.Pattern):
         return pattern
@@ -402,13 +442,17 @@ def pattern_to_dict(pattern: PatternType):
     return result
 
 
-def join_to_dict(join: JoinType) -> dict[str, Any]:
-    d = {}
+def join_to_dict(join: JoinType, json_compatible: bool) -> dict[str, Any]:
+    d: dict[str, Any] = {}
     match join:
         case JoinText():
             d["with"] = join.with_
-        case _:
+        case JoinArray() | JoinObject() | JoinLastOf():
             d["as"] = str(join.as_)
+        case JoinReduce():
+            d["reduce"] = expr_to_dict(join.reduce, json_compatible)
+        case _:
+            assert False
     return d
 
 
@@ -453,7 +497,7 @@ def location_to_dict(location: PdlLocationType) -> dict[str, Any]:
 
 
 def contribute_to_list(
-    contribute: Sequence[ContributeTarget | dict[str, ContributeValue]],
+    contribute: Sequence[ContributeElement],
 ) -> list[str | dict[str, Any]]:
     acc: list[str | dict[str, Any]] = []
     for contrib in contribute:
@@ -464,6 +508,17 @@ def contribute_to_list(
     return acc
 
 
+def aggregator_to_dict(aggregator: AggregatorType):
+    match aggregator:
+        case "context":
+            result = aggregator
+        case FileAggregatorConfig():
+            result = aggregator.model_dump()
+        case _:
+            assert False, "Unexpected aggregator"
+    return result
+
+
 def build_exclude(obj: Any, regex: re.Pattern[str]) -> Any:
     if isinstance(obj, BaseModel):
         exclude: dict[str, Any] = {}
diff --git a/src/pdl/pdl_granite_io.py b/src/pdl/pdl_granite_io.py
index 6b31dbcbe..4f14dca6e 100644
--- a/src/pdl/pdl_granite_io.py
+++ b/src/pdl/pdl_granite_io.py
@@ -1,5 +1,5 @@
 # pylint: disable=import-outside-toplevel
-from asyncio import run_coroutine_threadsafe
+from asyncio import AbstractEventLoop, run_coroutine_threadsafe
 from typing import Any, Optional
 
 from granite_io.types import ChatCompletionInputs
@@ -13,7 +13,6 @@
     PDLRuntimeError,
 )
 from .pdl_lazy import PdlConst, PdlLazy, lazy_apply
-from .pdl_llms import _LOOP
 from .pdl_utils import value_of_expr
 
 
@@ -113,15 +112,14 @@ async def async_generate_text(
 
     @staticmethod
     def generate_text(
-        block: GraniteioModelBlock,
-        messages: ModelInput,
+        block: GraniteioModelBlock, messages: ModelInput, event_loop: AbstractEventLoop
     ) -> tuple[LazyMessage, PdlLazy[Any]]:
         future = run_coroutine_threadsafe(
             GraniteioModel.async_generate_text(
                 block,
                 messages,
             ),
-            _LOOP,
+            event_loop,
         )
         pdl_future: PdlLazy[tuple[dict[str, Any], Any]] = PdlConst(future)
         message = lazy_apply((lambda x: x[0]), pdl_future)
diff --git a/src/pdl/pdl_interpreter.py b/src/pdl/pdl_interpreter.py
index 9b1fee1b3..3f64a2b14 100644
--- a/src/pdl/pdl_interpreter.py
+++ b/src/pdl/pdl_interpreter.py
@@ -10,13 +10,27 @@
 
 # TODO: temporarily disabling warnings to mute a pydantic warning from liteLLM
 import warnings
-from functools import partial
+from abc import ABC, abstractmethod
+from asyncio import AbstractEventLoop
+from concurrent.futures import ThreadPoolExecutor
+from functools import partial, reduce
+from itertools import count
 from os import getenv
 
 warnings.filterwarnings("ignore", "Valid config keys have changed in V2")
 
 from pathlib import Path  # noqa: E402
-from typing import Any, Generator, Optional, Sequence, TypeVar  # noqa: E402
+from typing import (  # noqa: E402
+    IO,
+    Any,
+    Generator,
+    Generic,
+    Iterable,
+    Optional,
+    Sequence,
+    Tuple,
+    TypeVar,
+)
 
 import httpx  # noqa: E402
 import json_repair  # noqa: E402
@@ -31,10 +45,12 @@
 )
 from jinja2.nodes import TemplateData  # noqa: E402
 from jinja2.runtime import Undefined  # noqa: E402
-from pydantic import BaseModel  # noqa: E402
+from pydantic import BaseModel, ConfigDict, Field  # noqa: E402
+from pydantic.json_schema import SkipJsonSchema  # noqa: E402
 
 from .pdl_ast import (  # noqa: E402
     AdvancedBlockType,
+    AggregatorBlock,
     AnyPattern,
     ArgsBlock,
     ArrayBlock,
@@ -44,12 +60,14 @@
     BlockType,
     CallBlock,
     CodeBlock,
+    ContributeElement,
     ContributeTarget,
     ContributeValue,
     DataBlock,
     EmptyBlock,
     ErrorBlock,
     ExpressionType,
+    FileAggregatorConfig,
     FunctionBlock,
     GetBlock,
     GraniteioModelBlock,
@@ -58,13 +76,20 @@
     ImportBlock,
     IncludeBlock,
     IndependentEnum,
-    IterationType,
+    JoinArray,
+    JoinLastOf,
+    JoinObject,
+    JoinReduce,
+    JoinText,
+    JoinType,
     LastOfBlock,
     LazyMessage,
     LazyMessages,
+    LeafBlock,
     LitellmModelBlock,
     LitellmParameters,
     LocalizedExpression,
+    MapBlock,
     MatchBlock,
     MessageBlock,
     ModelBlock,
@@ -110,13 +135,17 @@
 from .pdl_location_utils import append, get_loc_string  # noqa: E402
 from .pdl_parser import PDLParseError, parse_file, parse_str  # noqa: E402
 from .pdl_python_repl import PythonREPL  # noqa: E402
-from .pdl_scheduler import yield_background, yield_result  # noqa: E402
+from .pdl_scheduler import (  # noqa: E402
+    create_event_loop_thread,
+    yield_background,
+    yield_result,
+)
 from .pdl_schema_utils import get_json_schema  # noqa: E402
 from .pdl_schema_validator import type_check_args, type_check_spec  # noqa: E402
 from .pdl_utils import (  # noqa: E402
     GeneratorWrapper,
     apply_defaults,
-    get_contribute_value,
+    get_contribute_context_value,
     replace_contribute_value,
     stringify,
     value_of_expr,
@@ -126,16 +155,39 @@
 empty_scope: ScopeType = PdlDict({"pdl_context": DependentContext([])})
 
 
+RefT = TypeVar("RefT")
+
+
+class Ref(Generic[RefT]):
+    def __init__(self, ref: RefT):
+        self.ref = ref
+
+
 class InterpreterState(BaseModel):
+    model_config = ConfigDict(arbitrary_types_allowed=True)
+
     yield_result: bool = False
+    """Stream the result on the standard output as soon as possible."""
     yield_background: bool = False
+    """Stream the toplevel pdl_context on the standard output as soon as possible."""
     batch: int = 1
-    # batch=0: streaming
-    # batch=1: call to generate with `input`
+    """
+    Stream the output of the LLM
+    - batch=0: streaming
+    - batch=1: call to generate with `input`
+    """
     role: RoleType = "user"
+    """Current role to add messages in the context."""
     cwd: Path = Path.cwd()
-    # background_tasks = {}
+    """Current working directory."""
     id_stack: list[str] = []
+    """Id generator for the UI."""
+
+    # The following are shared variable that should be modified by side effects
+    event_loop: AbstractEventLoop = Field(default_factory=create_event_loop_thread)
+    """Event loop to schedule LLM calls."""
+    current_pdl_context: Ref[LazyMessages] = Ref(DependentContext([]))
+    """Current value of the context set at the beginning of the execution of the block."""
 
     def with_yield_result(self: "InterpreterState", b: bool) -> "InterpreterState":
         return self.model_copy(update={"yield_result": b})
@@ -147,17 +199,40 @@ def with_role(self: "InterpreterState", role: RoleType) -> "InterpreterState":
         return self.model_copy(update={"role": role})
 
     def with_id(self: "InterpreterState", n: str) -> "InterpreterState":
-        stack = self.id_stack.copy() if self.id_stack is not None else []
-        stack.append(n)
-        return self.model_copy(update={"id_stack": stack})
+        stack = self.id_stack if self.id_stack is not None else []
+        return self.model_copy(update={"id_stack": stack + [n]})
 
     def with_iter(self: "InterpreterState", i: int) -> "InterpreterState":
         return self.with_id(str(i))
 
-    def with_pop(self: "InterpreterState") -> "InterpreterState":
-        stack = self.id_stack.copy() if self.id_stack is not None else []
-        stack.pop()
-        return self.model_copy(update={"id_stack": stack})
+
+class ClosureBlock(FunctionBlock):
+    pdl__scope: SkipJsonSchema[Optional[ScopeType]] = Field(repr=False)
+    pdl__state: SkipJsonSchema[InterpreterState] = Field(repr=False)
+
+    def __call__(self, *args, **kwargs):
+        state = self.pdl__state.with_yield_result(False).with_yield_background(False)
+        current_context = state.current_pdl_context.ref
+        if len(args) > 0:
+            keys = self.function.keys() if self.function is not None else {}
+            if len(keys) < len(args):
+                if self.signature is not None and self.signature.get("name", "") != "":
+                    err = f"Too many arguments to the call of {self.signature['name']}"
+                else:
+                    err = "Too many arguments to the call"
+                raise PDLRuntimeExpressionError(
+                    err,
+                    loc=self.pdl__location,
+                    trace=self.model_copy(),
+                )
+            kwargs = dict(zip(keys, args)) | kwargs
+        result, _, _ = execute_call(
+            state, current_context, self, kwargs, self.pdl__location
+        )
+        return result.result()
+
+
+ClosureBlock.model_rebuild()
 
 
 def generate(
@@ -225,8 +300,21 @@ def process_prog(
         PDLRuntimeError: If the program raises an error.
     """
     scope = empty_scope | scope
+
+    # Process stdlib
+    stdlib_file = Path(__file__).parent / "pdl_stdlib.pdl"
+    stdlib, _ = parse_file(stdlib_file)
+    _, _, stdlib_dict, _ = process_block(
+        state.with_yield_background(False).with_yield_result(False),
+        empty_scope,
+        stdlib.root,
+        loc,
+    )
+
+    stdlib_scope = scope | PdlDict({"stdlib": stdlib_dict})
+
     result, document, final_scope, trace = process_block(
-        state, scope, block=prog.root, loc=loc
+        state, stdlib_scope, block=prog.root, loc=loc
     )
     return result, document, final_scope, trace
 
@@ -238,6 +326,7 @@ def process_block(
     background: LazyMessages
     trace: BlockType
     try:
+        state.current_pdl_context.ref = scope["pdl_context"]  # type: ignore
         if not isinstance(block, Block):
             start = time.time_ns()
             try:
@@ -255,7 +344,7 @@ def process_block(
                         "role": state.role,
                         "content": result,
                         "pdl__defsite": ".".join(
-                            state.id_stack
+                            state.id_stack  # XXXX check
                         ),  # Warning: pdl__defsite for a literal value
                     }
                 )
@@ -264,7 +353,7 @@ def process_block(
                 data=expr,
                 pdl__result=result,
                 pdl__timing=PdlTiming(start_nanos=start, end_nanos=time.time_ns()),
-                pdl__id=".".join(state.id_stack),
+                pdl__id=".".join(state.id_stack),  # XXX move earlier
             )
             if state.yield_background:
                 yield_background(background)
@@ -293,14 +382,6 @@ def process_block(
     return result, background, scope, trace
 
 
-def context_in_contribute(block: AdvancedBlockType) -> bool:
-    if ContributeTarget.CONTEXT.value in block.contribute:
-        return True
-    if get_contribute_value(block.contribute) is not None:
-        return True
-    return False
-
-
 # A start-end time wrapper around `process_advanced_block`
 def process_advanced_block_timed(
     state: InterpreterState,
@@ -369,7 +450,7 @@ def set_error_to_scope_for_retry(
     return scope
 
 
-def process_advanced_block(
+def process_advanced_block(  # noqa: C901
     state: InterpreterState,
     scope: ScopeType,
     block: AdvancedBlockType,
@@ -380,55 +461,107 @@ def process_advanced_block(
     if len(block.defs) > 0:
         scope, defs_trace = process_defs(state, scope, block.defs, loc)
         block = block.model_copy(update={"defs": defs_trace})
+
+    result, background, new_scope, trace = process_advance_block_retry(
+        state, scope, block, loc
+    )
+    if block.def_ is not None:
+        var = block.def_
+        new_scope = new_scope | PdlDict({var: result})
+    new_scope, trace = process_contribute(trace, result, new_scope, loc)
+    if ContributeTarget.CONTEXT.value not in block.contribute:
+        background = DependentContext([])
+    else:
+        contribute_value, trace = process_contribute_context(trace, new_scope, loc)
+        if contribute_value is not None:
+            background = DependentContext([contribute_value])
+    if ContributeTarget.RESULT.value not in block.contribute:
+        result = PdlConst("")
+    return result, background, new_scope, trace
+
+
+def process_advance_block_retry(  # noqa: C901
+    state: InterpreterState,
+    scope: ScopeType,
+    block: AdvancedBlockType,
+    loc: PdlLocationType,
+) -> tuple[PdlLazy[Any], LazyMessages, ScopeType, AdvancedBlockType]:
+    result: PdlLazy[Any] = PdlConst(None)
+    background: LazyMessages = DependentContext([])
+    new_scope: ScopeType = PdlDict({})
+    trace: AdvancedBlockType = EmptyBlock()
+
     init_state = state
     state = state.with_yield_result(
         state.yield_result
-        and ContributeTarget.RESULT in block.contribute
+        and ContributeTarget.RESULT.value in block.contribute
         and block.parser is None
     )
     state = state.with_yield_background(
         state.yield_background and context_in_contribute(block)
     )
 
-    # Bind result variables here with empty values
-    result: PdlLazy[Any] = PdlConst(None)
-    background: LazyMessages = DependentContext([])
-    new_scope: ScopeType = PdlDict({})
-    trace: AdvancedBlockType = EmptyBlock()
-
     max_retry = block.retry if block.retry else 0
     trial_total = max_retry + 1
-    for trial_idx in range(trial_total):
+    for trial_idx in range(trial_total):  # pylint: disable=too-many-nested-blocks
         try:
             result, background, new_scope, trace = process_block_body(
                 state, scope, block, loc
             )
+
             result = lazy_apply(id_with_set_first_use_nanos(block.pdl__timing), result)
             add_done_callback(
                 id_with_set_first_use_nanos(block.pdl__timing), background
             )
             trace = trace.model_copy(update={"pdl__result": result})
             if block.parser is not None:
-                # Use partial to create a function with fixed arguments
                 parser_func = partial(parse_result, block.parser)
                 result = lazy_apply(parser_func, result)
-                if init_state.yield_result and ContributeTarget.RESULT:
+                if init_state.yield_result:
                     yield_result(result, block.kind)
             if block.spec is not None and not isinstance(block, FunctionBlock):
-                # Use partial to create a function with fixed arguments
                 checker = partial(
                     result_with_type_checking,
                     spec=block.spec,
                     msg="Type errors during spec checking:",
-                    loc=loc,
+                    loc=append(loc, "spec"),
                     trace=trace,
                 )
                 result = lazy_apply(checker, result)
             if block.fallback is not None:
                 result.result()
+            if block.requirements != []:
+                requirements_satisfied = True
+                for req in block.requirements:
+                    evaluate = getattr(req, "evaluate", None)
+                    stdlib_dict: Any = scope["stdlib"]
+                    if evaluate is None:
+                        evaluate = stdlib_dict["requirements"]["evaluation"]
+                    evalfn: Any
+                    evalfn, _ = process_expr(scope, evaluate, loc)
+                    requirement, _ = process_expr(scope, getattr(req, "expect"), loc)
+                    evaluation = evalfn(requirement=requirement, response=result)
+                    if evaluation < -0.3:
+                        requirements_satisfied = False
+                        transform_context = getattr(req, "transformContext", None)
+                        if transform_context is None:
+                            transform_context = stdlib_dict["requirements"][
+                                "transformContext"
+                            ]
+                        transfn: Any
+                        transfn, _ = process_expr(scope, transform_context, loc)
+                        new_context = transfn(
+                            pdl_context=scope["pdl_context"],
+                            requirement=requirement,
+                            response=result,
+                        )
+                        if trial_idx < max_retry:
+                            scope = scope | {"pdl_context": new_context}
+                if requirements_satisfied is False:
+                    continue
             break
         except Exception as exc:
-            err_msg = exc.args[0]
+            err_msg = traceback.format_exc()
             do_retry = (
                 block.retry
                 and trial_idx + 1 < trial_total
@@ -445,6 +578,12 @@ def process_advanced_block(
                 if block.trace_error_on_retry:
                     scope = set_error_to_scope_for_retry(scope, error, block.pdl__id)
                 continue
+            state = init_state.with_yield_result(
+                init_state.yield_result and ContributeTarget.RESULT in block.contribute
+            )
+            state = state.with_yield_background(
+                state.yield_background and context_in_contribute(block)
+            )
             (
                 result,
                 background,
@@ -458,30 +597,27 @@ def process_advanced_block(
                 loc=loc,
             )
             if block.spec is not None and not isinstance(block, FunctionBlock):
-                loc = append(loc, "fallback")
+                fallback_loc = append(loc, "fallback")
                 # Use partial to create a function with fixed arguments
                 checker = partial(
                     result_with_type_checking,
                     spec=block.spec,
                     msg="Type errors during spec checking:",
-                    loc=loc,
+                    loc=append(fallback_loc, "spec"),
                     trace=trace,
                 )
                 result = lazy_apply(checker, result)
-    if block.def_ is not None:
-        var = block.def_
-        new_scope = new_scope | PdlDict({var: result})
-    if ContributeTarget.RESULT not in block.contribute:
-        result = PdlConst("")
-    if ContributeTarget.CONTEXT not in block.contribute:
-        background = DependentContext([])
-    contribute_value, trace = process_contribute(trace, new_scope, loc)
-    if contribute_value is not None:
-        background = DependentContext([contribute_value])
-
     return result, background, new_scope, trace
 
 
+def context_in_contribute(block: AdvancedBlockType) -> bool:
+    if ContributeTarget.CONTEXT.value in block.contribute:
+        return True
+    if get_contribute_context_value(block.contribute) is not None:
+        return True
+    return False
+
+
 ResultWithTypeCheckingT = TypeVar("ResultWithTypeCheckingT")
 
 
@@ -561,11 +697,11 @@ def process_block_body(
                 yield_result(result.result(), block.kind)
             if state.yield_background:
                 yield_background(background)
-        case TextBlock():  # HERE
+        case TextBlock():
             result, background, scope, trace = process_blocks_of(
                 block,
                 "text",
-                IterationType.TEXT,
+                JoinText(),
                 state,
                 scope,
                 loc,
@@ -574,7 +710,7 @@ def process_block_body(
             result, background, scope, trace = process_blocks_of(
                 block,
                 "lastOf",
-                IterationType.LASTOF,
+                JoinLastOf(as_="lastOf"),  # pyright: ignore
                 state,
                 scope,
                 loc,
@@ -583,7 +719,7 @@ def process_block_body(
             result, background, scope, trace = process_blocks_of(
                 block,
                 "array",
-                IterationType.ARRAY,
+                JoinArray(as_="array"),  # pyright: ignore
                 state,
                 scope,
                 loc,
@@ -602,9 +738,9 @@ def process_block_body(
                         if isinstance(value_blocks, StructuredBlock):
                             context = value_blocks.context
                         value, value_background, scope, value_trace = process_blocks(
-                            IterationType.LASTOF,
+                            JoinLastOf(as_="lastOf"),  # pyright: ignore
                             context,
-                            iteration_state,
+                            iteration_state.with_id(k),
                             scope,
                             value_blocks,
                             block.kind,
@@ -639,7 +775,7 @@ def process_block_body(
                 result, background, scope, trace = process_blocks_of(
                     block,
                     "object",
-                    IterationType.OBJECT,
+                    JoinObject(as_="object"),  # pyright: ignore
                     iteration_state,
                     scope,
                     loc,
@@ -670,17 +806,13 @@ def process_block_body(
         case IfBlock():
             b, if_trace = process_condition_of(block, "condition", scope, loc, "if")
             if b:
-                state = state.with_iter(0)
                 result, background, scope, trace = process_block_of(
                     block, "then", state, scope, loc
                 )
-                state = state.with_pop()
             elif block.else_ is not None:
-                state = state.with_iter(0)
                 result, background, scope, trace = process_block_of(
                     block, "else_", state, scope, loc, "else"
                 )
-                state = state.with_pop()
             else:
                 result = PdlConst("")
                 background = DependentContext([])
@@ -765,46 +897,13 @@ def process_block_body(
             background = DependentContext([])
             iter_trace: list[BlockType] = []
             pdl_context_init = scope_init.data["pdl_context"]
-            if block.for_ is None:
-                items = None
-                lengths = None
-            else:
-                items, block = process_expr_of(block, "for_", scope, loc, "for")
-                lengths = []
-                for idx, lst in items.items():
-                    if not isinstance(lst, list):
-                        msg = f"Values inside the For block must be lists but got {type(lst)}."
-                        lst_loc = append(
-                            append(block.pdl__location or empty_block_location, "for"),
-                            idx,
-                        )
-                        raise PDLRuntimeError(
-                            message=msg,
-                            loc=lst_loc,
-                            trace=ErrorBlock(
-                                msg=msg, pdl__location=lst_loc, program=block
-                            ),
-                            fallback=[],
-                        )
-                    lengths.append(len(lst))
-                if len(set(lengths)) != 1:  # Not all the lists are of the same length
-                    msg = "Lists inside the For block must be of the same length."
-                    for_loc = append(block.pdl__location or empty_block_location, "for")
-                    raise PDLRuntimeError(
-                        msg,
-                        loc=for_loc,
-                        trace=ErrorBlock(msg=msg, pdl__location=for_loc, program=block),
-                        fallback=[],
-                    )
-            iteration_state = state.with_yield_result(
-                state.yield_result and block.join.as_ == IterationType.TEXT
+            iteration_state_init = state.with_yield_result(
+                state.yield_result and isinstance(block.join, JoinText)
             )
-            if block.maxIterations is None:
-                max_iterations = None
-            else:
-                max_iterations, block = process_expr_of(
-                    block, "maxIterations", scope, loc
-                )
+            iteration_state = iteration_state_init
+            block, items, length = _evaluate_for_field(scope, block, loc)
+            block, max_iterations = _evaluate_max_iterations_field(scope, block, loc)
+            block = _evaluate_join_field(scope, block, loc)
             repeat_loc = append(loc, "repeat")
             iidx = 0
             try:
@@ -815,17 +914,16 @@ def process_block_body(
                         scope = scope | {block.index: iidx}
                     if max_iterations is not None and iidx >= max_iterations:
                         break
-                    if lengths is not None and iidx >= lengths[0]:
+                    if length is not None and iidx >= length:
                         break
                     stay, _ = process_condition_of(block, "while_", scope, loc, "while")
                     if not stay:
                         break
-                    iteration_state = iteration_state.with_iter(iidx)
+                    iteration_state = iteration_state_init.with_iter(iidx)
                     if first:
                         first = False
-                    elif block.join.as_ == IterationType.TEXT:
+                    elif isinstance(block.join, JoinText):
                         join_string = block.join.with_
-                        results.append(PdlConst(join_string))
                         if iteration_state.yield_result:
                             yield_result(join_string, block.kind)
                         if iteration_state.yield_background:
@@ -859,16 +957,13 @@ def process_block_body(
                         saved_background = DependentContext(
                             [saved_background, iteration_background]
                         )
+                        background = saved_background
                     else:
                         saved_background = IndependentContext(
                             [saved_background, iteration_background]
                         )
-
-                    if block.context is IndependentEnum.DEPENDENT:
-                        background = saved_background
                     results.append(iteration_result)
                     iter_trace.append(body_trace)
-                    iteration_state = iteration_state.with_pop()
                     stop, _ = process_condition_of(block, "until", scope, loc)
                     iidx = iidx + 1
                     if stop:
@@ -881,12 +976,71 @@ def process_block_body(
                     loc=exc.loc or repeat_loc,
                     trace=trace,
                 ) from exc
-            result = combine_results(block.join.as_, results)
+            result = combine_results(block.join, results)
             if block.context is IndependentEnum.INDEPENDENT:
                 background = saved_background
             if state.yield_result and not iteration_state.yield_result:
                 yield_result(result.result(), block.kind)
             trace = block.model_copy(update={"pdl__trace": iter_trace})
+        case MapBlock():
+            background = DependentContext([])
+            iteration_state = state.with_yield_result(False)
+            block, items, length = _evaluate_for_field(scope, block, loc)
+            block, max_iterations = _evaluate_max_iterations_field(scope, block, loc)
+            block = _evaluate_join_field(scope, block, loc)
+            map_loc = append(loc, "map")
+            try:
+                if max_iterations is not None:
+                    index_iterator: Any = range(max_iterations)
+                else:
+                    index_iterator = count()
+                if items is not None and length is not None:
+                    items_iterator = (
+                        {k: elems[i] for k, elems in items.items()}
+                        for i in range(length)
+                    )
+                else:
+                    items_iterator = ({} for _ in count())
+
+                def loop_body(iidx, items):
+                    iteration_scope = scope_init
+                    if block.index is not None:
+                        iteration_scope = iteration_scope | {block.index: iidx}
+                    iteration_scope = iteration_scope | items
+                    return process_block(
+                        iteration_state.with_iter(iidx),
+                        iteration_scope,
+                        block.map,
+                        map_loc,
+                    )
+
+                map_output: Iterable[
+                    Tuple[PdlLazy[Any], LazyMessages, ScopeType, BlockType]
+                ]
+                if block.maxWorkers == 0:
+                    map_output = map(  # pylint: disable=bad-builtin
+                        loop_body, index_iterator, items_iterator
+                    )
+                else:
+                    with ThreadPoolExecutor(block.maxWorkers) as executor:
+                        map_output = executor.map(
+                            loop_body, index_iterator, items_iterator
+                        )
+                results, _, _, traces = _split_map_output(map_output)
+                # saved_background = IndependentContext(backgrounds)
+            except PDLRuntimeError as exc:
+                traces = [exc.pdl__trace]  # type: ignore
+                trace = block.model_copy(update={"pdl__trace": traces})
+                raise PDLRuntimeError(
+                    exc.message,
+                    loc=exc.loc or map_loc,
+                    trace=trace,
+                ) from exc
+            result = combine_results(block.join, results)
+            # background = saved_background  # commented because the block do not contribute to the background
+            if state.yield_result and not iteration_state.yield_result:
+                yield_result(result.result(), block.kind)
+            trace = block.model_copy(update={"pdl__trace": traces})
         case ReadBlock():
             result, background, scope, trace = process_input(state, scope, block, loc)
             if state.yield_result:
@@ -900,8 +1054,29 @@ def process_block_body(
         case ImportBlock():
             result, background, scope, trace = process_import(state, scope, block, loc)
 
+        case AggregatorBlock():
+            result, background, scope, trace = process_aggregator(
+                state, scope, block, loc
+            )
+
         case FunctionBlock():
-            closure = block.model_copy()
+            closure = ClosureBlock(  # pyright: ignore
+                description=block.description,
+                spec=block.spec,
+                defs=block.defs,
+                def_=block.def_,  # pyright: ignore
+                contribute=block.contribute,
+                parser=block.parser,
+                fallback=block.fallback,
+                retry=block.retry,
+                trace_error_on_retry=block.trace_error_on_retry,
+                role=block.role,
+                function=block.function,
+                return_=block.return_,  # pyright: ignore
+                pdl__location=loc,
+                pdl__scope=None,
+                pdl__state=state,
+            )
             if block.def_ is not None:
                 scope = scope | {block.def_: closure}
             closure.pdl__scope = scope
@@ -930,6 +1105,90 @@ def process_block_body(
     return result, background, scope, trace
 
 
+def _split_map_output(
+    map_output: Iterable[Tuple[PdlLazy[Any], LazyMessages, ScopeType, BlockType]],
+) -> Tuple[list[PdlLazy[Any]], list[LazyMessages], list[ScopeType], list[BlockType]]:
+    results = []
+    backgrounds = []
+    scopes = []
+    traces = []
+    for result, background, scope, trace in map_output:
+        results.append(result)
+        backgrounds.append(background)
+        scopes.append(scope)
+        traces.append(trace)
+    return results, backgrounds, scopes, traces
+
+
+BlockTVarEvalFor = TypeVar("BlockTVarEvalFor", bound=RepeatBlock | MapBlock)
+
+
+def _evaluate_for_field(
+    scope: ScopeType, block: BlockTVarEvalFor, loc: PdlLocationType
+) -> Tuple[BlockTVarEvalFor, Optional[dict[str, list]], Optional[int]]:
+    if block.for_ is None:
+        items = None
+        length = None
+    else:
+        items, block = process_expr_of(block, "for_", scope, loc, "for")
+        lengths = []
+        for idx, lst in items.items():
+            if not isinstance(lst, list):
+                msg = f"Values inside the For block must be lists but got {type(lst)}."
+                lst_loc = append(
+                    append(block.pdl__location or empty_block_location, "for"),
+                    idx,
+                )
+                raise PDLRuntimeError(
+                    message=msg,
+                    loc=lst_loc,
+                    trace=ErrorBlock(msg=msg, pdl__location=lst_loc, program=block),
+                    fallback=[],
+                )
+            lengths.append(len(lst))
+        if len(set(lengths)) != 1:  # Not all the lists are of the same length
+            msg = "Lists inside the For block must be of the same length."
+            for_loc = append(block.pdl__location or empty_block_location, "for")
+            raise PDLRuntimeError(
+                msg,
+                loc=for_loc,
+                trace=ErrorBlock(msg=msg, pdl__location=for_loc, program=block),
+                fallback=[],
+            )
+        length = lengths[0]
+    return block, items, length
+
+
+BlockTVarEvalMaxIter = TypeVar("BlockTVarEvalMaxIter", bound=RepeatBlock | MapBlock)
+
+
+def _evaluate_max_iterations_field(
+    scope: ScopeType, block: BlockTVarEvalMaxIter, loc: PdlLocationType
+) -> Tuple[BlockTVarEvalMaxIter, Optional[int]]:
+    if block.maxIterations is None:
+        max_iterations = None
+    else:
+        max_iterations, block = process_expr_of(block, "maxIterations", scope, loc)
+    return block, max_iterations
+
+
+BlockTVarEvalJoin = TypeVar("BlockTVarEvalJoin", bound=RepeatBlock | MapBlock)
+
+
+def _evaluate_join_field(
+    scope: ScopeType, block: BlockTVarEvalJoin, loc: PdlLocationType
+) -> BlockTVarEvalJoin:
+    match block.join:
+        case JoinText() | JoinArray() | JoinObject() | JoinLastOf():
+            pass
+        case JoinReduce():
+            loc = append(loc, "reduce")
+            _, expr = process_expr(scope, block.join.reduce, loc)
+            join = block.join.model_copy(update={"reduce": expr})
+            block = block.model_copy(update={"join": join})
+    return block
+
+
 def is_matching(  # pylint: disable=too-many-return-statements
     value: Any, pattern: PatternType, scope: ScopeType
 ) -> Optional[ScopeType]:
@@ -991,19 +1250,18 @@ def process_defs(
 ) -> tuple[ScopeType, dict[str, BlockType]]:
     defs_trace: dict[str, BlockType] = {}
     defloc = append(loc, "defs")
-    idx = 0
+    state = state.with_id("defs")
+    state = state.with_yield_result(False)
+    state = state.with_yield_background(False)
     for x, block in defs.items():
         newloc = append(defloc, x)
-        state = state.with_iter(idx)
-        state = state.with_yield_result(False)
-        state = state.with_yield_background(False)
         if isinstance(block, FunctionBlock) and block.def_ is None:
             block = block.model_copy(update={"def_": x})
-        result, _, _, block_trace = process_block(state, scope, block, newloc)
+        result, _, _, block_trace = process_block(
+            state.with_id(x), scope, block, newloc
+        )
         scope = scope | PdlDict({x: result})
         defs_trace[x] = block_trace
-        idx = idx + 1
-        state = state.with_pop()
     return scope, defs_trace
 
 
@@ -1022,7 +1280,7 @@ def process_block_of(  # pylint: disable=too-many-arguments, too-many-positional
 ) -> tuple[PdlLazy[Any], LazyMessages, ScopeType, BlockTypeTVarProcessBlockOf]:
     try:
         result, background, scope, child_trace = process_block(
-            state,
+            state.with_id(field),
             scope,
             getattr(block, field),
             append(loc, field_alias or field),
@@ -1046,7 +1304,7 @@ def process_block_of(  # pylint: disable=too-many-arguments, too-many-positional
 def process_blocks_of(  # pylint: disable=too-many-arguments, too-many-positional-arguments
     block: BlockTypeTVarProcessBlocksOf,
     field: str,
-    iteration_type: IterationType,
+    join_type: JoinType,
     state: InterpreterState,
     scope: ScopeType,
     loc: PdlLocationType,
@@ -1057,7 +1315,7 @@ def process_blocks_of(  # pylint: disable=too-many-arguments, too-many-positiona
         if isinstance(block, StructuredBlock):
             context = block.context
         result, background, scope, blocks = process_blocks(
-            iteration_type,
+            join_type,
             context,
             state,
             scope,
@@ -1077,7 +1335,7 @@ def process_blocks_of(  # pylint: disable=too-many-arguments, too-many-positiona
 
 
 def process_blocks(  # pylint: disable=too-many-arguments,too-many-positional-arguments
-    iteration_type: IterationType,
+    join_type: JoinType,
     context: IndependentEnum,
     state: InterpreterState,
     scope: ScopeType,
@@ -1091,10 +1349,10 @@ def process_blocks(  # pylint: disable=too-many-arguments,too-many-positional-ar
     results = []
     if not isinstance(blocks, str) and isinstance(blocks, Sequence):
         # Is a list of blocks
-        iteration_state = state.with_yield_result(
-            state.yield_result
-            and (iteration_type in (IterationType.LASTOF, IterationType.TEXT))
+        iteration_state_init = state.with_yield_result(
+            state.yield_result and isinstance(join_type, (JoinLastOf, JoinText))
         )
+        iteration_state = iteration_state_init
         new_loc = None
         background = DependentContext([])
         saved_background: LazyMessages = DependentContext([])
@@ -1102,12 +1360,12 @@ def process_blocks(  # pylint: disable=too-many-arguments,too-many-positional-ar
         pdl_context_init: LazyMessages = scope.data["pdl_context"]
         try:
             for i, block in enumerate(blocks):
-                iteration_state = iteration_state.with_iter(i)
+                iteration_state = iteration_state_init.with_iter(i)
                 scope = scope | {
                     "pdl_context": DependentContext([pdl_context_init, background])
                 }
                 new_loc = append(loc, "[" + str(i) + "]")
-                if iteration_type == IterationType.LASTOF and state.yield_result:
+                if isinstance(join_type, JoinLastOf) and state.yield_result:
                     iteration_state = state.with_yield_result(i + 1 == len(blocks))
                 (
                     iteration_result,
@@ -1128,7 +1386,6 @@ def process_blocks(  # pylint: disable=too-many-arguments,too-many-positional-ar
                 if context == IndependentEnum.DEPENDENT:
                     background = saved_background
                 trace.append(t)  # type: ignore
-                iteration_state = iteration_state.with_pop()
             if context == IndependentEnum.INDEPENDENT:
                 background = saved_background
         except PDLRuntimeError as exc:
@@ -1138,35 +1395,46 @@ def process_blocks(  # pylint: disable=too-many-arguments,too-many-positional-ar
             ) from exc
     else:
         iteration_state = state.with_yield_result(
-            state.yield_result and iteration_type != IterationType.ARRAY
+            state.yield_result and not isinstance(join_type, JoinArray)
         )
         block_result, background, scope, trace = process_block(
             iteration_state, scope, blocks, loc
         )
         results.append(block_result)
-    result = combine_results(iteration_type, results)
+    result = combine_results(join_type, results)
     if state.yield_result and not iteration_state.yield_result:
         yield_result(result, block_kind)
     return result, background, scope, trace
 
 
-def combine_results(iteration_type: IterationType, results: list[PdlLazy[Any]]):
+def combine_results(join_type: JoinType, results: list[PdlLazy[Any]]):
     result: Any
-    match iteration_type:
-        case IterationType.ARRAY:
+    match join_type:
+        case JoinArray():
             result = PdlList(results)
-        case IterationType.OBJECT:
+        case JoinObject():
             result = PdlDict({})
             for d in results:
                 result = result | d
-        case IterationType.LASTOF:
+        case JoinLastOf():
             if len(results) > 0:
                 result = results[-1]
             else:
                 result = None
-        case IterationType.TEXT:
+        case JoinText():
+            join_str = join_type.with_
             result = lazy_apply(
-                (lambda _: "".join([stringify(r.result()) for r in results])),
+                (lambda _: join_str.join([stringify(r.result()) for r in results])),
+                PdlConst(()),
+            )
+        case JoinReduce():
+            result = lazy_apply(
+                (
+                    lambda _: reduce(
+                        value_of_expr(join_type.reduce),
+                        [r.result() for r in results],
+                    )
+                ),
                 PdlConst(()),
             )
         case _:
@@ -1174,19 +1442,17 @@ def combine_results(iteration_type: IterationType, results: list[PdlLazy[Any]]):
     return result
 
 
-BlockTypeTVarProcessContribute = TypeVar(
-    "BlockTypeTVarProcessContribute", bound=AdvancedBlockType
+BlockTypeTVarProcessContributeOld = TypeVar(
+    "BlockTypeTVarProcessContributeOld", bound=AdvancedBlockType
 )
 
 
-def process_contribute(
-    block: BlockTypeTVarProcessContribute, scope: ScopeType, loc: PdlLocationType
-) -> tuple[Any, BlockTypeTVarProcessContribute]:
-    result: list[ContributeTarget | dict[str, ContributeValue]]
-    value_trace: LocalizedExpression[
-        list[ContributeTarget | dict[str, ContributeValue]]
-    ]
-    value = get_contribute_value(block.contribute)
+def process_contribute_context(
+    block: BlockTypeTVarProcessContributeOld, scope: ScopeType, loc: PdlLocationType
+) -> tuple[Any, BlockTypeTVarProcessContributeOld]:
+    result: list[ContributeElement]
+    value_trace: LocalizedExpression[list[ContributeElement]]
+    value = get_contribute_context_value(block.contribute)
     if value is None:
         return None, block
     loc = append(loc, "contribute")
@@ -1205,6 +1471,74 @@ def process_contribute(
     return result, trace
 
 
+BlockTypeTVarProcessContribute = TypeVar(
+    "BlockTypeTVarProcessContribute", bound=AdvancedBlockType
+)
+
+
+def process_contribute(
+    block: BlockTypeTVarProcessContribute,
+    result: Any,
+    scope: ScopeType,
+    loc: PdlLocationType,
+) -> tuple[ScopeType, BlockTypeTVarProcessContribute]:
+    loc = append(loc, "contribute")
+    contribute = []
+    for i, elem in enumerate(block.contribute):
+        scope, elem = process_contribution(
+            block, elem, result, scope, append(loc, "[" + str(i) + "]")
+        )
+        contribute.append(elem)
+    trace = block.model_copy(update={"contribute": contribute})
+    return scope, trace
+
+
+def process_contribution(
+    block: AdvancedBlockType,
+    elem: ContributeElement,
+    result: Any,
+    scope: ScopeType,
+    loc: PdlLocationType,
+) -> tuple[ScopeType, ContributeElement]:
+    target: ContributeTarget | str
+    match elem:
+        case ContributeTarget.RESULT | "result" | ContributeTarget.CONTEXT | "context":
+            return scope, elem
+        case ContributeTarget() | str():
+            target = elem
+        case dict():
+            if len(elem) != 1:
+                msg = "Contributions are expected to be strings or dictionaries of length 1 but got {elem}"
+                raise PDLRuntimeError(
+                    msg,
+                    loc=loc,
+                    trace=ErrorBlock(msg=msg, pdl__location=loc, program=block),
+                    fallback=[],
+                )
+            target, contribute_value = list(elem.items()).pop()
+            try:
+                result, value_trace = process_expr(scope, contribute_value.value, loc)
+            except PDLRuntimeExpressionError as exc:
+                raise PDLRuntimeError(
+                    exc.message,
+                    loc=exc.loc or loc,
+                    trace=ErrorBlock(msg=exc.message, pdl__location=loc, program=block),
+                ) from exc
+            elem = {target: ContributeValue(value=value_trace)}
+        case _:
+            msg = "Contributions are expected to be strings or dictionaries of length 1 but got {elem}"
+            raise PDLRuntimeError(
+                msg,
+                loc=loc,
+                trace=ErrorBlock(msg=msg, pdl__location=loc, program=block),
+                fallback=[],
+            )
+    aggregator = get_contribute_aggregator(block, target, scope, loc)
+    aggregator = aggregator.contribute(result, block.role, loc, block)
+    scope = scope | {target: aggregator}
+    return scope, elem
+
+
 BlockTypeTVarProcessExprOf = TypeVar(
     "BlockTypeTVarProcessExprOf", bound=AdvancedBlockType
 )
@@ -1638,6 +1972,7 @@ def generate_client_response_single(
                 model_id=value_of_expr(block.model),
                 messages=model_input,
                 parameters=litellm_parameters_to_dict(parameters),
+                event_loop=state.event_loop,
             )
         case GraniteioModelBlock():
             from .pdl_granite_io import GraniteioModel
@@ -1645,6 +1980,7 @@ def generate_client_response_single(
             message, response = GraniteioModel.generate_text(
                 block=block,
                 messages=model_input,
+                event_loop=state.event_loop,
             )
         case _:
             assert False
@@ -1856,7 +2192,7 @@ def process_call(
     background: LazyMessages = DependentContext([])
     args, block = process_expr_of(block, "args", scope, loc)
     closure, _ = process_expr_of(block, "call", scope, loc)
-    if not isinstance(closure, FunctionBlock):
+    if not isinstance(closure, ClosureBlock):
         msg = f"Type error: {block.call} is of type {type(closure)} but should be a function."
         if isinstance(closure, str) and isinstance(scope.get(closure), FunctionBlock):
             msg += " You might want to call `${ " + str(block.call) + " }`."
@@ -1874,12 +2210,28 @@ def process_call(
             loc=args_loc,
             trace=block.model_copy(),
         )
+    current_context = scope.data["pdl_context"]
+    try:
+        result, background, call_trace = execute_call(
+            state, current_context, closure, args, loc
+        )
+    except PDLRuntimeError as exc:
+        raise PDLRuntimeError(
+            exc.message,
+            loc=exc.loc or closure.pdl__location,
+            trace=block.model_copy(update={"pdl__trace": exc.pdl__trace}),
+        ) from exc
+    trace = block.model_copy(update={"pdl__trace": call_trace})
+    return result, background, scope, trace
+
+
+def execute_call(state, current_context, closure, args, loc):
     if "pdl_context" in args:
-        args["pdl_context"] = deserialize(args["pdl_context"])
+        args = args | {"pdl_context": deserialize(args["pdl_context"])}
     f_body = closure.return_
     f_scope = (
         (closure.pdl__scope or PdlDict({}))
-        | PdlDict({"pdl_context": scope.data["pdl_context"]})
+        | PdlDict({"pdl_context": current_context})
         | PdlDict((args or {}))
     )
     if closure.pdl__location is not None:
@@ -1890,27 +2242,19 @@ def process_call(
         )
     else:
         fun_loc = empty_block_location
-    try:
-        result, background, _, f_trace = process_block(state, f_scope, f_body, fun_loc)
-    except PDLRuntimeError as exc:
-        raise PDLRuntimeError(
-            exc.message,
-            loc=exc.loc or fun_loc,
-            trace=block.model_copy(update={"pdl__trace": exc.pdl__trace}),
-        ) from exc
-    trace = block.model_copy(update={"pdl__trace": f_trace})
+    result, background, _, f_trace = process_block(state, f_scope, f_body, fun_loc)
     if closure.spec is not None:
         result = lazy_apply(
             lambda r: result_with_type_checking(
                 r,
                 closure.spec,
-                f"Type errors in result of function call to {block.call}:",
-                loc,
-                trace,
+                f"Type errors in result of the function{' ' + closure.signature.get('name', '') if closure.signature is not None else ''}:",
+                fun_loc,
+                f_trace,
             ),
             result,
         )
-    return result, background, scope, trace
+    return result, background, f_trace
 
 
 def process_input(
@@ -2028,6 +2372,163 @@ def process_import(
         ) from exc
 
 
+class Aggregator(ABC):
+    @abstractmethod
+    def contribute(
+        self,
+        result: PdlLazy[Any],
+        role: Optional[RoleType] = None,
+        loc: Optional[PdlLocationType] = None,
+        block: Optional[BlockType] = None,
+    ) -> "Aggregator":
+        """Function executed at the end of each block that contain the aggregator.
+
+        Args:
+            result: value computed by the block
+            role: role associated to the block. Defaults to None.
+            loc: source code location of the block. Defaults to None.
+            block: block contributing the value. Defaults to None.
+
+        Returns:
+            Aggregator: new aggregator with the contributed value.
+        """
+
+
+class ContextAggregator(Aggregator):
+    def __init__(self, messages: Optional[LazyMessages] = None):
+        if messages is None:
+            self.messages: LazyMessages = DependentContext([])
+        else:
+            self.messages = messages
+
+    def contribute(
+        self,
+        result: PdlLazy[Any],
+        role: Optional[RoleType] = None,
+        loc: Optional[PdlLocationType] = None,
+        block: Optional[BlockType] = None,
+    ) -> "ContextAggregator":
+        match block:
+            case None | StructuredBlock():
+                return self
+            case LeafBlock():
+                block_id = ".".join(block.pdl__id or [])
+                msg = {"role": role, "content": result, "pdl__defsite": block_id}
+            case _:
+                msg = {"role": role, "content": result}
+        new_messages: LazyMessages = SingletonContext(PdlDict(msg))
+        messages = DependentContext([self.messages, new_messages])
+        return ContextAggregator(messages)
+
+
+class FileAggregator(Aggregator):
+    def __init__(
+        self, fp: IO, prefix: str = "", suffix: str = "\n", flush: bool = False
+    ):
+        self.fp = fp
+        self.prefix = prefix
+        self.suffix = suffix
+        self.flush = flush
+
+    def contribute(
+        self,
+        result: PdlLazy[Any],
+        role: Optional[RoleType] = None,
+        loc: Optional[PdlLocationType] = None,
+        block: Optional[BlockType] = None,
+    ) -> "FileAggregator":
+        print(f"{self.prefix}{result}", file=self.fp, end=self.suffix, flush=self.flush)
+        return self
+
+
+def process_aggregator(
+    state: InterpreterState,
+    scope: ScopeType,
+    block: AggregatorBlock,
+    loc: PdlLocationType,
+) -> tuple[PdlLazy[Aggregator], LazyMessages, ScopeType, AggregatorBlock]:
+    aggregator: Aggregator
+    match block.aggregator:
+        case "context":
+            aggregator = ContextAggregator()
+        case FileAggregatorConfig():
+            try:
+                cfg = block.aggregator
+                file: str
+                file_trace: ExpressionType[str]
+                file, file_trace = process_expr(scope, cfg.file, loc)
+                mode: str
+                mode_trace: ExpressionType[str]
+                mode, mode_trace = process_expr(scope, cfg.mode, loc)
+                encoding: Optional[str]
+                encoding_trace: ExpressionType[Optional[str]]
+                encoding, encoding_trace = process_expr(scope, cfg.encoding, loc)
+                prefix: str
+                prefix_trace: ExpressionType[str]
+                prefix, prefix_trace = process_expr(scope, cfg.prefix, loc)
+                suffix: str
+                suffix_trace: ExpressionType[str]
+                suffix, suffix_trace = process_expr(scope, cfg.suffix, loc)
+                flush: bool
+                flush_trace: ExpressionType[bool]
+                flush, flush_trace = process_expr(scope, cfg.flush, loc)
+                cfg = block.aggregator.model_copy(
+                    update={
+                        "file": file_trace,
+                        "mode": mode_trace,
+                        "encoding": encoding_trace,
+                        "prefix": prefix_trace,
+                        "suffix": suffix_trace,
+                        "flush": flush_trace,
+                    }
+                )
+                trace = block.model_copy(update={"aggregator": cfg})
+            except PDLRuntimeExpressionError as exc:
+                raise PDLRuntimeError(
+                    exc.message,
+                    loc=exc.loc or loc,
+                    trace=ErrorBlock(msg=exc.message, pdl__location=loc, program=block),
+                ) from exc
+            fp = open(  # pylint: disable=consider-using-with
+                file, mode=mode, encoding=encoding
+            )
+            aggregator = FileAggregator(fp, prefix=prefix, suffix=suffix, flush=flush)
+        case _:
+            assert False, "Unexpected aggregator"
+    background: LazyMessages = DependentContext([])
+    trace = block.model_copy()
+    return PdlConst(aggregator), background, scope, trace
+
+
+def get_contribute_aggregator(
+    block: AdvancedBlockType,
+    target: ContributeTarget | str,
+    scope: ScopeType,
+    loc: PdlLocationType,
+) -> Aggregator:
+    match target:
+        case ContributeTarget.STDOUT | "stdout":
+            aggregator = FileAggregator(sys.stdout, flush=True)
+        case ContributeTarget.STDERR | "stderr":
+            aggregator = FileAggregator(sys.stderr, flush=True)
+        case str():
+            aggregator = get_var(target, scope, loc)
+            if isinstance(aggregator, PdlLazy):
+                aggregator = aggregator.result()
+            if not isinstance(aggregator, Aggregator):
+                msg = f"An aggregator was expected but got a value of type {type(aggregator)}."
+                raise PDLRuntimeError(
+                    msg,
+                    loc=loc,
+                    trace=ErrorBlock(msg=msg, pdl__location=loc, program=block),
+                    fallback=[],
+                )
+
+        case _:
+            assert False, f"Unexpected target type: {type(target)}"
+    return aggregator
+
+
 JSONReturnType = dict[str, Any] | list[Any] | str | float | int | bool | None
 
 
@@ -2036,6 +2537,10 @@ def parse_result(parser: ParserType, text: str) -> JSONReturnType:
     match parser:
         case "json":
             try:
+                if text == "False":
+                    return json.loads("false")
+                if text == "True":
+                    return json.loads("true")
                 result = json_repair.loads(text)  # type: ignore[reportAssignmentType]
             except Exception as exc:
                 raise PDLRuntimeParserError(
diff --git a/src/pdl/pdl_lazy.py b/src/pdl/pdl_lazy.py
index cf901aac1..fe14eda7a 100644
--- a/src/pdl/pdl_lazy.py
+++ b/src/pdl/pdl_lazy.py
@@ -156,12 +156,6 @@ def __init__(
 
     @property
     def data(self):
-        return self.result()
-
-    def __repr__(self):
-        return self.result().__repr__()
-
-    def result(self) -> ApplyOutputT:
         if self._done:
             return self._data
         v = self.x.result()
@@ -169,6 +163,17 @@ def result(self) -> ApplyOutputT:
         self._done = True
         return self._data
 
+    def __repr__(self):
+        return self.result().__repr__()
+
+    def result(self) -> ApplyOutputT:
+        data = self.data
+        if isinstance(data, PdlLazy):
+            result = data.result()
+        else:
+            result = data
+        return result  # pyright: ignore
+
 
 LazyApplyInputT = TypeVar("LazyApplyInputT")
 LazyApplyOutputT = TypeVar("LazyApplyOutputT")
@@ -192,20 +197,14 @@ def __init__(
         x1: PdlLazy[Apply2Input1T],
         x2: PdlLazy[Apply2Input2T],
     ):
-        self._data: Apply2OutputT
+        self._data: Apply2OutputT | PdlLazy[Apply2OutputT]
         self.f = f
         self.x1 = x1
         self.x2 = x2
         self._done = False
 
     @property
-    def data(self):
-        return self.result()
-
-    def __repr__(self):
-        return self.result().__repr__()
-
-    def result(self) -> Apply2OutputT:
+    def data(self) -> Apply2OutputT | PdlLazy[Apply2OutputT]:
         if self._done:
             return self._data
         if isinstance(self.x1, PdlLazy):
@@ -220,6 +219,17 @@ def result(self) -> Apply2OutputT:
         self._done = True
         return self._data
 
+    def __repr__(self):
+        return self.result().__repr__()
+
+    def result(self) -> Apply2OutputT:
+        data = self.data
+        if isinstance(data, PdlLazy):
+            result = data.result()
+        else:
+            result = data
+        return result  # pyright: ignore
+
 
 LazyApply2Input1T = TypeVar("LazyApply2Input1T")  # pylint: disable=invalid-name
 LazyApply2Input2T = TypeVar("LazyApply2Input2T")  # pylint: disable=invalid-name
diff --git a/src/pdl/pdl_llms.py b/src/pdl/pdl_llms.py
index f9d569654..54d4ca401 100644
--- a/src/pdl/pdl_llms.py
+++ b/src/pdl/pdl_llms.py
@@ -1,10 +1,8 @@
 # pylint: disable=import-outside-toplevel
-import asyncio
-import threading
-from concurrent.futures import Future
+from asyncio import AbstractEventLoop, run_coroutine_threadsafe
 from os import environ
 from sys import stderr
-from typing import Any, Callable, Generator, Optional, TypeVar
+from typing import Any, Generator, Optional, TypeVar
 
 import httpx
 from dotenv import load_dotenv
@@ -19,25 +17,12 @@
 )
 from .pdl_lazy import PdlConst, PdlLazy, lazy_apply
 from .pdl_schema_utils import pdltype_to_jsonschema
-from .pdl_utils import remove_none_values_from_message
+from .pdl_utils import message_post_processing
 
 # Load environment variables
 load_dotenv()
 
 
-def _start_background_loop(loop):
-    asyncio.set_event_loop(loop)
-    loop.run_forever()
-
-
-_LOOP = asyncio.new_event_loop()
-_LOOP_THREAD = threading.Thread(
-    target=_start_background_loop, args=(_LOOP,), daemon=True
-)
-_LOOP_THREAD.start()
-# _BACKGROUND_TASKS = set()
-
-
 class LitellmModel:
     @staticmethod
     async def async_generate_text(
@@ -62,7 +47,7 @@ async def async_generate_text(
             if msg.role is None:
                 msg.role = "assistant"
             return (
-                remove_none_values_from_message(msg.json()),
+                message_post_processing(msg.json()),
                 response.json(),  # pyright: ignore
             )
         except httpx.RequestError as exc:
@@ -88,21 +73,19 @@ def generate_text(
         model_id: str,
         messages: ModelInput,
         parameters: dict[str, Any],
+        event_loop: AbstractEventLoop,
     ) -> tuple[LazyMessage, PdlLazy[Any]]:
         if "PDL_VERBOSE_ASYNC" in environ:
             print(f"Asynchronous model call started to {model_id}", file=stderr)
-        # global _BACKGROUND_TASKS
-        future = asyncio.run_coroutine_threadsafe(
+        future = run_coroutine_threadsafe(
             LitellmModel.async_generate_text(
                 block,
                 model_id,
                 messages,
                 parameters,
             ),
-            _LOOP,
+            event_loop,
         )
-        # _BACKGROUND_TASKS.add(future)
-        # future.add_done_callback(_BACKGROUND_TASKS.discard)
         pdl_future: PdlLazy[tuple[dict[str, Any], Any]] = PdlConst(future)
         message = lazy_apply((lambda x: x[0]), pdl_future)
         response = lazy_apply((lambda x: x[1]), pdl_future)
@@ -178,7 +161,7 @@ def generate_text_stream(
             msg = chunk.choices[0].delta  # pyright: ignore
             if msg.role is None:
                 msg.role = "assistant"
-            yield remove_none_values_from_message(msg.model_dump())
+            yield message_post_processing(msg.model_dump())
         return result
 
 
@@ -213,13 +196,13 @@ def set_structured_decoding_parameters(
 MapOutputT = TypeVar("MapOutputT")
 
 
-def map_future(
-    f: Callable[[MapInputT], MapOutputT], x: Future[MapInputT]
-) -> Future[MapOutputT]:
-    future = asyncio.run_coroutine_threadsafe(_async_call(f, x), _LOOP)
-    return future
+# def map_future(
+#     f: Callable[[MapInputT], MapOutputT], x: Future[MapInputT]
+# ) -> Future[MapOutputT]:
+#     future = asyncio.run_coroutine_threadsafe(_async_call(f, x), _LOOP)
+#     return future
 
 
-async def _async_call(f, x):
-    v = x.result()
-    return f(v)
+# async def _async_call(f, x):
+#     v = x.result()
+#     return f(v)
diff --git a/src/pdl/pdl_parser.py b/src/pdl/pdl_parser.py
index 3752b36f3..201e5db79 100644
--- a/src/pdl/pdl_parser.py
+++ b/src/pdl/pdl_parser.py
@@ -139,6 +139,11 @@ def parse_dict(
 #             if block.pdl__trace is not None:
 #                 for trace in block.pdl__trace:
 #                     iter_blocks(f, trace)
+#         case MapBlock():
+#             iter_blocks(f, block.map)
+#             if block.pdl__trace is not None:
+#                 for trace in block.pdl__trace:
+#                     iter_blocks(f, trace)
 #         case ErrorBlock():
 #             iter_blocks(f, block.program)
 #         case ReadBlock():
diff --git a/src/pdl/pdl_scheduler.py b/src/pdl/pdl_scheduler.py
index 2ce0d0d56..998005291 100644
--- a/src/pdl/pdl_scheduler.py
+++ b/src/pdl/pdl_scheduler.py
@@ -1,3 +1,5 @@
+from asyncio import AbstractEventLoop, new_event_loop, set_event_loop
+from threading import Thread
 from typing import Any, Optional
 
 from termcolor import colored
@@ -6,6 +8,18 @@
 from .pdl_utils import stringify
 
 
+def _start_background_loop(loop):
+    set_event_loop(loop)
+    loop.run_forever()
+
+
+def create_event_loop_thread() -> AbstractEventLoop:
+    loop = new_event_loop()
+    loop_thread = Thread(target=_start_background_loop, args=(loop,), daemon=True)
+    loop_thread.start()
+    return loop
+
+
 def color_of(kind: BlockKind):
     color: Optional[str]
     match kind:
@@ -37,12 +51,16 @@ def color_of(kind: BlockKind):
             color = None
         case BlockKind.REPEAT:
             color = None
+        case BlockKind.MAP:
+            color = None
         case BlockKind.READ:
             color = None
         case BlockKind.INCLUDE:
             color = None
         case BlockKind.IMPORT:
             color = None
+        case BlockKind.AGGREGATOR:
+            color = None
         case BlockKind.EMPTY:
             color = None
         case BlockKind.ERROR:
diff --git a/src/pdl/pdl_schema_error_analyzer.py b/src/pdl/pdl_schema_error_analyzer.py
index 93f207b24..9b9076159 100644
--- a/src/pdl/pdl_schema_error_analyzer.py
+++ b/src/pdl/pdl_schema_error_analyzer.py
@@ -156,6 +156,13 @@ def analyze_errors(defs, schema, data, loc: PdlLocationType) -> list[str]:  # no
                     the_type_exists = True
                 if "enum" in item and data in item["enum"]:
                     the_type_exists = True
+                if "$ref" in item:
+                    ref_string = item["$ref"].split("/")[2]
+                    ref_type = defs[ref_string]
+                    errs = analyze_errors(defs, ref_type, data, loc)
+                    the_type_exists = len(errs) == 0
+                if the_type_exists:
+                    break
             if not the_type_exists:
                 ret.append(
                     get_loc_string(loc)
diff --git a/src/pdl/pdl_stdlib.pdl b/src/pdl/pdl_stdlib.pdl
new file mode 100644
index 000000000..651e1bf35
--- /dev/null
+++ b/src/pdl/pdl_stdlib.pdl
@@ -0,0 +1,87 @@
+
+defs: 
+  reward:
+    function:
+      response: 
+      evaluation: string
+    return:
+      defs:
+        contents: ${ response['choices'][0].logprobs.content}
+      lastOf:
+      - for: 
+          content: ${ contents }
+        repeat: 
+          if: ${ content.token == evaluation }
+          then: 
+            def: top_logprobs
+            data: ${ content.top_logprobs }
+      - for: 
+          tp: ${ top_logprobs }
+        repeat: 
+          match: ${ tp.token }
+          with:
+          - case: "Yes"
+            then:
+              data: ${ tp.logprob }
+              def: lp_y
+          - case: "No"
+            then: 
+              data: ${ tp.logprob }
+              def: lp_n
+      - lang: python  
+        code: |
+          import math 
+          try:
+            lp_y
+          except NameError:
+            lp_y = -10
+          try:
+            lp_n
+          except NameError:
+            lp_n = -10
+          result = math.log(math.exp(lp_y) / (math.exp(lp_y) + math.exp(lp_n)))
+
+  requirements:
+    object:
+      evaluation:
+        function:
+          requirement: string
+          response: string
+          llm_as_judge: {optional: string}
+        return:
+          lastOf:
+          - #model: ${ llm_as_judge | default('watsonx/meta-llama/llama-3-3-70b-instruct') }
+            model: ${ llm_as_judge | default('watsonx/openai/gpt-oss-120b') }
+            def: evaluation
+            input: |
+              Problem: ${ requirement }
+              Solution: ${ response }
+              
+              Respond with only ('Yes'/'No')
+            modelResponse: out
+            parameters:
+              temperature: 0
+              logprobs: true
+              top_logprobs: 5
+            spec: {enum: ['Yes', 'No']}
+          - ${ reward(response=out, evaluation=evaluation) }
+          
+          
+      transformContext:
+        function:
+          requirement: string
+          response: string
+          model: {optional: string}
+        return: 
+          lastOf:
+          - model: ${ model | default('ollama_chat/granite3.3:8b') }
+            input: |
+              The following requirement is not satisfied, what instruction can be added to get the correct answer?
+              Requirement: ${ requirement }
+              Answer with only the instruction.
+          - ${ pdl_context }
+
+
+
+  
+
diff --git a/src/pdl/pdl_utils.py b/src/pdl/pdl_utils.py
index 59afcef39..091ce7bff 100644
--- a/src/pdl/pdl_utils.py
+++ b/src/pdl/pdl_utils.py
@@ -6,6 +6,7 @@
 
 from .pdl_ast import (
     BlockType,
+    ContributeElement,
     ContributeTarget,
     ContributeValue,
     ExpressionType,
@@ -81,8 +82,8 @@ def value_of_expr(expr: ExpressionType[ValueOfExprT]) -> ValueOfExprT:
     return v  # type: ignore
 
 
-def replace_contribute_value(
-    contribute: Sequence[ContributeTarget | dict[str, ContributeValue]],
+def replace_contribute_value(  # TODO: remove
+    contribute: Sequence[ContributeElement],
     value: ContributeValue,
 ):
     ret = []
@@ -95,29 +96,36 @@ def replace_contribute_value(
     return ret
 
 
-def get_contribute_value(
-    contribute: Sequence[ContributeTarget | dict[str, ContributeValue]] | None,
+def get_contribute_context_value(
+    contribute: Sequence[ContributeElement] | None,
 ):
     if contribute is None:
         return None
     for item in contribute:
         if isinstance(item, dict) and isinstance(
-            item[ContributeTarget.CONTEXT], ContributeValue
+            item.get(ContributeTarget.CONTEXT), ContributeValue
         ):
             return item[ContributeTarget.CONTEXT].value
     return None
 
 
-def remove_none_values_from_message(message: dict) -> dict[str, Any]:
+def message_post_processing(message: dict) -> dict[str, Any]:
     ret = {}
     for key, value in message.items():
-        if key == "content":
+        if key == "content" and value is not None:
+            ret[key] = value
+        elif (
+            key == "reasoning_content" and value is not None
+        ):  # TODO: replacing reasoning_content with content here
+            key = "content"
             ret[key] = value
         if value is not None:
             if isinstance(value, dict):
-                ret[key] = remove_none_values_from_message(value)
+                ret[key] = message_post_processing(value)
             else:
                 ret[key] = value
+    if "content" not in ret:
+        ret["content"] = ""
     return ret
 
 
diff --git a/tests/data/line/hello32.pdl b/tests/data/line/hello32.pdl
new file mode 100644
index 000000000..76fb3e15a
--- /dev/null
+++ b/tests/data/line/hello32.pdl
@@ -0,0 +1,5 @@
+defs:
+  x:
+    data: 1
+    spec: string
+text: ${x}
diff --git a/tests/results/examples/aggregators/contribute_in_file.0.result b/tests/results/examples/aggregators/contribute_in_file.0.result
new file mode 100644
index 000000000..281fc3326
--- /dev/null
+++ b/tests/results/examples/aggregators/contribute_in_file.0.result
@@ -0,0 +1 @@
+HelloHello! How can I assist you today?nice to meet you.It's nice to meet you too! I'm here to help answer your questions or provide information on a wide range of topics. Please go ahead and ask.Bye
diff --git a/tests/results/examples/aggregators/contribute_in_stderr.0.result b/tests/results/examples/aggregators/contribute_in_stderr.0.result
new file mode 100644
index 000000000..5cd085a9f
--- /dev/null
+++ b/tests/results/examples/aggregators/contribute_in_stderr.0.result
@@ -0,0 +1 @@
+HelloHello! How can I assist you today?
diff --git a/tests/results/examples/aggregators/contribute_in_stdout.0.result b/tests/results/examples/aggregators/contribute_in_stdout.0.result
new file mode 100644
index 000000000..5cd085a9f
--- /dev/null
+++ b/tests/results/examples/aggregators/contribute_in_stdout.0.result
@@ -0,0 +1 @@
+HelloHello! How can I assist you today?
diff --git a/tests/results/examples/demo/9-react.0.result b/tests/results/examples/demo/9-react.0.result
index 679bcf2cd..040d4961f 100644
--- a/tests/results/examples/demo/9-react.0.result
+++ b/tests/results/examples/demo/9-react.0.result
@@ -11,4 +11,4 @@ Action:
 Observation: 460
 Henry Hudson was born around 1565, so he was approximately 460 years ago.Action:
 [{"name": "Finish", "arguments": {"topic": "460"}}]
-Observation: 
+Observation: 460
diff --git a/tests/results/examples/demo/9-react.1.result b/tests/results/examples/demo/9-react.1.result
index a670f1757..d544ecc82 100644
--- a/tests/results/examples/demo/9-react.1.result
+++ b/tests/results/examples/demo/9-react.1.result
@@ -21,4 +21,4 @@ Action:
 Observation: 460
 In the year 2025, it would be approximately 460 years ago that Henry Hudson was born.Action:
 [{"name": "Finish", "arguments": {"topic": "460"}}]
-Observation: 
+Observation: 460
diff --git a/tests/results/examples/demo/9-react.2.result b/tests/results/examples/demo/9-react.2.result
index 14c95d61f..592094826 100644
--- a/tests/results/examples/demo/9-react.2.result
+++ b/tests/results/examples/demo/9-react.2.result
@@ -23,4 +23,4 @@ Action:
 Observation: 460
 In the year 2025, it would be approximately 460 years ago that Henry Hudson was born.Action:
 [{"name": "Finish", "arguments": {"topic": "460"}}]
-Observation: 
\ No newline at end of file
+Observation: 460
\ No newline at end of file
diff --git a/tests/results/examples/demo/9-react.3.result b/tests/results/examples/demo/9-react.3.result
index a670f1757..d544ecc82 100644
--- a/tests/results/examples/demo/9-react.3.result
+++ b/tests/results/examples/demo/9-react.3.result
@@ -21,4 +21,4 @@ Action:
 Observation: 460
 In the year 2025, it would be approximately 460 years ago that Henry Hudson was born.Action:
 [{"name": "Finish", "arguments": {"topic": "460"}}]
-Observation: 
+Observation: 460
diff --git a/tests/results/examples/demo/9-react.4.result b/tests/results/examples/demo/9-react.4.result
index 679bcf2cd..040d4961f 100644
--- a/tests/results/examples/demo/9-react.4.result
+++ b/tests/results/examples/demo/9-react.4.result
@@ -11,4 +11,4 @@ Action:
 Observation: 460
 Henry Hudson was born around 1565, so he was approximately 460 years ago.Action:
 [{"name": "Finish", "arguments": {"topic": "460"}}]
-Observation: 
+Observation: 460
diff --git a/tests/results/examples/demo/9-react.5.result b/tests/results/examples/demo/9-react.5.result
index 279b584af..4f4a4e534 100644
--- a/tests/results/examples/demo/9-react.5.result
+++ b/tests/results/examples/demo/9-react.5.result
@@ -10,4 +10,4 @@ Henry Hudson was born around 1565. As of 2025, it has been approximately 470 yea
 Observation: 460
 Henry Hudson was born around 1565, which means he was born approximately 460 years ago as of 2025.Action:
 [{"name": "Finish", "arguments": {"topic": ""}}]
-Observation: 
\ No newline at end of file
+Observation: 460
\ No newline at end of file
diff --git a/tests/results/examples/demo/9-react.6.result b/tests/results/examples/demo/9-react.6.result
index ebce142c0..469ab46c5 100644
--- a/tests/results/examples/demo/9-react.6.result
+++ b/tests/results/examples/demo/9-react.6.result
@@ -12,4 +12,4 @@ Henry Hudson was born around 1565. As of 2025, it has been approximately 470 yea
 Observation: 460
 It has been approximately 460 years since Henry Hudson was born.Action:
 [{"name": "Finish", "arguments": {"topic": "460"}}]
-Observation: 
+Observation: 460
diff --git a/tests/results/examples/demo/9-react.7.result b/tests/results/examples/demo/9-react.7.result
new file mode 100644
index 000000000..f9520b25c
--- /dev/null
+++ b/tests/results/examples/demo/9-react.7.result
@@ -0,0 +1,13 @@
+How many years ago was the discoverer of the Hudson River born? Keep in mind we are in 2025. When searching for a birthday for a person, simply ask for the name of that person.
+Thought: I need to find out who discovered the Hudson River and then calculate how many years ago they were born based on the current year, 2025.
+Action:
+[{"name": "Search", "arguments": {"topic": "Henry Hudson"}}]
+Observation: Henry Hudson (c. 1565 – disappeared 23 June 1611) was an English sea explorer and navigator during the early 17th century, best known for his explorations of present-day Canada and parts of the Northeastern United States.
+In 1607 and 1608, Hudson made two attempts on behalf of English merchants to find a rumoured Northeast Passage to Cathay via a route above the Arctic Circle. In 1609, he landed in North America on behalf of the Dutch East India Company and explored the region around the modern New York metropolitan area. Looking for a Northwest Passage to Asia on his ship Halve Maen ("Half Moon"), he sailed up the Hudson River, which was later named after him, and thereby laid the foundation for Dutch colonization of the region. His contributions to the exploration of the New World were significant and lasting. His voyages helped to establish European contact with the native peoples of North America and contributed to the development of trade and commerce. 
+On his final expedition, while still searching for the Northwest Passage, Hudson became the first European to see Hudson Strait and the immense Hudson Bay. In 1611, after wintering on the shore of James Bay, Hudson wanted to press on to the west, but most of his crew mutinied. The mutineers cast Hudson, his son, and six others adrift; what then happened to the Hudsons and their companions is unknown.
+Henry Hudson was born around 1565. As of 2025, it has been approximately 470 years since Henry Hudson's birth.Action:
+[{"name": "Calc", "arguments": {"expr": "2025 - 1565"}}]
+Observation: 460
+It has been approximately 460 years since Henry Hudson was born.Action:
+[{"name": "Finish", "arguments": {"topic": "460"}}]
+Observation: 460
diff --git a/tests/results/examples/demo/9-react.8.result b/tests/results/examples/demo/9-react.8.result
new file mode 100644
index 000000000..a715aadda
--- /dev/null
+++ b/tests/results/examples/demo/9-react.8.result
@@ -0,0 +1,15 @@
+How many years ago was the discoverer of the Hudson River born? Keep in mind we are in 2025. When searching for a birthday for a person, simply ask for the name of that person.
+Thought: I need to find out who discovered the Hudson River and then calculate how many years ago they were born based on the current year, 2025.
+Action:
+[{"name": "Search", "arguments": {"topic": "Henry Hudson"}}]
+Observation: Henry Hudson (c. 1565 – disappeared 23 June 1611) was an English sea explorer and navigator during the early 17th century, best known for his explorations of present-day Canada and parts of the Northeastern United States.
+In 1607 and 1608, Hudson made two attempts on behalf of English merchants to find a rumoured Northeast Passage to Cathay via a route above the Arctic Circle. In 1609, he landed in North America on behalf of the Dutch East India Company and explored the region around the modern New York metropolitan area. Looking for a Northwest Passage to Asia on his ship Halve Maen ("Half Moon"), he sailed up the Hudson River, which was later named after him, and thereby laid the foundation for Dutch colonization of the region. His contributions to the exploration of the New World were significant and lasting. His voyages helped to establish European contact with the native peoples of North America and contributed to the development of trade and commerce. 
+On his final expedition, while still searching for the Northwest Passage, Hudson became the first European to see Hudson Strait and the immense Hudson Bay. In 1611, after wintering on the shore of James Bay, Hudson wanted to press on to the west, but most of his crew mutinied. The mutineers cast Hudson, his son, and six others adrift; what then happened to the Hudsons and their companions is unknown.
+
+
+Henry Hudson was born around 1565. As of 2025, it has been approximately 470 years since Henry Hudson's birth.Action:
+[{"name": "Calc", "arguments": {"expr": "2025 - 1565"}}]
+Observation: 460
+Henry Hudson was born around 1565, so in 2025, it has been approximately 460 years since his birth.Action:
+[{"name": "Finish", "arguments": {"topic": "460"}}]
+Observation: 460
diff --git a/tests/results/examples/demos/react.0.result b/tests/results/examples/demos/react.0.result
index 279b584af..4f4a4e534 100644
--- a/tests/results/examples/demos/react.0.result
+++ b/tests/results/examples/demos/react.0.result
@@ -10,4 +10,4 @@ Henry Hudson was born around 1565. As of 2025, it has been approximately 470 yea
 Observation: 460
 Henry Hudson was born around 1565, which means he was born approximately 460 years ago as of 2025.Action:
 [{"name": "Finish", "arguments": {"topic": ""}}]
-Observation: 
\ No newline at end of file
+Observation: 460
\ No newline at end of file
diff --git a/tests/results/examples/demos/react.1.result b/tests/results/examples/demos/react.1.result
index ec6f7668e..b171b1896 100644
--- a/tests/results/examples/demos/react.1.result
+++ b/tests/results/examples/demos/react.1.result
@@ -1,15 +1,16 @@
- How many years ago was the discoverer of the Hudson River born? Keep in mind we are in 2025. When searching for a birthday for a person, simply ask for the name of that person.
-Thought: I need to find out who discovered the Hudson River and then calculate how many years ago they were born based on the current year, 2025.
+How many years ago was the discoverer of the Hudson River born? Keep in mind we are in 2025. When searching for a birthday for a person, simply ask for the name of that person.
+Thought: I need to search who discovered the Hudson River.
 Action:
 [{"name": "Search", "arguments": {"topic": "Henry Hudson"}}]
 Observation: Henry Hudson (c. 1565 – disappeared 23 June 1611) was an English sea explorer and navigator during the early 17th century, best known for his explorations of present-day Canada and parts of the Northeastern United States.
 In 1607 and 1608, Hudson made two attempts on behalf of English merchants to find a rumoured Northeast Passage to Cathay via a route above the Arctic Circle. In 1609, he landed in North America on behalf of the Dutch East India Company and explored the region around the modern New York metropolitan area. Looking for a Northwest Passage to Asia on his ship Halve Maen ("Half Moon"), he sailed up the Hudson River, which was later named after him, and thereby laid the foundation for Dutch colonization of the region. His contributions to the exploration of the New World were significant and lasting. His voyages helped to establish European contact with the native peoples of North America and contributed to the development of trade and commerce. 
 On his final expedition, while still searching for the Northwest Passage, Hudson became the first European to see Hudson Strait and the immense Hudson Bay. In 1611, after wintering on the shore of James Bay, Hudson wanted to press on to the west, but most of his crew mutinied. The mutineers cast Hudson, his son, and six others adrift; what then happened to the Hudsons and their companions is unknown.
-
-
-Henry Hudson was born around 1565. As of 2025, it has been approximately 470 years since Henry Hudson's birth.Action:
+Thought: Henry Hudson was born around 1565. To find out how many years ago he was born from the year 2025, we subtract 2025 from 1565.
+Calculation: 2025 - 1565 = 460
+Action:
 [{"name": "Calc", "arguments": {"expr": "2025 - 1565"}}]
 Observation: 460
-It has been approximately 460 years since Henry Hudson was born.Action:
+Henry Hudson was born around 460 years before 2025.Action:
 [{"name": "Finish", "arguments": {"topic": "460"}}]
-Observation: 
+Observation: 460
+
diff --git a/tests/results/examples/demos/react.2.result b/tests/results/examples/demos/react.2.result
new file mode 100644
index 000000000..f9520b25c
--- /dev/null
+++ b/tests/results/examples/demos/react.2.result
@@ -0,0 +1,13 @@
+How many years ago was the discoverer of the Hudson River born? Keep in mind we are in 2025. When searching for a birthday for a person, simply ask for the name of that person.
+Thought: I need to find out who discovered the Hudson River and then calculate how many years ago they were born based on the current year, 2025.
+Action:
+[{"name": "Search", "arguments": {"topic": "Henry Hudson"}}]
+Observation: Henry Hudson (c. 1565 – disappeared 23 June 1611) was an English sea explorer and navigator during the early 17th century, best known for his explorations of present-day Canada and parts of the Northeastern United States.
+In 1607 and 1608, Hudson made two attempts on behalf of English merchants to find a rumoured Northeast Passage to Cathay via a route above the Arctic Circle. In 1609, he landed in North America on behalf of the Dutch East India Company and explored the region around the modern New York metropolitan area. Looking for a Northwest Passage to Asia on his ship Halve Maen ("Half Moon"), he sailed up the Hudson River, which was later named after him, and thereby laid the foundation for Dutch colonization of the region. His contributions to the exploration of the New World were significant and lasting. His voyages helped to establish European contact with the native peoples of North America and contributed to the development of trade and commerce. 
+On his final expedition, while still searching for the Northwest Passage, Hudson became the first European to see Hudson Strait and the immense Hudson Bay. In 1611, after wintering on the shore of James Bay, Hudson wanted to press on to the west, but most of his crew mutinied. The mutineers cast Hudson, his son, and six others adrift; what then happened to the Hudsons and their companions is unknown.
+Henry Hudson was born around 1565. As of 2025, it has been approximately 470 years since Henry Hudson's birth.Action:
+[{"name": "Calc", "arguments": {"expr": "2025 - 1565"}}]
+Observation: 460
+It has been approximately 460 years since Henry Hudson was born.Action:
+[{"name": "Finish", "arguments": {"topic": "460"}}]
+Observation: 460
diff --git a/tests/results/examples/demos/react.3.result b/tests/results/examples/demos/react.3.result
new file mode 100644
index 000000000..a4c21f3c9
--- /dev/null
+++ b/tests/results/examples/demos/react.3.result
@@ -0,0 +1,16 @@
+How many years ago was the discoverer of the Hudson River born? Keep in mind we are in 2025. When searching for a birthday for a person, simply ask for the name of that person.
+Thought: I need to search who discovered the Hudson River.
+Action:
+[{"name": "Search", "arguments": {"topic": "Henry Hudson"}}]
+Observation: Henry Hudson (c. 1565 – disappeared 23 June 1611) was an English sea explorer and navigator during the early 17th century, best known for his explorations of present-day Canada and parts of the Northeastern United States.
+In 1607 and 1608, Hudson made two attempts on behalf of English merchants to find a rumoured Northeast Passage to Cathay via a route above the Arctic Circle. In 1609, he landed in North America on behalf of the Dutch East India Company and explored the region around the modern New York metropolitan area. Looking for a Northwest Passage to Asia on his ship Halve Maen ("Half Moon"), he sailed up the Hudson River, which was later named after him, and thereby laid the foundation for Dutch colonization of the region. His contributions to the exploration of the New World were significant and lasting. His voyages helped to establish European contact with the native peoples of North America and contributed to the development of trade and commerce. 
+On his final expedition, while still searching for the Northwest Passage, Hudson became the first European to see Hudson Strait and the immense Hudson Bay. In 1611, after wintering on the shore of James Bay, Hudson wanted to press on to the west, but most of his crew mutinied. The mutineers cast Hudson, his son, and six others adrift; what then happened to the Hudsons and their companions is unknown.
+Thought: Henry Hudson was born around 1565. To find out how many years ago he was born from the year 2025, we subtract 2025 from 1565.
+Calculation: 2025 - 1565 = 460
+Action:
+[{"name": "Calc", "arguments": {"expr": "2025 - 1565"}}]
+Observation: 460
+Henry Hudson was born around 460 years before 2025.Action:
+[{"name": "Finish", "arguments": {"topic": "460"}}]
+Observation: 
+
diff --git a/tests/results/examples/demos/react.4.result b/tests/results/examples/demos/react.4.result
new file mode 100644
index 000000000..469ab46c5
--- /dev/null
+++ b/tests/results/examples/demos/react.4.result
@@ -0,0 +1,15 @@
+How many years ago was the discoverer of the Hudson River born? Keep in mind we are in 2025. When searching for a birthday for a person, simply ask for the name of that person.
+Thought: I need to find out who discovered the Hudson River and then calculate how many years ago they were born based on the current year, 2025.
+Action:
+[{"name": "Search", "arguments": {"topic": "Henry Hudson"}}]
+Observation: Henry Hudson (c. 1565 – disappeared 23 June 1611) was an English sea explorer and navigator during the early 17th century, best known for his explorations of present-day Canada and parts of the Northeastern United States.
+In 1607 and 1608, Hudson made two attempts on behalf of English merchants to find a rumoured Northeast Passage to Cathay via a route above the Arctic Circle. In 1609, he landed in North America on behalf of the Dutch East India Company and explored the region around the modern New York metropolitan area. Looking for a Northwest Passage to Asia on his ship Halve Maen ("Half Moon"), he sailed up the Hudson River, which was later named after him, and thereby laid the foundation for Dutch colonization of the region. His contributions to the exploration of the New World were significant and lasting. His voyages helped to establish European contact with the native peoples of North America and contributed to the development of trade and commerce. 
+On his final expedition, while still searching for the Northwest Passage, Hudson became the first European to see Hudson Strait and the immense Hudson Bay. In 1611, after wintering on the shore of James Bay, Hudson wanted to press on to the west, but most of his crew mutinied. The mutineers cast Hudson, his son, and six others adrift; what then happened to the Hudsons and their companions is unknown.
+
+
+Henry Hudson was born around 1565. As of 2025, it has been approximately 470 years since Henry Hudson's birth.Action:
+[{"name": "Calc", "arguments": {"expr": "2025 - 1565"}}]
+Observation: 460
+It has been approximately 460 years since Henry Hudson was born.Action:
+[{"name": "Finish", "arguments": {"topic": "460"}}]
+Observation: 460
diff --git a/tests/results/examples/demos/react_call.2.result b/tests/results/examples/demos/react_call.2.result
new file mode 100644
index 000000000..48e5efe3f
--- /dev/null
+++ b/tests/results/examples/demos/react_call.2.result
@@ -0,0 +1,18 @@
+ How many years ago was the discoverer of the Hudson River born? Keep in mind we are in 2025. When searching avoid using the words discovery or birthday.
+
+To find out how many years ago Henry Hudson was born without using the words 'discovery' or 'birthday', I will use the Search tool. 
+
+Action:
+[{"name": "Search", "arguments": {"topic": "Henry Hudson"}}]
+Observation: Henry Hudson (c. 1565 – disappeared 23 June 1611) was an English sea explorer and navigator during the early 17th century, best known for his explorations of present-day Canada and parts of the Northeastern United States.
+In 1607 and 1608, Hudson made two attempts on behalf of English merchants to find a rumoured Northeast Passage to Cathay via a route above the Arctic Circle. In 1609, he landed in North America on behalf of the Dutch East India Company and explored the region around the modern New York metropolitan area. Looking for a Northwest Passage to Asia on his ship Halve Maen ("Half Moon"), he sailed up the Hudson River, which was later named after him, and thereby laid the foundation for Dutch colonization of the region. His contributions to the exploration of the New World were significant and lasting. His voyages helped to establish European contact with the native peoples of North America and contributed to the development of trade and commerce. 
+On his final expedition, while still searching for the Northwest Passage, Hudson became the first European to see Hudson Strait and the immense Hudson Bay. In 1611, after wintering on the shore of James Bay, Hudson wanted to press on to the west, but most of his crew mutinied. The mutineers cast Hudson, his son, and six others adrift; what then happened to the Hudsons and their companions is unknown.
+According to this information, Henry Hudson was born around 1565. As we are in 2025, we can calculate how many years ago that was by subtracting 1565 from 2025. 
+
+Action:
+[{"name": "Calc", "arguments": {"expr": "2025 - 1565"}}]
+Observation: 460
+Henry Hudson was born approximately 460 years ago, as calculated from the year 2025.
+
+Action:
+[{"name": "Finish", "arguments": {}}]
\ No newline at end of file
diff --git a/tests/results/examples/demos/wiki.1.result b/tests/results/examples/demos/wiki.1.result
new file mode 100644
index 000000000..1a1d80a0f
--- /dev/null
+++ b/tests/results/examples/demos/wiki.1.result
@@ -0,0 +1,7 @@
+What is the circumference of planet Earth?
+[{"name": "search", "arguments": {"topic": "circumference of Earth"}}]
+Earth's circumference is the distance around Earth. It is approximately 40,000 kilometers and 21,600 nautical miles, because those units were defined in the 18th and 17th centuries, respectively, as a function of the measurement. The Earth is not a perfect sphere. Precisely measured around the equator, it is 40,075.017 km (24,901.461 mi). Measured passing through the poles, the circumference is 40,007.863 km (24,859.734 mi).
+Treating the Earth as a sphere, its circumference would be its single most important measurement. The first known scientific measurement and calculation was done by Eratosthenes, by comparing altitudes of the mid-day sun at two places a known north–south distance apart. He achieved a great degree of precision in his computation. The Earth's shape deviates from spherical by flattening, but by only about 0.3%.
+
+Measurement of Earth's circumference has been important to navigation since ancient times. In modern times, Earth's circumference has been used to define fundamental units of measurement of length: the nautical mile in the seventeenth century and the metre in the eighteenth. Earth's polar circumference is very near to 21,600 nautical miles because the nautical mile was intended to express one  minute of latitude (see meridian arc), which is 21,600 partitions of the polar circumference (that is 60 minutes × 360 degrees). The polar circumference is also close to 40,000 kilometres because the metre was originally defined to be one ten millionth (i.e., a kilometre is one ten thousandth) of the arc from pole to equator (quarter meridian). The accuracy of measuring the circumference has improved since then, but the physical length of each unit of measure had remained close to what it was determined to be at the time, so the Earth's circumference is no longer a round number in metres or nautical miles.
+
diff --git a/tests/results/examples/fibonacci/fib.2.result b/tests/results/examples/fibonacci/fib.2.result
new file mode 100644
index 000000000..f895b07a5
--- /dev/null
+++ b/tests/results/examples/fibonacci/fib.2.result
@@ -0,0 +1,73 @@
+Here is a simple Python function that computes the Fibonacci sequence using recursion:
+
+```python
+def fibonacci(n):
+    if n <= 0:
+        return "Input should be a positive integer."
+    elif n == 1:
+        return 0
+    elif n == 2:
+        return 1
+    else:
+        return fibonacci(n - 1) + fibonacci(n - 2)
+```
+
+This function takes an integer `n` as input and returns the nth number in the Fibonacci sequence. However, it's important to note that this implementation has exponential time complexity due to repeated calculations of the same subproblems (i.e., it performs a lot of redundant work). For larger inputs, you should use an iterative approach or memoization to improve performance:
+
+```python
+def fibonacci_iterative(n):
+    if n <= 0:
+        return "Input should be a positive integer."
+    elif n == 1:
+        return 0
+    elif n == 2:
+        return 1
+
+    fib_values = [0, 1] + [0] * (n - 2)
+    for i in range(2, n):
+        fib_values[i] = fib_values[i - 1] + fib_values[i - 2]
+    return fib_values[n - 1]
+```
+
+This version of the function uses an iterative approach with a list to store previously computed Fibonacci numbers, reducing time complexity to linear.
+Find a random number between 1 and 20
+15
+Now computing fibonacci(15)
+
+def fibonacci(n):
+    if n <= 0:
+        return "Input should be a positive integer."
+    elif n == 1:
+        return 0
+    elif n == 2:
+        return 1
+    else:
+        return fibonacci(n - 1) + fibonacci(n - 2)
+The result is: 377
+
+Explain what the above code does and what the result means
+
+The provided Python function `fibonacci(n)` calculates the nth number in the Fibonacci sequence, where each number is the sum of the two preceding ones (starting from 0 and 1). Here's a breakdown of how it works:
+
+1. **Base Cases**:
+   - If `n` is less than or equal to 0, return an error message "Input should be a positive integer." This ensures that the function doesn't attempt to calculate Fibonacci numbers for non-positive integers.
+   - If `n` is 1, return 0. The first number in the Fibonacci sequence is 0.
+   - If `n` is 2, return 1. The second number in the Fibonacci sequence is 1.
+
+2. **Recursive Case**: For any integer `n` greater than 2:
+   - Return the sum of the (n-1)th and (n-2)th Fibonacci numbers calculated by recursively calling `fibonacci(n - 1)` and `fibonacci(n - 2)`.
+
+The result, "377", is the 15th number in the Fibonacci sequence. To find this value:
+
+- Start with the base cases:
+  - The first two numbers are 0 and 1 (since `fibonacci(1) = 0` and `fibonacci(2) = 1`).
+  
+- Calculate subsequent values using the recursive formula:
+  - `fibonacci(3) = fibonacci(2) + fibonacci(1) = 1 + 0 = 1`
+  - `fibonacci(4) = fibonacci(3) + fibonacci(2) = 1 + 1 = 2`
+  - Continue this process up to `fibonacci(15)`.
+
+- The Fibonacci sequence grows rapidly, so here are the first few terms for clarity:
+  - 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377
+
+Thus, `fibonacci(15)` returns **377**, which is the 15th number in this sequence.
\ No newline at end of file
diff --git a/tests/results/examples/map-reduce/context_fork.0.result b/tests/results/examples/map-reduce/context_fork.0.result
new file mode 100644
index 000000000..0f926a9d5
--- /dev/null
+++ b/tests/results/examples/map-reduce/context_fork.0.result
@@ -0,0 +1 @@
+["Hello Alice! It's nice to meet you. How can I assist you today? Let's chat about anything you're interested in or need help with. 😊", "Hello, Bob! It's nice to meet you. How can I assist you today? If you have any questions or need information on various topics, feel free to ask. I'm here to help.", "Hello Charlie! It's nice to meet you. How can I assist you today? Whether it's answering questions, providing information, or just engaging in friendly conversation, feel free to share what's on your mind. I'm here to help and make our interaction as useful and enjoyable as possible."]
\ No newline at end of file
diff --git a/tests/results/examples/map-reduce/context_fork.1.result b/tests/results/examples/map-reduce/context_fork.1.result
new file mode 100644
index 000000000..2bb25007c
--- /dev/null
+++ b/tests/results/examples/map-reduce/context_fork.1.result
@@ -0,0 +1 @@
+ ["Hello Alice! It's nice to meet you. How can I assist you today? Let's chat about anything you're interested in or need help with. Whether it's information on a specific topic, answering questions, or just having a friendly conversation, I'm here for you. What brings you here today?", "Hello, Bob! It's nice to meet you. How can I assist you today? If you have any questions or need information on various topics, feel free to ask. I'm here to help.", "Hello Charlie! It's nice to meet you. How can I assist you today? Whether it's answering questions, providing information, or just engaging in friendly conversation, feel free to share what's on your mind. I'm here to help and make our interaction as useful and enjoyable as possible."]
\ No newline at end of file
diff --git a/tests/results/examples/map-reduce/python-reduce.0.result b/tests/results/examples/map-reduce/python-reduce.0.result
new file mode 100644
index 000000000..9a037142a
--- /dev/null
+++ b/tests/results/examples/map-reduce/python-reduce.0.result
@@ -0,0 +1 @@
+10
\ No newline at end of file
diff --git a/tests/results/examples/map-reduce/reduce.0.result b/tests/results/examples/map-reduce/reduce.0.result
new file mode 100644
index 000000000..9a037142a
--- /dev/null
+++ b/tests/results/examples/map-reduce/reduce.0.result
@@ -0,0 +1 @@
+10
\ No newline at end of file
diff --git a/tests/results/examples/tools/search.2.result b/tests/results/examples/tools/search.2.result
new file mode 100644
index 000000000..1a1d80a0f
--- /dev/null
+++ b/tests/results/examples/tools/search.2.result
@@ -0,0 +1,7 @@
+What is the circumference of planet Earth?
+[{"name": "search", "arguments": {"topic": "circumference of Earth"}}]
+Earth's circumference is the distance around Earth. It is approximately 40,000 kilometers and 21,600 nautical miles, because those units were defined in the 18th and 17th centuries, respectively, as a function of the measurement. The Earth is not a perfect sphere. Precisely measured around the equator, it is 40,075.017 km (24,901.461 mi). Measured passing through the poles, the circumference is 40,007.863 km (24,859.734 mi).
+Treating the Earth as a sphere, its circumference would be its single most important measurement. The first known scientific measurement and calculation was done by Eratosthenes, by comparing altitudes of the mid-day sun at two places a known north–south distance apart. He achieved a great degree of precision in his computation. The Earth's shape deviates from spherical by flattening, but by only about 0.3%.
+
+Measurement of Earth's circumference has been important to navigation since ancient times. In modern times, Earth's circumference has been used to define fundamental units of measurement of length: the nautical mile in the seventeenth century and the metre in the eighteenth. Earth's polar circumference is very near to 21,600 nautical miles because the nautical mile was intended to express one  minute of latitude (see meridian arc), which is 21,600 partitions of the polar circumference (that is 60 minutes × 360 degrees). The polar circumference is also close to 40,000 kilometres because the metre was originally defined to be one ten millionth (i.e., a kilometre is one ten thousandth) of the arc from pole to equator (quarter meridian). The accuracy of measuring the circumference has improved since then, but the physical length of each unit of measure had remained close to what it was determined to be at the time, so the Earth's circumference is no longer a round number in metres or nautical miles.
+
diff --git a/tests/results/examples/tools/wiki.1.result b/tests/results/examples/tools/wiki.1.result
new file mode 100644
index 000000000..1a1d80a0f
--- /dev/null
+++ b/tests/results/examples/tools/wiki.1.result
@@ -0,0 +1,7 @@
+What is the circumference of planet Earth?
+[{"name": "search", "arguments": {"topic": "circumference of Earth"}}]
+Earth's circumference is the distance around Earth. It is approximately 40,000 kilometers and 21,600 nautical miles, because those units were defined in the 18th and 17th centuries, respectively, as a function of the measurement. The Earth is not a perfect sphere. Precisely measured around the equator, it is 40,075.017 km (24,901.461 mi). Measured passing through the poles, the circumference is 40,007.863 km (24,859.734 mi).
+Treating the Earth as a sphere, its circumference would be its single most important measurement. The first known scientific measurement and calculation was done by Eratosthenes, by comparing altitudes of the mid-day sun at two places a known north–south distance apart. He achieved a great degree of precision in his computation. The Earth's shape deviates from spherical by flattening, but by only about 0.3%.
+
+Measurement of Earth's circumference has been important to navigation since ancient times. In modern times, Earth's circumference has been used to define fundamental units of measurement of length: the nautical mile in the seventeenth century and the metre in the eighteenth. Earth's polar circumference is very near to 21,600 nautical miles because the nautical mile was intended to express one  minute of latitude (see meridian arc), which is 21,600 partitions of the polar circumference (that is 60 minutes × 360 degrees). The polar circumference is also close to 40,000 kilometres because the metre was originally defined to be one ten millionth (i.e., a kilometre is one ten thousandth) of the arc from pole to equator (quarter meridian). The accuracy of measuring the circumference has improved since then, but the physical length of each unit of measure had remained close to what it was determined to be at the time, so the Earth's circumference is no longer a round number in metres or nautical miles.
+
diff --git a/tests/results/examples/tutorial/calling_llm_chaining.0.result b/tests/results/examples/tutorial/calling_llm_chaining.0.result
index 241d9a74f..ac37482be 100644
--- a/tests/results/examples/tutorial/calling_llm_chaining.0.result
+++ b/tests/results/examples/tutorial/calling_llm_chaining.0.result
@@ -1,4 +1,4 @@
 Hello
 Hello
-Did you just say Hello?
-Yes, I did. It's a common greeting, similar to how humans might respond when they first interact with an artificial intelligence like me. How can I assist you today?
\ No newline at end of file
+Translate the above to French
+Bonjour
\ No newline at end of file
diff --git a/tests/results/examples/tutorial/calling_llm_chaining.1.result b/tests/results/examples/tutorial/calling_llm_chaining.1.result
deleted file mode 100644
index ac37482be..000000000
--- a/tests/results/examples/tutorial/calling_llm_chaining.1.result
+++ /dev/null
@@ -1,4 +0,0 @@
-Hello
-Hello
-Translate the above to French
-Bonjour
\ No newline at end of file
diff --git a/tests/results/examples/tutorial/calling_llm_with_input_messages_var.0.result b/tests/results/examples/tutorial/calling_llm_with_input_messages_var.0.result
index d2307e4f4..218c1c505 100644
--- a/tests/results/examples/tutorial/calling_llm_with_input_messages_var.0.result
+++ b/tests/results/examples/tutorial/calling_llm_with_input_messages_var.0.result
@@ -1,47 +1,2 @@
-Here is a Python implementation of the Merge Sort algorithm:
-
-```python
-def merge_sort(arr):
-    # Base case: if array has 1 or no elements, it's already sorted
-    if len(arr) <= 1:
-        return arr
-
-    # Divide the array into two halves
-    mid = len(arr) // 2
-    left_half = arr[:mid]
-    right_half = arr[mid:]
-
-    # Recursively sort both halves
-    left_sorted = merge_sort(left_half)
-    right_sorted = merge_sort(right_half)
-
-    # Merge the sorted halves back together
-    return merge(left_sorted, right_sorted)
-
-def merge(left, right):
-    """
-    Merge two sorted lists into a single sorted list.
-    """
-    merged = []  # Initialize an empty list for the result
-    left_index = 0  # Index for the left list
-    right_index = 0  # Index for the right list
-
-    # Continue until we've exhausted both lists
-    while left_index < len(left) and right_index < len(right):
-        if left[left_index] <= right[right_index]:
-            merged.append(left[left_index])
-            left_index += 1
-        else:
-            merged.append(right[right_index])
-            right_index += 1
-
-    # If there are any remaining elements in either list, append them to the result
-    merged.extend(left[left_index:])
-    merged.extend(right[right_index:])
-
-    return merged
-```
-
-This code first checks if the array is already sorted (i.e., has one or zero elements). If so, it returns the array as is. Otherwise, it divides the array into two halves and recursively sorts each half. The `merge` function then combines these sorted halves back together to produce a single sorted list.
-
-The time complexity of Merge Sort is O(n log n) for all cases (best, average, worst), making it efficient even for large lists.
\ No newline at end of file
+Hello
+The translation of 'Hello' into French is 'Bonjour'.
\ No newline at end of file
diff --git a/tests/results/examples/tutorial/calling_llm_with_input_messages_var.1.result b/tests/results/examples/tutorial/calling_llm_with_input_messages_var.1.result
deleted file mode 100644
index 150ac5d58..000000000
--- a/tests/results/examples/tutorial/calling_llm_with_input_messages_var.1.result
+++ /dev/null
@@ -1,53 +0,0 @@
-Here is a Python implementation of the Merge Sort algorithm:
-
-```python
-def merge_sort(arr):
-    # Base case: if array has 1 or no elements, it's already sorted
-    if len(arr) <= 1:
-        return arr
-
-    # Divide the array into two halves
-    mid = len(arr) // 2
-    left_half = arr[:mid]
-    right_half = arr[mid:]
-
-    # Recursively sort both halves
-    left_sorted = merge_sort(left_half)
-    right_sorted = merge_sort(right_half)
-
-    # Merge the sorted halves back together
-    return merge(left_sorted, right_sorted)
-
-def merge(left, right):
-    """
-    Merge two sorted arrays into one sorted array.
-    """
-    merged = []  # Initialize an empty list for the result
-    left_index = 0  # Index for left array
-    right_index = 0  # Index for right array
-
-    # Continue until we've processed all elements in both lists
-    while left_index < len(left) and right_index < len(right):
-        if left[left_index] <= right[right_index]:
-            merged.append(left[left_index])
-            left_index += 1
-        else:
-            merged.append(right[right_index])
-            right_index += 1
-
-    # If there are any remaining elements in either list, append them to the result
-    merged.extend(left[left_index:])
-    merged.extend(right[right_index:])
-
-    return merged
-```
-
-This code first checks if the array is already sorted (i.e., has one or no elements). If not, it divides the array into two halves and recursively sorts them. Then, it merges these sorted halves back together using a helper function `merge()`. The merging process compares elements from both halves and adds the smaller element to the result list until all elements are processed.
-
-You can use this function like so:
-
-```python
-arr = [38, 27, 43, 3, 9, 82, 10]
-sorted_arr = merge_sort(arr)
-print(sorted_arr)  # Outputs: [3, 9, 10, 27, 38, 43, 82]
-```
\ No newline at end of file
diff --git a/tests/results/examples/tutorial/calling_llm_with_input_messages_var.2.result b/tests/results/examples/tutorial/calling_llm_with_input_messages_var.2.result
deleted file mode 100644
index d2307e4f4..000000000
--- a/tests/results/examples/tutorial/calling_llm_with_input_messages_var.2.result
+++ /dev/null
@@ -1,47 +0,0 @@
-Here is a Python implementation of the Merge Sort algorithm:
-
-```python
-def merge_sort(arr):
-    # Base case: if array has 1 or no elements, it's already sorted
-    if len(arr) <= 1:
-        return arr
-
-    # Divide the array into two halves
-    mid = len(arr) // 2
-    left_half = arr[:mid]
-    right_half = arr[mid:]
-
-    # Recursively sort both halves
-    left_sorted = merge_sort(left_half)
-    right_sorted = merge_sort(right_half)
-
-    # Merge the sorted halves back together
-    return merge(left_sorted, right_sorted)
-
-def merge(left, right):
-    """
-    Merge two sorted lists into a single sorted list.
-    """
-    merged = []  # Initialize an empty list for the result
-    left_index = 0  # Index for the left list
-    right_index = 0  # Index for the right list
-
-    # Continue until we've exhausted both lists
-    while left_index < len(left) and right_index < len(right):
-        if left[left_index] <= right[right_index]:
-            merged.append(left[left_index])
-            left_index += 1
-        else:
-            merged.append(right[right_index])
-            right_index += 1
-
-    # If there are any remaining elements in either list, append them to the result
-    merged.extend(left[left_index:])
-    merged.extend(right[right_index:])
-
-    return merged
-```
-
-This code first checks if the array is already sorted (i.e., has one or zero elements). If so, it returns the array as is. Otherwise, it divides the array into two halves and recursively sorts each half. The `merge` function then combines these sorted halves back together to produce a single sorted list.
-
-The time complexity of Merge Sort is O(n log n) for all cases (best, average, worst), making it efficient even for large lists.
\ No newline at end of file
diff --git a/tests/results/examples/tutorial/calling_llm_with_input_messages_var.3.result b/tests/results/examples/tutorial/calling_llm_with_input_messages_var.3.result
deleted file mode 100644
index ca5666e7a..000000000
--- a/tests/results/examples/tutorial/calling_llm_with_input_messages_var.3.result
+++ /dev/null
@@ -1,47 +0,0 @@
-Here is a Python implementation of the Merge Sort algorithm:
-
-```python
-def merge_sort(arr):
-    # Base case: if array has 1 or no elements, it's already sorted
-    if len(arr) <= 1:
-        return arr
-
-    # Divide the array into two halves
-    mid = len(arr) // 2
-    left_half = arr[:mid]
-    right_half = arr[mid:]
-
-    # Recursively sort both halves
-    left_sorted = merge_sort(left_half)
-    right_sorted = merge_sort(right_half)
-
-    # Merge the sorted halves back together
-    return merge(left_sorted, right_sorted)
-
-def merge(left, right):
-    """
-    Merge two sorted arrays into one sorted array.
-    """
-    merged = []  # Initialize an empty list for the merged result
-    left_index = 0  # Index for left array
-    right_index = 0  # Index for right array
-
-    # Continue until we've processed all elements in both lists
-    while left_index < len(left) and right_index < len(right):
-        if left[left_index] <= right[right_index]:
-            merged.append(left[left_index])
-            left_index += 1
-        else:
-            merged.append(right[right_index])
-            right_index += 1
-
-    # If there are any remaining elements in either list, append them to the result
-    merged.extend(left[left_index:])
-    merged.extend(right[right_index:])
-
-    return merged
-```
-
-This code first checks if the array is already sorted (i.e., has one or zero elements). If so, it returns the array as is. Otherwise, it divides the array into two halves and recursively sorts each half. The `merge` function then combines these sorted halves back together in a single sorted list.
-
-The time complexity of merge sort is O(n log n) for all cases (best, average, worst), making it efficient even for large lists.
diff --git a/tests/results/examples/tutorial/calling_llm_with_input_messages_var.4.result b/tests/results/examples/tutorial/calling_llm_with_input_messages_var.4.result
deleted file mode 100644
index 9482c3618..000000000
--- a/tests/results/examples/tutorial/calling_llm_with_input_messages_var.4.result
+++ /dev/null
@@ -1,47 +0,0 @@
-Here is a Python implementation of the Merge Sort algorithm:
-
-```python
-def merge_sort(arr):
-    # Base case: if array has 1 or no elements, it's already sorted
-    if len(arr) <= 1:
-        return arr
-
-    # Divide the array into two halves
-    mid = len(arr) // 2
-    left_half = arr[:mid]
-    right_half = arr[mid:]
-
-    # Recursively sort both halves
-    left_sorted = merge_sort(left_half)
-    right_sorted = merge_sort(right_half)
-
-    # Merge the sorted halves back together
-    return merge(left_sorted, right_sorted)
-
-def merge(left, right):
-    """
-    Merge two sorted arrays into one sorted array.
-    """
-    merged = []  # Initialize an empty list for the result
-    left_index = 0  # Index for the left array
-    right_index = 0  # Index for the right array
-
-    # Continue until we've iterated through both lists
-    while left_index < len(left) and right_index < len(right):
-        if left[left_index] <= right[right_index]:
-            merged.append(left[left_index])
-            left_index += 1
-        else:
-            merged.append(right[right_index])
-            right_index += 1
-
-    # If there are any remaining elements in either list, append them to the result
-    merged.extend(left[left_index:])
-    merged.extend(right[right_index:])
-
-    return merged
-```
-
-This code first checks if the array is already sorted (i.e., has one or zero elements). If so, it returns the array as is. Otherwise, it divides the array into two halves and recursively sorts each half. The `merge` function then combines these sorted halves back together to produce a single sorted array.
-
-The time complexity of Merge Sort is O(n log n) for all cases (best, average, worst), making it efficient even for large lists.
diff --git a/tests/results/examples/tutorial/defs-hello.0.result b/tests/results/examples/tutorial/defs-hello.0.result
deleted file mode 100644
index ffd7606c1..000000000
--- a/tests/results/examples/tutorial/defs-hello.0.result
+++ /dev/null
@@ -1,2 +0,0 @@
-Hello World!
-Good bye
\ No newline at end of file
diff --git a/tests/results/examples/tutorial/defs.0.result b/tests/results/examples/tutorial/defs.0.result
index 2d4182036..680f268e2 100644
--- a/tests/results/examples/tutorial/defs.0.result
+++ b/tests/results/examples/tutorial/defs.0.result
@@ -1,2 +1,9 @@
-'J'aime Paris !'
-The translation of "I love Madrid!" into Spanish is: "Me encanta Madrid!"
\ No newline at end of file
+Hello
+
+In Fench: Bonjour!
+
+Translation of "Hello" in French is "Bonjour".
+
+In Spanish: Hola!
+
+La traducción de "Hello" al español es "Hola".
diff --git a/tests/results/examples/tutorial/defs.1.result b/tests/results/examples/tutorial/defs.1.result
deleted file mode 100644
index d5ba84ddc..000000000
--- a/tests/results/examples/tutorial/defs.1.result
+++ /dev/null
@@ -1,2 +0,0 @@
-'J'aime Paris !'
-The translation of "I love Madrid!" into Spanish is: "Me encanta Madrid."
diff --git a/tests/results/examples/tutorial/function_call_in_jinja.0.result b/tests/results/examples/tutorial/function_call_in_jinja.0.result
new file mode 100644
index 000000000..1a43b5431
--- /dev/null
+++ b/tests/results/examples/tutorial/function_call_in_jinja.0.result
@@ -0,0 +1 @@
+The way to say hello in French is 'Bonjour'.
diff --git a/tests/results/examples/tutorial/function_call_in_jinja.1.result b/tests/results/examples/tutorial/function_call_in_jinja.1.result
new file mode 100644
index 000000000..81e61fd6f
--- /dev/null
+++ b/tests/results/examples/tutorial/function_call_in_jinja.1.result
@@ -0,0 +1 @@
+The way to say hello in French is Bonjour.
diff --git a/tests/results/examples/tutorial/function_definition.0.result b/tests/results/examples/tutorial/function_definition.0.result
index 2d4182036..e7122f0e9 100644
--- a/tests/results/examples/tutorial/function_definition.0.result
+++ b/tests/results/examples/tutorial/function_definition.0.result
@@ -1,2 +1,2 @@
-'J'aime Paris !'
-The translation of "I love Madrid!" into Spanish is: "Me encanta Madrid!"
\ No newline at end of file
+J'adore Paris !
+Me encanta Madrid!
\ No newline at end of file
diff --git a/tests/results/examples/tutorial/function_definition.3.result b/tests/results/examples/tutorial/function_definition.3.result
new file mode 100644
index 000000000..80159edaa
--- /dev/null
+++ b/tests/results/examples/tutorial/function_definition.3.result
@@ -0,0 +1,2 @@
+J'aime Paris !
+Amo Madrid!
\ No newline at end of file
diff --git a/tests/results/examples/tutorial/function_empty_context.0.result b/tests/results/examples/tutorial/function_empty_context.0.result
index 4901d530d..b80d21d4d 100644
--- a/tests/results/examples/tutorial/function_empty_context.0.result
+++ b/tests/results/examples/tutorial/function_empty_context.0.result
@@ -1 +1,2 @@
-Hello World!Greetings! I am Granite, a language model developed by IBM in 2024. How may I assist you today?
\ No newline at end of file
+J'aime Paris !
+Me encanta Madrid!
\ No newline at end of file
diff --git a/tests/results/examples/tutorial/function_empty_context.1.result b/tests/results/examples/tutorial/function_empty_context.1.result
index 348e9bbe6..e7122f0e9 100644
--- a/tests/results/examples/tutorial/function_empty_context.1.result
+++ b/tests/results/examples/tutorial/function_empty_context.1.result
@@ -1 +1,2 @@
-Hello World!Hello there! How can I assist you today? If you have any questions or need information on a particular topic, feel free to ask. I'm here to help.
\ No newline at end of file
+J'adore Paris !
+Me encanta Madrid!
\ No newline at end of file
diff --git a/tests/results/examples/tutorial/function_optional_params.0.result b/tests/results/examples/tutorial/function_optional_params.0.result
index f0f021368..000144d17 100644
--- a/tests/results/examples/tutorial/function_optional_params.0.result
+++ b/tests/results/examples/tutorial/function_optional_params.0.result
@@ -1 +1,2 @@
-Hello World Universe!
\ No newline at end of file
+Hello World!
+Hello Earth Planet!
\ No newline at end of file
diff --git a/tests/results/examples/tutorial/independent_docs.3.result b/tests/results/examples/tutorial/independent_docs.3.result
new file mode 100644
index 000000000..44f5a3f40
--- /dev/null
+++ b/tests/results/examples/tutorial/independent_docs.3.result
@@ -0,0 +1,10 @@
+Hello world!Goodbye world!Compare and contrast the above documents.The two texts provided are identical, as they both read "Hello world!" and "Goodbye world!". Since there's no difference in content or context, I can't perform a formal comparison and contrast based on distinct pieces of information. However, if we were to analyze them:
+
+1. Content: Both contain the same four words. The first text is an informal greeting, while the second text serves as an informal farewell.
+2. Tone: The tone in both instances is friendly and casual, reflecting a conversational style.
+3. Purpose: In "Hello world!", the purpose is to initiate or acknowledge someone's presence in a conversation. Conversely, "Goodbye world!" signals the end of a communication session or interaction.
+4. Context: Neither text provides any background information; they are standalone phrases meant for immediate use in conversations.
+5. Formality: Both are highly informal and lack any formal language features like complex sentences, punctuation for emphasis, or titles/names.
+6. Cultural Implications: These phrases are universally recognized as greetings and farewells across many cultures due to their simplicity and widespread use in digital communication.
+
+In summary, the two texts serve identical purposes but differ only by their intended direction of a conversation – one signals start (greeting), while the other signifies end (farewell).
\ No newline at end of file
diff --git a/tests/results/examples/tutorial/lastOf.0.result b/tests/results/examples/tutorial/lastOf.0.result
new file mode 100644
index 000000000..072eed5a2
--- /dev/null
+++ b/tests/results/examples/tutorial/lastOf.0.result
@@ -0,0 +1,3 @@
+Hello
+
+Greetings, I trust this message finds you in good health and high spirits. How may I be of assistance today? Please feel free to pose your query or request, knowing that I am here to serve with diligence and precision.
\ No newline at end of file
diff --git a/tests/results/examples/tutorial/lastOf.1.result b/tests/results/examples/tutorial/lastOf.1.result
new file mode 100644
index 000000000..a5acb19ab
--- /dev/null
+++ b/tests/results/examples/tutorial/lastOf.1.result
@@ -0,0 +1,3 @@
+Hello
+
+Greetings! I trust this message finds you in good health and high spirits. How may I be of assistance today? Please feel free to pose your query or request, knowing that I am here to serve with diligence and precision.
\ No newline at end of file
diff --git a/tests/results/examples/tutorial/local_computation.0.result b/tests/results/examples/tutorial/local_computation.0.result
new file mode 100644
index 000000000..956e25b97
--- /dev/null
+++ b/tests/results/examples/tutorial/local_computation.0.result
@@ -0,0 +1,2 @@
+Hello
+The variable GEN is equal to: Hello
\ No newline at end of file
diff --git a/tests/results/examples/tutorial/muting_block_output.0.result b/tests/results/examples/tutorial/muting_block_output.0.result
index 0701474bb..b015fe531 100644
--- a/tests/results/examples/tutorial/muting_block_output.0.result
+++ b/tests/results/examples/tutorial/muting_block_output.0.result
@@ -1 +1,5 @@
-The french sentence was: 'J'aime Paris !'
\ No newline at end of file
+Hello
+
+In Fench: Bonjour!
+
+Translation of "Hello" in French is "Bonjour".
diff --git a/tests/results/examples/tutorial/muting_block_output.1.result b/tests/results/examples/tutorial/muting_block_output.1.result
deleted file mode 100644
index 3d6699e99..000000000
--- a/tests/results/examples/tutorial/muting_block_output.1.result
+++ /dev/null
@@ -1 +0,0 @@
-The french sentence was: 'J'adore Paris !'
diff --git a/tests/results/examples/tutorial/programs/code/code-eval.3.result b/tests/results/examples/tutorial/programs/code/code-eval.3.result
new file mode 100644
index 000000000..b2537c05a
--- /dev/null
+++ b/tests/results/examples/tutorial/programs/code/code-eval.3.result
@@ -0,0 +1,38 @@
+
+@SuppressWarnings("unchecked")
+public static Map deserializeOffsetMap(String lastSourceOffset) throws IOException {
+  Map offsetMap;
+  if (lastSourceOffset == null || lastSourceOffset.isEmpty()) {    
+    offsetMap = new HashMap<>();  
+  } else {
+    offsetMap = JSON_MAPPER.readValue(lastSourceOffset, Map.class);  
+  }
+  return offsetMap;
+}
+
+The provided Java function `deserializeOffsetMap` is part of the StreamSets Data Collector (DC) codebase in the `stagesupport` package within the `com.../OffsetUtil.java` file. This function is designed to deserialize a JSON string containing offsets into a `Map` object. Here's an explanation of its purpose and functionality:
+
+1. **Purpose**: The primary goal of this method is to convert a JSON-formatted offset string (represented as `lastSourceOffset`) into a Java `Map` where keys are strings and values are also strings. This conversion allows for easier manipulation, storage, or further processing in the Data Collector application.
+
+2. **Parameters**:
+   - `lastSourceOffset`: A required parameter of type `String`, which is expected to contain JSON-formatted offset data.
+
+3. **Return Type**: The method returns a `Map`. This means it will return a map where each key and value are strings.
+
+4. **Throws**:
+   - `IOException`: In case the JSON string cannot be parsed due to an I/O error (e.g., network issues).
+
+5. **Logic**:
+
+   - The method first checks if `lastSourceOffset` is null or empty (`if (lastSourceOffset == null || lastSourceOffset.isEmpty())`). If true, it initializes a new `HashMap` called `offsetMap`.
+   - Otherwise, the function uses Jackson's JSON mapper (`JSON_MAPPER`) to deserialize the input string into a `Map`. This is done with `JSON_MAPPER.readValue(lastSourceOffset, Map.class)`.
+
+   - The deserialization process converts the JSON string into a Java map, where each key-value pair in the JSON will become an entry in the resulting map.
+
+6. **Security Note**: `@SuppressWarnings("unchecked")` is used to suppress potential warnings about unchecked casts. This is because `JSON_MAPPER.readValue()` returns a `Map`, and there's no need for explicit type casting here, as Java's auto-boxing mechanism handles the conversion from JSON keys/values to `String`.
+
+In summary, this function serves as an adapter between JSON offset data (in string format) and a standard Java map structure. It ensures that any provided offsets can be easily accessed or manipulated within the Data Collector application.
+
+EVALUATION:
+The similarity (Levenshtein) between this answer and the ground truth is:
+0.1991833030852994
\ No newline at end of file
diff --git a/tests/results/examples/tutorial/role.0.result b/tests/results/examples/tutorial/role.0.result
new file mode 100644
index 000000000..a71426c43
--- /dev/null
+++ b/tests/results/examples/tutorial/role.0.result
@@ -0,0 +1,3 @@
+Hello
+You are a polite assistant that likes to answer very formally.
+Greetings! I trust this message finds you in good health and high spirits. How may I be of assistance today? Please feel free to pose your query or request, knowing that I am here to serve with diligence and precision.
\ No newline at end of file
diff --git a/tests/results/examples/sdk/hello.0.result b/tests/results/examples/tutorial/sdk/hello.0.result
similarity index 100%
rename from tests/results/examples/sdk/hello.0.result
rename to tests/results/examples/tutorial/sdk/hello.0.result
diff --git a/tests/results/examples/tutorial/test.1.result b/tests/results/examples/tutorial/test.1.result
new file mode 100644
index 000000000..23ed6c1c0
--- /dev/null
+++ b/tests/results/examples/tutorial/test.1.result
@@ -0,0 +1,23 @@
+Without specific content from doc1 and doc2, I can't provide a detailed comparison. However, I can explain how you might compare two documents based on general principles:
+
+1. **Title/Headings**: Check if both documents have similar or identical headings to indicate their main topics.
+
+2. **Introduction and Conclusion**: Compare the introductions (if any) and conclusions of each document for a sense of purpose, scope, and summary.
+
+3. **Content Sections**: Look at how each document is divided into sections. Are they similar in terms of subtopics or main points?
+
+4. **Tone and Style**: Assess the tone (formal/informal, serious/casual) and style (narrative, descriptive, persuasive, etc.) used throughout both documents to gauge their intended audience and purpose.
+
+5. **Key Information**: Identify key points or facts that each document aims to convey. Do they cover the same topics? Are there any significant differences in how these topics are presented?
+
+6. **Structure**: Analyze if the structure of arguments, evidence, or data presentation is similar between the documents.
+
+7. **References/Sources**: If applicable, compare the sources cited by each document to see if they're using the same types of references and whether their sources align in terms of credibility and relevance.
+
+8. **Visual Elements (if any)**: For documents with images, charts, or diagrams, check for similarities in visual representation of information.
+
+9. **Length/Word Count**: Compare the overall length to get a sense of how much detail each document provides on its topic.
+
+10. **Date and Authorship (if available)**: If known, compare when each document was created or by whom. This can provide context for any differences in content or style.
+
+To perform this comparison effectively, you would need to have the actual text from doc1 and doc2. Once provided, these steps could be applied to analyze how they align or diverge on various aspects.[{{'role': 'user', 'content': 'doc1', 'pdl__defsite': 'text.defs.m1.message'},{'role': 'user', 'content': 'doc2', 'pdl__defsite': 'text.defs.m2.message'}},{'role': 'user', 'content': 'Compare the docs', 'pdl__defsite': 'text.defs.m3.message'}]
\ No newline at end of file
diff --git a/tests/results/examples/tutorial/variable_def_use.0.result b/tests/results/examples/tutorial/variable_def_use.0.result
index 72d411660..36f7aa6b0 100644
--- a/tests/results/examples/tutorial/variable_def_use.0.result
+++ b/tests/results/examples/tutorial/variable_def_use.0.result
@@ -1,3 +1,3 @@
 Hello
 Hello
-GEN is equal to: Hello
\ No newline at end of file
+The variable GEN is equal to: Hello
\ No newline at end of file
diff --git a/tests/results/pdl-live-react/src-tauri/tests/cli/model-input-array.2.result b/tests/results/pdl-live-react/src-tauri/tests/cli/model-input-array.2.result
new file mode 100644
index 000000000..4fd6b0a2a
--- /dev/null
+++ b/tests/results/pdl-live-react/src-tauri/tests/cli/model-input-array.2.result
@@ -0,0 +1,5 @@
+As an assistant living in Europe, I'd be happy to share that the fastest land animal native to this continent is actually the Greyhound dog breed. These dogs are renowned for their incredible speed and agility on the ground. They can reach top speeds of around 45-48 miles per hour (72-77 kilometers per hour), making them one of the fastest animals in Europe.
+
+However, if we consider wild animals, the Cheetah is the fastest land animal globally and can be found in parts of Africa, including regions near the European border with North African countries like Libya and Tunisia. Cheetahs typically reach speeds up to 60-70 miles per hour (97-113 kilometers per hour), but they are not native to Europe.
+
+For a truly European animal, the Greyhound remains the fastest land creature in our region.
\ No newline at end of file
diff --git a/tests/results/pdl-live-react/src-tauri/tests/cli/model-input-nested.2.result b/tests/results/pdl-live-react/src-tauri/tests/cli/model-input-nested.2.result
new file mode 100644
index 000000000..fbcb5dffb
--- /dev/null
+++ b/tests/results/pdl-live-react/src-tauri/tests/cli/model-input-nested.2.result
@@ -0,0 +1 @@
+{'role': 'user', 'content': 'answer as if you live in europe', 'pdl__defsite': 'text.0.message'}{'role': 'user', 'content': 'what is the fastest animal where i live?', 'pdl__defsite': 'text.1.text.0.message'}As an assistant living in Europe, I'd be happy to share that the fastest land animal native to this continent is actually the Greyhound dog breed. These dogs are renowned for their incredible speed and agility, capable of reaching top speeds of around 45-48 miles per hour (72-77 kilometers per hour). They were originally bred for hunting small game by sight rather than scent.
\ No newline at end of file
diff --git a/tests/results/pdl-live-react/src-tauri/tests/cli/model-input-nested.3.result b/tests/results/pdl-live-react/src-tauri/tests/cli/model-input-nested.3.result
new file mode 100644
index 000000000..7b93e38c9
--- /dev/null
+++ b/tests/results/pdl-live-react/src-tauri/tests/cli/model-input-nested.3.result
@@ -0,0 +1 @@
+{'role': 'user', 'content': 'answer as if you live in europe', 'pdl__defsite': 'text.0.message'}{'role': 'user', 'content': 'what is the fastest animal where i live?', 'pdl__defsite': 'text.1.text.0.message'}As an assistant living in Europe, I'd be happy to share that the fastest land animal native to this continent is actually the Greyhound. These dogs are renowned for their incredible speed and can reach top speeds of around 43-45 miles per hour (70 km/h). They were originally bred for hunting, particularly for their ability to chase down prey at high velocities.
\ No newline at end of file
diff --git a/tests/results/src/pdl/pdl_stdlib.0.result b/tests/results/src/pdl/pdl_stdlib.0.result
new file mode 100644
index 000000000..e69de29bb
diff --git a/tests/test_examples_run.py b/tests/test_examples_run.py
index fd62b39ff..cd4c1a9ba 100644
--- a/tests/test_examples_run.py
+++ b/tests/test_examples_run.py
@@ -102,8 +102,8 @@ class FailedResults:
     """
 
     wrong_results: Dict[str, str] = field(default_factory=lambda: {})
-    unexpected_parse_error: List[str] = field(default_factory=lambda: [])
-    unexpected_runtime_error: List[str] = field(default_factory=lambda: [])
+    unexpected_parse_error: Dict[str, str] = field(default_factory=lambda: {})
+    unexpected_runtime_error: Dict[str, str] = field(default_factory=lambda: {})
 
 
 # pylint: disable=too-many-instance-attributes
@@ -223,15 +223,17 @@ def __execute_file(self, pdl_file_name: str) -> None:
                 pdl_file_path,
                 scope=scope,
                 output="all",
-                config=pdl.InterpreterConfig(batch=0),
+                config=pdl.InterpreterConfig(batch=1),
             )
 
             exec_result.result = str(output["result"])
             exec_result.error_code = ExecutionErrorCode.NO_ERROR
             pdl.write_trace("/dev/null", output["trace"])
-        except PDLParseError:
+        except PDLParseError as exc:
+            exec_result.result = str(exc)
             exec_result.error_code = ExecutionErrorCode.PARSE_ERROR
-        except Exception:
+        except Exception as exc:
+            exec_result.result = str(exc)
             exec_result.error_code = ExecutionErrorCode.RUNTIME_ERROR
 
         self.execution_results[pdl_file_name] = exec_result
@@ -252,8 +254,8 @@ def validate_expected_and_actual(self) -> None:
         """
 
         wrong_result: Dict[str, str] = {}
-        unexpected_parse_error: List[str] = []
-        unexpected_runtime_error: List[str] = []
+        unexpected_parse_error: Dict[str, str] = {}
+        unexpected_runtime_error: Dict[str, str] = {}
 
         for file in self.check:
             if file not in self.skip:
@@ -264,9 +266,9 @@ def validate_expected_and_actual(self) -> None:
                 if not match:
                     # Check if actual results caused any error
                     if actual_result.error_code == ExecutionErrorCode.PARSE_ERROR:
-                        unexpected_parse_error.append(file)
+                        unexpected_parse_error[file] = str(actual_result.result)
                     elif actual_result.error_code == ExecutionErrorCode.RUNTIME_ERROR:
-                        unexpected_runtime_error.append(file)
+                        unexpected_runtime_error[file] = str(actual_result.result)
                     # If no error, then the results are wrong
                     else:
                         if actual_result.result is not None:
@@ -315,6 +317,26 @@ def test_example_runs(capsys: CaptureFixture[str], monkeypatch: MonkeyPatch) ->
     if background.update_results:
         background.write_results()
 
+    # Print the unexpected parse errors
+    for file, actual in background.failed_results.unexpected_parse_error.items():
+        print(
+            "\n============================================================================"
+        )
+        print(f"File that produced unexpected parse error: {file}")
+        print(
+            f"Error message:\n--------------------------------------------------------------\n{actual}\n-------------------------------------------------------------"
+        )
+
+    # Print the runtime errors
+    for file, actual in background.failed_results.unexpected_runtime_error.items():
+        print(
+            "\n============================================================================"
+        )
+        print(f"File that produced unexpected runtime error: {file}")
+        print(
+            f"Error message:\n--------------------------------------------------------------\n{actual}\n-------------------------------------------------------------"
+        )
+
     # Print the actual results for wrong results
     for file, actual in background.failed_results.wrong_results.items():
         print(
diff --git a/tests/test_examples_run.yaml b/tests/test_examples_run.yaml
index 9518039fa..c1bdbe372 100644
--- a/tests/test_examples_run.yaml
+++ b/tests/test_examples_run.yaml
@@ -1,8 +1,10 @@
 update_results: false
 check: []
 skip:
+  - examples/demos/react.pdl
   - examples/cldk/cldk-assistant.pdl
-  - examples/gsm8k/gsm8.pdl
+  - examples/gsm8k/gsm8k.pdl
+  - examples/gsm8k/gsm8k-loop-fission.pdl 
   - examples/gsm8k/gsm8k-plan.pdl
   - examples/gsm8k/gsm8k-plan-few-shots.pdl
   - examples/gsm8k/gsm8k-tot-few-shot.pdl
@@ -28,6 +30,16 @@ skip:
   - examples/optimizer/mbpp.pdl
   - examples/optimizer/fever.pdl
   - examples/optimizer/gsm8k.pdl
+  - examples/optimizer/grammar_correction.pdl
+  - examples/optimizer/optimized_grammar_correction.pdl
+  - examples/optimizer/eval_levenshtein.pdl
+  - examples/requirements/email.pdl
+  - examples/requirements/gsm8k.pdl
+  - examples/requirements/gsm8k_short.pdl
+  - examples/skeleton-of-thought/tips.pdl
+  - examples/tutorial/sdk/lib.pdl
+  - build/lib/pdl/pdl_stdlib.pdl
+
 with_inputs:
   examples/tutorial/programs/chatbot.pdl:
     stdin: |
@@ -110,3 +122,4 @@ expected_runtime_error:
   - tests/data/line/hello28.pdl
   - tests/data/line/hello29.pdl
   - tests/data/line/hello30.pdl
+  - tests/data/line/hello32.pdl
diff --git a/tests/test_fallback.py b/tests/test_fallback.py
index bc33cfbef..6bd3934b1 100644
--- a/tests/test_fallback.py
+++ b/tests/test_fallback.py
@@ -76,3 +76,15 @@ def test_type_checking_in_fallback():
         str(exc.value.message)
         == "Type errors during spec checking:\nline 4 - Error should be of type "
     )
+
+
+def test_fallback_and_parser():
+    prog_str = """
+model: "raise an error"
+parser: json
+spec: { xxx: string, age: integer}
+fallback:
+    data: { "xxx": "rosa", "age": 3 }
+"""
+    result = exec_str(prog_str)
+    assert result == {"xxx": "rosa", "age": 3}
diff --git a/tests/test_for.py b/tests/test_for.py
index b7a4b4b43..1d2abf76e 100644
--- a/tests/test_for.py
+++ b/tests/test_for.py
@@ -3,160 +3,391 @@
 from pdl.pdl import exec_dict, exec_str
 from pdl.pdl_interpreter import PDLRuntimeError
 
-for_data = {
-    "description": "For block example",
-    "text": [
-        {
-            "for": {
-                "i": [1, 2, 3, 4],
-            },
-            "repeat": "${ i }\n",
-        }
-    ],
-}
+
+def for_data(loop_kind):
+    return {
+        "description": "For block example",
+        "text": [
+            {
+                "for": {
+                    "i": [1, 2, 3, 4],
+                },
+                loop_kind: "${ i }\n",
+            }
+        ],
+    }
 
 
 def test_for_data():
-    text = exec_dict(for_data)
-    assert text == "1\n2\n3\n4\n"
+    for loop_kind in ["repeat", "map"]:
+        text = exec_dict(for_data(loop_kind))
+        assert text == "1\n2\n3\n4\n"
 
 
-for_data1 = {
-    "description": "For block example",
-    "text": [
-        {
-            "for": {"i": [1, 2, 3, 4], "name": ["A", "B", "C", "D"]},
-            "repeat": "${ i }: ${ name }\n",
-        }
-    ],
-}
+def for_data1(loop_kind):
+    return {
+        "description": "For block example",
+        "text": [
+            {
+                "for": {"i": [1, 2, 3, 4], "name": ["A", "B", "C", "D"]},
+                loop_kind: "${ i }: ${ name }\n",
+            }
+        ],
+    }
 
 
 def test_for_data1():
-    text = exec_dict(for_data1)
-    assert text == "1: A\n2: B\n3: C\n4: D\n"
-
-
-for_data2 = {
-    "description": "For block example",
-    "defs": {"ids": {"data": [5, 6, 7, 8]}},
-    "text": [
-        {
-            "for": {"i": [1, 2, 3, 4], "name": ["A", "B", "C", "D"], "id": "${ ids }"},
-            "repeat": "${ i }: ${ name }: ${ id }\n",
-        }
-    ],
-}
+    for loop_kind in ["repeat", "map"]:
+        text = exec_dict(for_data1(loop_kind))
+        assert text == "1: A\n2: B\n3: C\n4: D\n"
+
+
+def for_data2(loop_kind):
+    return {
+        "description": "For block example",
+        "defs": {"ids": {"data": [5, 6, 7, 8]}},
+        "text": [
+            {
+                "for": {
+                    "i": [1, 2, 3, 4],
+                    "name": ["A", "B", "C", "D"],
+                    "id": "${ ids }",
+                },
+                loop_kind: "${ i }: ${ name }: ${ id }\n",
+            }
+        ],
+    }
 
 
 def test_for_data2():
-    text = exec_dict(for_data2)
-    assert text == "1: A: 5\n2: B: 6\n3: C: 7\n4: D: 8\n"
-
-
-for_data3 = {
-    "description": "For block example",
-    "defs": {"ids": {"data": [5, 6]}},
-    "text": [
-        {
-            "for": {"i": [1, 2, 3, 4], "name": ["A", "B", "C", "D"], "id": "${ ids }"},
-            "repeat": "${ i }: ${ name }: ${ id }\n",
-            "join": {"as": "array"},
-        }
-    ],
-}
+    for loop_kind in ["repeat", "map"]:
+        text = exec_dict(for_data2(loop_kind))
+        assert text == "1: A: 5\n2: B: 6\n3: C: 7\n4: D: 8\n"
+
+
+def for_data3(loop_kind):
+    return {
+        "description": "For block example",
+        "defs": {"ids": {"data": [5, 6]}},
+        "text": [
+            {
+                "for": {
+                    "i": [1, 2, 3, 4],
+                    "name": ["A", "B", "C", "D"],
+                    "id": "${ ids }",
+                },
+                loop_kind: "${ i }: ${ name }: ${ id }\n",
+                "join": {"as": "array"},
+            }
+        ],
+    }
 
 
 def test_for_data3():
     with pytest.raises(PDLRuntimeError):
-        exec_dict(for_data3)
+        for loop_kind in ["repeat", "map"]:
+            exec_dict(for_data3(loop_kind))
 
 
-for_data4 = {
-    "description": "For block def",
-    "text": [
-        {
-            "def": "x",
-            "for": {"i": [1, 2, 3, 4]},
-            "repeat": "${ i + 1 }",
-            "join": {"as": "array"},
-        }
-    ],
-}
+def for_data4(loop_kind):
+    return {
+        "description": "For block def",
+        "text": [
+            {
+                "def": "x",
+                "for": {"i": [1, 2, 3, 4]},
+                loop_kind: "${ i + 1 }",
+                "join": {"as": "array"},
+            }
+        ],
+    }
 
 
 def test_for_data4():
-    result = exec_dict(for_data4, output="all")
-    assert result["result"] == "[2, 3, 4, 5]"
-    assert result["scope"]["x"] == [2, 3, 4, 5]
-
-
-for_as_text_data4 = {
-    "description": "For block def",
-    "text": [
-        {
-            "def": "x",
-            "for": {"i": [1, 2, 3, 4]},
-            "repeat": "${ i + 1 }",
-        }
-    ],
-}
+    for loop_kind in ["repeat", "map"]:
+        result = exec_dict(for_data4(loop_kind), output="all")
+        assert result["result"] == "[2, 3, 4, 5]"
+        assert result["scope"]["x"] == [2, 3, 4, 5]
+
+
+def for_as_text_data4(loop_kind):
+    return {
+        "description": "For block def",
+        "text": [
+            {
+                "def": "x",
+                "for": {"i": [1, 2, 3, 4]},
+                "repeat": "${ i + 1 }",
+            }
+        ],
+    }
 
 
 def test_for_as_text_data4():
-    result = exec_dict(for_as_text_data4, output="all")
-    assert result["result"] == "2345"
-    assert result["scope"]["x"] == "2345"
-
-
-for_data5 = {
-    "description": "For block def",
-    "text": [
-        {
-            "def": "x",
-            "text": {
-                "for": {"i": [1, 2, 3, 4]},
-                "repeat": "${ i }",
-                "join": {"as": "array"},
-            },
-        }
-    ],
-}
+    for loop_kind in ["repeat", "map"]:
+        result = exec_dict(for_as_text_data4(loop_kind), output="all")
+        assert result["result"] == "2345"
+        assert result["scope"]["x"] == "2345"
+
+
+def for_data5(loop_kind):
+    return {
+        "description": "For block def",
+        "text": [
+            {
+                "def": "x",
+                "text": {
+                    "for": {"i": [1, 2, 3, 4]},
+                    loop_kind: "${ i }",
+                    "join": {"as": "array"},
+                },
+            }
+        ],
+    }
 
 
 def test_for_data5():
-    result = exec_dict(for_data5, output="all")
-    assert result["result"] == "[1, 2, 3, 4]"
-    assert result["scope"]["x"] == "[1, 2, 3, 4]"
+    for loop_kind in ["repeat", "map"]:
+        result = exec_dict(for_data5(loop_kind), output="all")
+        assert result["result"] == "[1, 2, 3, 4]"
+        assert result["scope"]["x"] == "[1, 2, 3, 4]"
 
 
 def test_for_nested_array():
-    prog_str = """
+    for loop_kind in ["repeat", "map"]:
+        prog_str = f"""
 for:
     i: [1,2,3]
 repeat:
     for:
         j: [1,2]
-    repeat: "${i}${j}"
+    {loop_kind}: "${{i}}${{j}}"
     join:
         as: array
 join:
     as: array
 """
-    result = exec_str(prog_str)
-    assert result == [["11", "12"], ["21", "22"], ["31", "32"]]
+        result = exec_str(prog_str)
+        assert result == [["11", "12"], ["21", "22"], ["31", "32"]]
+
+
+def test_for_object():
+    for loop_kind in ["repeat", "map"]:
+        prog_str = f"""
+description: for loop creating an object
+defs:
+  numbers:
+    data: [1, 2, 3, 4]
+  names:
+    data: ["Bob", "Carol", "David", "Ernest"]
+for:
+  number: ${{ numbers }}
+  name: ${{ names }}
+{loop_kind}:
+  data:
+    ${{ name }}: ${{ number }}
+join:
+  as: object
+"""
+        result = exec_str(prog_str)
+        assert result == {"Bob": 1, "Carol": 2, "David": 3, "Ernest": 4}
 
 
 def test_for_nested_text():
-    prog_str = r"""
+    for loop_kind1 in ["repeat", "map"]:
+        for loop_kind2 in ["repeat", "map"]:
+            prog_str = f"""
 for:
     i: [1,2,3]
-repeat:
+{loop_kind1}:
     for:
         j: [1,2]
-    repeat: "${i}${j}"
+    {loop_kind2}: "${{i}}${{j}}"
 join:
-    with: "\n"
+    with: "\\n"
+"""
+            result = exec_str(prog_str)
+            assert result == "\n".join(["1112", "2122", "3132"])
+
+
+def for_scope(loop_kind):
+    return {
+        "defs": {"x": 0},
+        "text": {
+            "for": {"i": [1, 2, 3, 4]},
+            loop_kind: {"defs": {"x": "${ x + i }"}, "data": "${ i + x }"},
+            "join": {"as": "array"},
+        },
+    }
+
+
+def test_for_scope():
+    for loop_kind in ["repeat", "map"]:
+        result = exec_dict(for_scope(loop_kind), output="all")
+        match loop_kind:
+            case "repeat":
+                assert result["result"] == "[2, 5, 9, 14]"
+                assert result["scope"]["x"] == 10
+            case "map":
+                assert result["result"] == "[2, 4, 6, 8]"
+                assert result["scope"]["x"] == 0
+
+
+def for_index(loop_kind):
+    return {
+        "text": {
+            "index": "idx",
+            "for": {"i": [1, 2, 3, 4]},
+            loop_kind: "${ i + idx }",
+            "join": {"as": "array"},
+        },
+    }
+
+
+def test_for_index():
+    for loop_kind in ["repeat", "map"]:
+        result = exec_dict(for_index(loop_kind), output="all")
+        assert result["result"] == "[1, 3, 5, 7]"
+
+
+def for_context(loop_kind):
+    return {
+        "lastOf": [
+            "Hello",
+            {
+                "for": {
+                    "i": [
+                        1,
+                        2,
+                        3,
+                    ]
+                },
+                loop_kind: "${ pdl_context.serialize('litellm') }",
+                "join": {"as": "array"},
+            },
+        ]
+    }
+
+
+def test_for_context():
+    for loop_kind in ["repeat", "map"]:
+        result = exec_dict(for_context(loop_kind), output="all")
+        match loop_kind:
+            case "repeat":
+                assert result["result"] == [
+                    [{"role": "user", "content": "Hello", "pdl__defsite": "lastOf.0"}],
+                    [
+                        {
+                            "role": "user",
+                            "content": "Hello",
+                            "pdl__defsite": "lastOf.0",
+                        },
+                        {
+                            "role": "user",
+                            "content": [
+                                {
+                                    "role": "user",
+                                    "content": "Hello",
+                                    "pdl__defsite": "lastOf.0",
+                                }
+                            ],
+                            "pdl__defsite": "lastOf.1.repeat.0",
+                        },
+                    ],
+                    [
+                        {
+                            "role": "user",
+                            "content": "Hello",
+                            "pdl__defsite": "lastOf.0",
+                        },
+                        {
+                            "role": "user",
+                            "content": [
+                                {
+                                    "role": "user",
+                                    "content": "Hello",
+                                    "pdl__defsite": "lastOf.0",
+                                }
+                            ],
+                            "pdl__defsite": "lastOf.1.repeat.0",
+                        },
+                        {
+                            "role": "user",
+                            "content": [
+                                {
+                                    "role": "user",
+                                    "content": "Hello",
+                                    "pdl__defsite": "lastOf.0",
+                                },
+                                {
+                                    "role": "user",
+                                    "content": [
+                                        {
+                                            "role": "user",
+                                            "content": "Hello",
+                                            "pdl__defsite": "lastOf.0",
+                                        }
+                                    ],
+                                    "pdl__defsite": "lastOf.1.repeat.0",
+                                },
+                            ],
+                            "pdl__defsite": "lastOf.1.repeat.1",
+                        },
+                    ],
+                ]
+            case "map":
+                assert result["result"] == [
+                    [{"role": "user", "content": "Hello", "pdl__defsite": "lastOf.0"}],
+                    [{"role": "user", "content": "Hello", "pdl__defsite": "lastOf.0"}],
+                    [{"role": "user", "content": "Hello", "pdl__defsite": "lastOf.0"}],
+                ]
+
+
+def test_for_reduce():
+    for loop_kind1 in ["repeat", "map"]:
+        prog_str = f"""
+defs:
+  plus:
+    function:
+        x: number
+        y: number
+    return: ${{ x + y }}
+for:
+  i: [1,2,3,4]
+{loop_kind1}: ${{ i }}
+join:
+  reduce: ${{ plus }}
+"""
+        result = exec_str(prog_str)
+        assert result == 10
+
+
+def test_for_reduce_python():
+    for loop_kind1 in ["repeat", "map"]:
+        prog_str = f"""
+defs:
+  plus:
+    lang: python
+    code: |
+      import operator
+      result = operator.add
+for:
+  i: [1,2,3,4]
+{loop_kind1}: ${{ i }}
+join:
+  reduce: ${{ plus }}
+"""
+        result = exec_str(prog_str)
+        assert result == 10
+
+
+def test_map_max_workers():
+    for max_workers in [0, "null", 2, 4]:
+        prog_str = f"""
+for:
+  i: [1,2,3,4]
+map: ${{ i }}
+maxWorkers: {max_workers}
 """
-    result = exec_str(prog_str)
-    assert result == "\n".join(["1112", "2122", "3132"])
+        result = exec_str(prog_str)
+        assert result == "1234"
diff --git a/tests/test_function.py b/tests/test_function.py
index c2ce7ab48..a2c32ca5b 100644
--- a/tests/test_function.py
+++ b/tests/test_function.py
@@ -1,4 +1,4 @@
-from pdl.pdl import exec_dict, exec_file
+from pdl.pdl import exec_dict, exec_file, exec_str
 
 hello_def = {
     "def": "hello",
@@ -126,3 +126,134 @@ def test_call_expression_args():
         result
         == "FN::get_current_stock:: 'Simple call!'\n{'product_name': 'from_object'}\nFN::get_current_stock:: 'from_object'\n"
     )
+
+
+def test_call_from_code_01():
+    prog = """
+defs:
+  f:
+    function:
+      x:
+      y:
+    return:
+      ${x + y}
+array:
+- call: ${f}
+  args:
+    x: 1
+    y: 2
+- ${ f(x=1, y=2) }
+- lang: python
+  code:
+    result = f(x=1, y=2)
+"""
+    result = exec_str(prog)
+    assert result == [3, 3, 3]
+
+
+def test_call_from_code_02():
+    prog = """
+defs:
+  f:
+    function:
+    return:
+      ${pdl_context}
+lastOf:
+- Hello
+- context: independent
+  array:
+  - call: ${f}
+  - ${ f() }
+  - lang: python
+    code:
+      result = f()
+"""
+    result = exec_str(prog)
+    assert [ctx.serialize("litellm") for ctx in result] == [
+        [{"role": "user", "content": "Hello", "pdl__defsite": "lastOf.0"}],
+        [{"role": "user", "content": "Hello", "pdl__defsite": "lastOf.0"}],
+        [{"role": "user", "content": "Hello", "pdl__defsite": "lastOf.0"}],
+    ]
+
+
+def test_call_from_code_03():
+    prog = """
+defs:
+  f:
+    function:
+    return:
+      ${pdl_context}
+lastOf:
+- Hello
+- context: independent
+  array:
+  - call: ${f}
+    args:
+      pdl_context: []
+  - ${ f(pdl_context=[]) }
+  - lang: python
+    code:
+      result = f(pdl_context=[])
+"""
+    result = exec_str(prog)
+    assert [ctx.serialize("litellm") for ctx in result] == [
+        [],
+        [],
+        [],
+    ]
+
+
+def test_call_from_code_04():
+    prog = """
+defs:
+  f:
+    function:
+    return:
+      lastOf:
+      - How are you?
+      - Bye
+lastOf:
+- Hello
+- context: independent
+  array:
+  - text:
+    - call: ${f}
+    - ${pdl_context}
+  - text:
+    - ${f()}
+    - ${pdl_context}
+  - text:
+    - lang: python
+      code:
+        result = f()
+    - ${pdl_context}
+"""
+    result = exec_str(prog)
+    assert result == [
+        "Bye[{'role': 'user', 'content': 'Hello', 'pdl__defsite': 'lastOf.0'},{'role': 'user', 'content': 'How are you?', 'pdl__defsite': 'lastOf.1.array.0.text.0.call.lastOf.0'},{'role': 'user', 'content': 'Bye', 'pdl__defsite': 'lastOf.1.array.0.text.0.call.lastOf.1'}]",
+        "Bye[{'role': 'user', 'content': 'Hello', 'pdl__defsite': 'lastOf.0'},{'role': 'user', 'content': 'Bye', 'pdl__defsite': 'lastOf.1.array.1.text.0'}]",
+        "Bye[{'role': 'user', 'content': 'Hello', 'pdl__defsite': 'lastOf.0'},{'role': 'user', 'content': 'Bye', 'pdl__defsite': 'lastOf.1.array.2.text.0.code'}]",
+    ]
+
+
+def test_call_from_code_05():
+    prog = """
+defs:
+  f:
+    function:
+      x:
+      y:
+    return:
+      ${x - y}
+array:
+- call: ${f}
+  args:
+    x: 2
+    y: 1
+- ${ f(2, 1) }
+- lang: python
+  code:
+    result = f(2, 1)
+"""
+    result = exec_str(prog)
+    assert result == [1, 1, 1]
diff --git a/tests/test_line_table.py b/tests/test_line_table.py
index 4e1e24642..9c63d1670 100644
--- a/tests/test_line_table.py
+++ b/tests/test_line_table.py
@@ -44,8 +44,8 @@ def test_line1(capsys: CaptureFixture[str]):
     "file": "tests/data/line/hello3.pdl",
     "errors": [
         "",
-        "tests/data/line/hello3.pdl:6 - Type errors during spec checking:",
-        "tests/data/line/hello3.pdl:6 -  World! should be of type ",
+        "tests/data/line/hello3.pdl:7 - Type errors during spec checking:",
+        "tests/data/line/hello3.pdl:7 -  World! should be of type ",
     ],
 }
 
@@ -100,8 +100,8 @@ def test_line8(capsys: CaptureFixture[str]):
     "file": "tests/data/line/hello9.pdl",
     "errors": [
         "",
-        "tests/data/line/hello9.pdl:3 - Type errors during spec checking:",
-        "tests/data/line/hello9.pdl:3 - hello should be of type ",
+        "tests/data/line/hello9.pdl:4 - Type errors during spec checking:",
+        "tests/data/line/hello9.pdl:4 - hello should be of type ",
     ],
 }
 
@@ -140,8 +140,8 @@ def test_line11(capsys: CaptureFixture[str]):
     "file": "tests/data/line/hello12.pdl",
     "errors": [
         "",
-        "tests/data/line/hello12.pdl:9 - Type errors during spec checking:",
-        "tests/data/line/hello12.pdl:9 - How are you? should be of type ",
+        "tests/data/line/hello12.pdl:11 - Type errors during spec checking:",
+        "tests/data/line/hello12.pdl:11 - How are you? should be of type ",
     ],
 }
 
@@ -154,8 +154,8 @@ def test_line12(capsys: CaptureFixture[str]):
     "file": "tests/data/line/hello13.pdl",
     "errors": [
         "",
-        "tests/data/line/hello13.pdl:9 - Type errors during spec checking:",
-        "tests/data/line/hello13.pdl:9 - 1 should be of type ",
+        "tests/data/line/hello13.pdl:12 - Type errors during spec checking:",
+        "tests/data/line/hello13.pdl:12 - 1 should be of type ",
     ],
 }
 
@@ -168,8 +168,8 @@ def test_line13(capsys: CaptureFixture[str]):
     "file": "tests/data/line/hello14.pdl",
     "errors": [
         "",
-        "tests/data/line/hello14.pdl:25 - Type errors in result of function call to ${ translate }:",
-        "tests/data/line/hello14.pdl:25 - Bonjour le monde! should be of type ",
+        "tests/data/line/hello14.pdl:16 - Type errors in result of the function translate:",
+        "tests/data/line/hello14.pdl:16 - Bonjour le monde! should be of type ",
     ],
 }
 
@@ -195,8 +195,8 @@ def test_line15(capsys: CaptureFixture[str]):
     "file": "tests/data/line/hello16.pdl",
     "errors": [
         "",
-        "tests/data/line/hello16.pdl:8 - Type errors during spec checking:",
-        "tests/data/line/hello16.pdl:8 - 30 should be of type ",
+        "tests/data/line/hello16.pdl:10 - Type errors during spec checking:",
+        "tests/data/line/hello16.pdl:10 - 30 should be of type ",
     ],
 }
 
@@ -209,8 +209,8 @@ def test_line16(capsys: CaptureFixture[str]):
     "file": "tests/data/line/hello17.pdl",
     "errors": [
         "",
-        "tests/data/line/hello17.pdl:3 - Type errors during spec checking:",
-        "tests/data/line/hello17.pdl:3 - hello should be of type ",
+        "tests/data/line/hello17.pdl:4 - Type errors during spec checking:",
+        "tests/data/line/hello17.pdl:4 - hello should be of type ",
     ],
 }
 
@@ -405,3 +405,17 @@ def test_line30(capsys: CaptureFixture[str]):
 
 def test_line31(capsys: CaptureFixture[str]):
     do_test(line31, capsys)
+
+
+line32 = {
+    "file": "tests/data/line/hello32.pdl",
+    "errors": [
+        "",
+        "tests/data/line/hello32.pdl:4 - Type errors during spec checking:",
+        "tests/data/line/hello32.pdl:4 - 1 should be of type ",
+    ],
+}
+
+
+def test_line32(capsys: CaptureFixture[str]):
+    do_test(line32, capsys)
diff --git a/tests/test_optimizer.py b/tests/test_optimizer.py
index 76c5ed7ad..4ceef96e0 100644
--- a/tests/test_optimizer.py
+++ b/tests/test_optimizer.py
@@ -2,7 +2,8 @@
 from pprint import pprint
 
 import pytest
-from datasets import Dataset, DatasetDict
+from datasets.arrow_dataset import Dataset
+from datasets.dataset_dict import DatasetDict
 
 from examples.optimizer.fever_evaluator import FEVEREvaluator
 from examples.optimizer.gsm8k_evaluator import Gsm8kEvaluator
@@ -16,11 +17,14 @@ def test_gsm8k_cot():
     pattern = "cot"
     num_demonstrations = 3
     config = OptimizationConfig(
-        benchmark="gsm8k",
-        initial_test_set_size=1,
+        pdl_path="tests/data/optimizer_gsm8k.pdl",
+        dataset="gsm8k",
+        demonstration_columns=["question", "reasoning", "answer"],
+        instance_columns=["question", "reasoning"],
+        groundtruth_column="answer",
+        initial_validation_set_size=1,
         max_test_set_size=1,
         num_candidates=5,
-        num_demonstrations=num_demonstrations,
         parallelism=1,
         shuffle_test=False,
         test_set_name="test",
@@ -348,7 +352,6 @@ def test_gsm8k_cot():
         },
     )
     optim = PDLOptimizer(
-        pdl_path=Path("tests/data/optimizer_gsm8k.pdl"),
         dataset=gsm8k,
         trial_thread=Gsm8kEvaluator,
         yield_output=True,
@@ -374,11 +377,14 @@ def test_gsm8k_cot():
 
 def run_optimizer_gsm8k(pattern, num_demonstrations=0):
     config = OptimizationConfig(
-        benchmark="gsm8k",
-        initial_test_set_size=1,
+        pdl_path="tests/data/optimizer_gsm8k.pdl",
+        dataset="gsm8k",
+        demonstration_columns=["question", "reasoning", "answer"],
+        instance_columns=["question", "reasoning"],
+        groundtruth_column="answer",
+        initial_validation_set_size=1,
         max_test_set_size=1,
         num_candidates=1,
-        num_demonstrations=num_demonstrations,
         parallelism=1,
         shuffle_test=False,
         test_set_name="test",
@@ -707,7 +713,6 @@ def run_optimizer_gsm8k(pattern, num_demonstrations=0):
         },
     )
     optim = PDLOptimizer(
-        pdl_path=Path("examples/optimizer/gsm8k.pdl"),
         dataset=gsm8k,
         trial_thread=Gsm8kEvaluator,
         yield_output=True,
@@ -723,11 +728,22 @@ def run_optimizer_gsm8k(pattern, num_demonstrations=0):
 
 def run_optimizer_fever(pattern, num_demonstrations=0):
     config = OptimizationConfig(
-        benchmark="fever",
-        initial_test_set_size=1,
+        pdl_path="examples/optimizer/fever.pdl",
+        dataset="fever",
+        demonstration_columns=[
+            "question",
+            "reasoning",
+            "reasoning",
+            "traj_keys",
+            "traj_values",
+            "rewoo_traj_keys",
+            "rewoo_traj_values",
+        ],
+        instance_columns=["claim"],
+        groundtruth_column="label",
+        initial_validation_set_size=1,
         max_test_set_size=1,
         num_candidates=1,
-        num_demonstrations=num_demonstrations,
         parallelism=1,
         shuffle_test=False,
         test_set_name="test",
@@ -1063,7 +1079,6 @@ def run_optimizer_fever(pattern, num_demonstrations=0):
     )
 
     optim = PDLOptimizer(
-        pdl_path=Path("examples/optimizer/fever.pdl"),
         dataset=fever,  # pyright: ignore
         trial_thread=FEVEREvaluator,
         yield_output=True,
@@ -1079,11 +1094,18 @@ def run_optimizer_fever(pattern, num_demonstrations=0):
 
 def run_optimizer_mbpp(pattern, num_demonstrations=0):
     config = OptimizationConfig(
-        benchmark="mbpp",
-        initial_test_set_size=1,
+        pdl_path="examples/optimizer/mbpp.pdl",
+        dataset="mbpp",
+        demonstration_columns=[
+            "prompt",
+            "traj_keys",
+            "traj_values",
+        ],
+        instance_columns=["claim"],
+        groundtruth_column="canonical_solution",
+        initial_validation_set_size=1,
         max_test_set_size=1,
         num_candidates=1,
-        num_demonstrations=num_demonstrations,
         parallelism=1,
         shuffle_test=False,
         test_set_name="test",
@@ -1102,7 +1124,6 @@ def run_optimizer_mbpp(pattern, num_demonstrations=0):
     )
 
     optim = PDLOptimizer(
-        pdl_path=Path("examples/optimizer/mbpp.pdl"),
         dataset=mbpp_dataset,  # pyright: ignore
         trial_thread=MBPPEvaluator,
         yield_output=True,
diff --git a/tests/test_role.py b/tests/test_role.py
index b13f096cc..5ab0a4958 100644
--- a/tests/test_role.py
+++ b/tests/test_role.py
@@ -2,8 +2,47 @@
 from pdl.pdl_context import SerializeMode
 
 
+def test_role0():
+    prog_str = """
+Hello
+"""
+    result = exec_str(prog_str, output="all")
+    assert result["result"] == "Hello"
+    scope = result["scope"]
+    assert scope["pdl_context"].serialize(SerializeMode.LITELLM) == [
+        {"role": "user", "content": "Hello", "pdl__defsite": ""},
+    ]
+
+
 def test_role1():
     prog_str = """
+text:
+- Hello
+"""
+    result = exec_str(prog_str, output="all")
+    assert result["result"] == "Hello"
+    scope = result["scope"]
+    assert scope["pdl_context"].serialize(SerializeMode.LITELLM) == [
+        {"role": "user", "content": "Hello", "pdl__defsite": "text.0"},
+    ]
+
+
+def test_role2():
+    prog_str = """
+text:
+- Hello
+role: A
+"""
+    result = exec_str(prog_str, output="all")
+    assert result["result"] == "Hello"
+    scope = result["scope"]
+    assert scope["pdl_context"].serialize(SerializeMode.LITELLM) == [
+        {"role": "A", "content": "Hello", "pdl__defsite": "text.0"},
+    ]
+
+
+def test_role3():
+    prog_str = """
 description: Test role
 text:
 - defs:
diff --git a/tests/test_runtime_errors.py b/tests/test_runtime_errors.py
index 52f91414e..a4e9a0df8 100644
--- a/tests/test_runtime_errors.py
+++ b/tests/test_runtime_errors.py
@@ -79,7 +79,7 @@ def test_type_result():
         exec_str(prog_str)
     assert (
         str(exc.value.message)
-        == "Type errors during spec checking:\nline 0 - Hello should be of type "
+        == "Type errors during spec checking:\nline 3 - Hello should be of type "
     )