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/tutorial.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -695,7 +695,7 @@ can also contain either a string, or a block, or a list (and similarly for `else
695
695
The chatbot keeps looping by making a call to a model, asking the user if the generated text is a good answer,
696
696
and asking `why not?` if the answer (stored in variable `eval`) is `no`. The loop ends when `eval` becomes `yes`. This is specified with a Jinja expression on line 18.
697
697
698
-
Notice that the `repeat` and `then` blocks are followed by `text`. This is because of the semantics of lists in PDL. If we want to aggregate the result by stringifying every element in the list and collating them together, then we need the keyword `text` to precede a list. The number of iterations of a loop can be bounded by adding a `max_iterations` field.
698
+
Notice that the `repeat` and `then` blocks are followed by `text`. This is because of the semantics of lists in PDL. If we want to aggregate the result by stringifying every element in the list and collating them together, then we need the keyword `text` to precede a list. The number of iterations of a loop can be bounded by adding a `maxIterations` field.
699
699
700
700
The way that the result of each iteration is collated with other iterations can be customized in PDL using
701
701
the `join` feature (see the following section).
@@ -804,14 +804,14 @@ The following example shows a while loop in PDL:
804
804
805
805
The `while` field indicates the looping condition and `repeat` contains the body of the loop.
806
806
807
-
This loop can be rewritten using `max_iterations` to bound the number of iterations and `index` to name the iteration number.
807
+
This loop can be rewritten using `maxIterations` to bound the number of iterations and `index` to name the iteration number.
808
808
809
809
```yaml
810
810
--8<-- "./examples/tutorial/loop_index.pdl"
811
811
```
812
812
813
813
814
-
Notice that `for`, `while`, `until`, and `max_iterations` can all be combined in the same `repeat` block. The loop exits as soon as one of the exit conditions is satisfied:
814
+
Notice that `for`, `while`, `until`, and `maxIterations` can all be combined in the same `repeat` block. The loop exits as soon as one of the exit conditions is satisfied:
0 commit comments