Skip to content

Commit c5b9013

Browse files
authored
Tutorial updates (#152)
* changes to tutorial Signed-off-by: Mandana Vaziri <[email protected]> * tutorial updates Signed-off-by: Mandana Vaziri <[email protected]> * cleanup Signed-off-by: Mandana Vaziri <[email protected]> * update tutorial Signed-off-by: Mandana Vaziri <[email protected]> --------- Signed-off-by: Mandana Vaziri <[email protected]>
1 parent 70d90ec commit c5b9013

File tree

8 files changed

+228
-164
lines changed

8 files changed

+228
-164
lines changed

docs/tutorial.md

Lines changed: 207 additions & 74 deletions
Large diffs are not rendered by default.

examples/arith/example1.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

examples/arith/example2.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

examples/chatbot/chatbot.pdl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ description: chatbot
22
text:
33
- read:
44
message: "What is your query?\n"
5+
contribute: [context]
56
- repeat:
67
text:
78
- model: watsonx/ibm/granite-13b-chat-v2
@@ -15,7 +16,7 @@ text:
1516
- read:
1617
message: "Why not?\n"
1718
until: ${ eval == 'yes'}
18-
role: user
19+
1920

2021

2122

Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,18 @@
1-
description: Math Problems
1+
description: chatbot
22
text:
3-
- read: ./example1.txt
4-
- read: ./example2.txt
3+
- read:
4+
message: "What is your query?\n"
5+
contribute: [context]
56
- repeat:
67
text:
7-
- "\nQuestion: "
8-
- def: QUESTION
9-
model: watsonx/ibm/granite-34b-code-instruct
10-
parameters:
11-
stop:
12-
- Answer
13-
- "?"
14-
include_stop_sequence: true
15-
- "\nAnswer: Let's think step by step.\n"
16-
- repeat:
8+
- model: watsonx/ibm/granite-13b-chat-v2
9+
- read:
10+
def: eval
11+
message: "\nIs this a good answer[yes/no]?\n"
12+
contribute: []
13+
- if: ${ eval == 'no' }
14+
then:
1715
text:
18-
- def: REASON_OR_CALC
19-
model: watsonx/ibm/granite-34b-code-instruct
20-
parameters:
21-
stop:
22-
- '<<'
23-
- "Question"
24-
include_stop_sequence: true
25-
- if: ${ REASON_OR_CALC.endswith("<<") }
26-
then:
27-
text:
28-
- def: EXPR
29-
model: watsonx/ibm/granite-34b-code-instruct
30-
parameters:
31-
stop:
32-
- '='
33-
- "\n"
34-
- "Question"
35-
include_stop_sequence: false
36-
- '= '
37-
- def: RESULT
38-
lang: python
39-
code: result = ${ EXPR }
40-
- ' >>'
41-
until: ${ "The answer is" in REASON_OR_CALC }
42-
- "\n\n"
43-
num_iterations: 3
16+
- read:
17+
message: "Why not?\n"
18+
until: ${ eval == 'yes'}

examples/tutorial/data_block_raw.pdl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
description: raw data block
2+
data:
3+
name: ${ name }
4+
phone: ${ phone }
5+
raw: True

examples/tutorial/example1.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

examples/tutorial/example2.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)