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
Obs: The Colorado orogeny was an episode of mountain building (an orogeny) ...
7
-
Tho: It does not mention the eastern sector. So I need to look up eastern sector.
8
-
Tho: High Plains rise in elevation from around 1,800 to 7,000 ft, so the answer is 1,800 to 7,000 ft.
9
-
Act: {"name": "Finish", "arguments": {"topic": "1,800 to 7,000 ft"}}
29
+
- role: system
30
+
text: You are a helpful assistant with access to the following function calls. Your task is to produce a sequence of function calls necessary to generate response to the user utterance. Use the following function calls as required.
31
+
contribute: [context]
32
+
- role: available_tools
33
+
text: ${ tools }
34
+
contribute: [context]
35
+
- text:
36
+
|
37
+
What profession does Nicholas Ray and Elia Kazan have in common?
38
+
Tho: I need to search Nicholas Ray and Elia Kazan, find their professions, then find the profession they have in common.
Obs: Nicholas Ray (born Raymond Nicholas Kienzle Jr., August 7, 1911 - June 16, 1979) was an American film director, screenwriter, and actor best known for the 1955 film Rebel Without a Cause.
42
+
Tho: Professions of Nicholas Ray are director, screenwriter, and actor. I need to search Elia Kazan next and find his professions.
Obs: Elia Kazan was an American film and theatre director, producer, screenwriter and actor.
46
+
Tho: Professions of Elia Kazan are director, producer, screenwriter, and actor. So profession Nicholas Ray and Elia Kazan have in common is director, screenwriter, and actor.
Obs: Nicholas Ray (born Raymond Nicholas Kienzle Jr., August 7, 1911 - June 16, 1979) was an American film director, screenwriter, and actor best known for the 1955 film Rebel Without a Cause.
15
-
Tho: Professions of Nicholas Ray are director, screenwriter, and actor. I need to search Elia Kazan next and find his professions.
Obs: Elia Kazan was an American film and theatre director, producer, screenwriter and actor.
18
-
Tho: Professions of Elia Kazan are director, producer, screenwriter, and actor. So profession Nicholas Ray and Elia Kazan have in common is director, screenwriter, and actor.
Copy file name to clipboardExpand all lines: examples/react/react_fun.pdl
+47-49Lines changed: 47 additions & 49 deletions
Original file line number
Diff line number
Diff line change
@@ -7,13 +7,46 @@ defs:
7
7
model: str
8
8
return:
9
9
text:
10
+
- defs:
11
+
tools:
12
+
data:
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
10
37
- for:
11
38
ex: ${ examples }
12
39
repeat:
13
40
"${ ex }\n"
14
41
- "\n"
15
42
- ${ question }
16
43
- "\n"
44
+
- role: system
45
+
text: You are a helpful assistant with access to the following function calls. Your task is to produce a sequence of function calls necessary to generate response to the user utterance. Use the following function calls as required.
46
+
contribute: [context]
47
+
- role: available_tools
48
+
text: ${ tools }
49
+
contribute: [context]
17
50
- def: prev_action
18
51
contribute: []
19
52
data: none
@@ -26,24 +59,16 @@ defs:
26
59
model: ${ model }
27
60
parameters:
28
61
stop_sequences: "Act:"
29
-
temperature: 0
30
-
- def: rawAction
62
+
- "Act:\n"
63
+
- def: action
31
64
model: ${ model }
32
65
parameters:
33
66
stop_sequences: "\n"
34
-
temperature: 0
35
-
- def: action
36
-
lang: python
37
67
parser: json
38
-
spec: {name: str, arguments: obj}
39
-
contribute: [context]
40
-
code:
41
-
|
42
-
result = '${ rawAction }'.replace("Act: ", "")
43
-
- if: ${ action != prev_action}
68
+
- if: ${ action != prev_action}
44
69
then:
45
70
def: observation
46
-
if: ${ action.name == "Search" }
71
+
if: ${ action[0].name == "Search" }
47
72
then:
48
73
text:
49
74
- "\nObs: "
@@ -52,17 +77,17 @@ defs:
52
77
import warnings, wikipedia
53
78
warnings.simplefilter("ignore")
54
79
try:
55
-
result = wikipedia.summary("${ action.arguments.topic }")
80
+
result = wikipedia.summary("${ action[0].arguments.topic }")
56
81
except wikipedia.WikipediaException as e:
57
82
result = str(e)
58
83
- "\n"
59
84
else:
60
-
if: ${ action.name == "Calc" }
85
+
if: ${ action[0].name == "Calc" }
61
86
then:
62
87
text:
63
88
- "\nObs: "
64
89
- lang: python
65
-
code: result = ${ action.arguments.expr }
90
+
code: result = ${ action[0].arguments.expr }
66
91
- "\n"
67
92
else:
68
93
def: exit
@@ -71,7 +96,7 @@ defs:
71
96
- def: prev_action
72
97
contribute: []
73
98
data: ${ action }
74
-
until: ${ action.name == "Finish" or exit }
99
+
until: ${ action[0].name == "Finish" or exit }
75
100
76
101
react:
77
102
function:
@@ -81,47 +106,20 @@ defs:
81
106
defs:
82
107
examples:
83
108
array:
84
-
- text:
85
-
|
86
-
What is the elevation range for the area that the eastern sector of the Colorado orogeny extends into?
87
-
Tho: I need to search Colorado orogeny, find the area that the eastern sector of the Colorado ...
Obs: Nicholas Ray (born Raymond Nicholas Kienzle Jr., August 7, 1911 - June 16, 1979) was an American film director, screenwriter, and actor best known for the 1955 film Rebel Without a Cause.
101
116
Tho: Professions of Nicholas Ray are director, screenwriter, and actor. I need to search Elia Kazan next and find his professions.
Obs: Elia Kazan was an American film and theatre director, producer, screenwriter and actor.
104
120
Tho: Professions of Elia Kazan are director, producer, screenwriter, and actor. So profession Nicholas Ray and Elia Kazan have in common is director, screenwriter, and actor.
0 commit comments