Skip to content

Commit 8341344

Browse files
authored
fixes to react examples (#859)
Signed-off-by: Mandana Vaziri <[email protected]>
1 parent 44db33a commit 8341344

File tree

5 files changed

+35
-23
lines changed

5 files changed

+35
-23
lines changed

examples/demo/1-hello.pdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ text:
44
- model: ollama_chat/granite3.2:2b
55
parameters:
66
stop: ["!"]
7-
# include_stop_sequence: true
7+
88

examples/demo/9-react.pdl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,18 @@ text:
5959
<tool_call>[{"name": "Finish", "arguments": {"topic": "1,800 to 7,000 ft"}}]
6060
contribute: [context]
6161

62-
- "How many years ago was the discoverer of the Hudson River born? Keep in mind we are in 2025.\n"
62+
- "How many years ago was the discoverer of the Hudson River born? Keep in mind we are in 2025. When searching for a birthday for a person, simply ask for the name of that person.\n"
6363
- repeat:
6464
text:
6565
- def: thought
6666
model: ollama_chat/granite3.2:8b
6767
parameters:
68-
stop_sequences: "Action:"
68+
stop: ["Action:"]
6969
- "Action:\n"
7070
- def: action
7171
model: ollama_chat/granite3.2:8b
7272
parameters:
73-
stop_sequences: "\n"
73+
stop: ["\n"]
7474
parser: json
7575
- "\nObservation: "
7676
- match: ${ action[0].name }

examples/react/demo.pdl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,18 @@ text:
5959
<tool_call>[{"name": "Finish", "arguments": {"topic": "1,800 to 7,000 ft"}}]
6060
contribute: [context]
6161

62-
- "How many years ago was the discoverer of the Hudson River born? Keep in mind we are in 2025.\n"
62+
- "How many years ago was the discoverer of the Hudson River born? Keep in mind we are in 2025. When searching for a birthday for a person, simply ask for the name of that person.\n"
6363
- repeat:
6464
text:
6565
- def: thought
6666
model: ollama_chat/granite3.2:8b
6767
parameters:
68-
stop_sequences: "Action:"
68+
stop: ["Action:"]
6969
- "Action:\n"
7070
- def: action
7171
model: ollama_chat/granite3.2:8b
7272
parameters:
73-
stop_sequences: "\n"
73+
stop: ["\n"]
7474
parser: json
7575
- match: ${ action[0].name }
7676
with:

examples/react/react_call.pdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ text:
44
def: lib
55
- call: ${ lib.react }
66
args:
7-
question: How many years ago was the discoverer of the Hudson River born? Keep in mind we are in 2025.
7+
question: "How many years ago was the discoverer of the Hudson River born? Keep in mind we are in 2025. When searching avoid using the words discovery or birthday.\n"
88
model: ollama_chat/granite3.2:8b
99

1010

examples/react/react_fun.pdl

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,35 @@ defs:
1010
- defs:
1111
tools:
1212
data:
13-
- name: Calc
14-
description: Calculator function
15-
arguments:
16-
expr:
17-
type: string
18-
description: Arithmetic expression to calculate
19-
- name: Search
20-
description: Wikipedia search
21-
arguments:
22-
topic:
23-
type: string
24-
description: Topic to search
13+
- type: function
14+
function:
15+
name: Calc
16+
description: Calculator function
17+
parameters:
18+
type: object
19+
properties:
20+
expr:
21+
type: string
22+
description: Arithmetic expression to calculate
23+
required:
24+
- expr
25+
- type: function
26+
function:
27+
name: Search
28+
description: Wikipedia search
29+
parameters:
30+
type: object
31+
properties:
32+
topic:
33+
type: string
34+
description: Topic to search
35+
required:
36+
- topic
2537
- for:
2638
ex: ${ examples }
2739
repeat:
2840
"${ ex }\n"
29-
- "\n"
41+
contribute: [context]
3042
- ${ question }
3143
- "\n"
3244
- role: system
@@ -47,13 +59,13 @@ defs:
4759
model: ${ model }
4860
parameters:
4961
temperature: 0
50-
stop_sequences: "Action:"
62+
stop: ["Action:"]
5163
- "Action:\n"
5264
- def: action
5365
model: ${ model }
5466
parameters:
5567
temperature: 0
56-
stop_sequences: "\n"
68+
stop: ["\n"]
5769
parser: json
5870
- if: ${ action != prev_action}
5971
then:

0 commit comments

Comments
 (0)