Skip to content

Commit 49b138e

Browse files
committed
Update tutorial
1 parent 5533a0e commit 49b138e

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

docs/tutorial.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,12 @@ The user can override these defaults by explicitly including them in the model c
9090

9191
## Variable Definition and Use
9292

93-
Any block can have a variable definition using a `def: <var>` field. This means that the output of that block is assigned to the variable `<var>`, which may be reused at a later point in the document.
93+
Any block can define a variable using a `def: <var>` field. This means that the output of that block is assigned to the variable `<var>`, which may be reused at a later point in the document.
9494

9595
Consider the following example ([file](https://github.com/IBM/prompt-declaration-language//blob/main/examples/tutorial/variable_def_use.pdl)):
9696

9797
```yaml
98-
description: Hello world with variable def and use
99-
text:
100-
- Hello,
101-
- model: watsonx/ibm/granite-34b-code-instruct
102-
def: GEN
103-
parameters:
104-
decoding_method: greedy
105-
stop:
106-
- '!'
107-
include_stop_sequence: true
108-
- "\nGEN is equal to: ${ GEN }"
98+
--8<-- "./examples/tutorial/variable_def_use.pdl"
10999
```
110100

111101
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.

0 commit comments

Comments
 (0)