Skip to content

Commit 5533a0e

Browse files
committed
Add an example of messages
1 parent 14091d5 commit 5533a0e

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

docs/tutorial.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ Le mot 'world' en français est 'monde'.
6565
```
6666
where everything after the `:` including it were generated by the model.
6767

68+
69+
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)):
70+
```yaml
71+
--8<-- "./examples/tutorial/calling_llm_with_input_messages.pdl"
72+
```
73+
6874
### Parameter defaults for watsonx Granite models
6975

7076
PDL provides the following defaults for watsonx Granite models, when the following parameters are missing:

examples/tutorial/calling_llm_with_input.pdl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ text:
44
- model: watsonx/ibm/granite-20b-multilingual
55
input:
66
Translate the word 'world' to French
7-
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
description: Hello world calling a model
2+
text:
3+
- "Hello, "
4+
- model: watsonx/ibm/granite-20b-multilingual
5+
input:
6+
array:
7+
- role: system
8+
content: You are a helpful assistant that is fluent in French.
9+
- role: user
10+
content: Translate the word 'world' to French

0 commit comments

Comments
 (0)