You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/autopdl.md
+14-2Lines changed: 14 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,13 +64,12 @@ Let's go through an example for `GSM8K`. Our PDL program uses different prompt p
64
64
--8<-- "./examples/optimizer/gsm8k.pdl"
65
65
```
66
66
67
-
We write a configuration file for the optimizer, and save it as `gsm8k_optimizer_config.yml`. See `src/pdl/optimize/config_parser.py` for all fields.
67
+
We write a configuration file for the optimizer, and save it as `gsm8k_optimizer_config.yml`. See `src/pdl/optimize/config_parser.py` for all fields. Please note that this example uses the `watsonx` inference service, so an API key is required, although you can also use a local model or any other inference service.
Note that it is not unusual to observe PDL exceptions during the optimization process.
176
+
177
+
```text
178
+
[15:44:14] Type errors during spec checking:
179
+
../../contrib/prompt_library/ReAct.pdl:0 - should be an object
180
+
../../contrib/prompt_library/ReAct.pdl:0 - Type errors during spec checking:
181
+
../../contrib/prompt_library/ReAct.pdl:0 - should be an object
182
+
Retrying: False
183
+
Runtime FAILED and took seconds: 10.21
184
+
```
185
+
186
+
Such exceptions, here for example in `ReAct.pdl`, are caused by the _typed_ model call in `ReAct.pdl:98`. If the model output does not result in a parsable JSON that matches the expected type `{ name: string, arguments: object }`, the PDL interpreter raises an exception.
187
+
176
188
Once the process is complete, a file `optimized_gsm8k.pdl` is written in same directory as the source PDL file. 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.
0 commit comments