Skip to content

Commit cad8a7c

Browse files
committed
feat: change type syntax
Signed-off-by: Louis Mandel <[email protected]>
1 parent 4b15d82 commit cad8a7c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+376
-867
lines changed

contrib/prompt_library/CoT.pdl

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@ defs:
33
# Chain of Thought
44
cot_block:
55
function:
6-
question: str
7-
reasoning: str
8-
answer: str
6+
question: string
7+
reasoning: string
8+
answer: string
99
return: |-
1010
Question: ${ question }
1111
Answer: Let's think step by step. ${ reasoning }
1212
The answer is ${ answer }
1313

1414
fewshot_cot:
1515
function:
16-
examples:
17-
{ list: { obj: { question: str, reasoning: str, answer: str } } }
16+
examples: [{ question: string, reasoning: string, answer: string }]
1817
return:
1918
text:
2019
- for:
@@ -30,10 +29,9 @@ defs:
3029

3130
chain_of_thought:
3231
function:
33-
question: str
34-
model: str
35-
examples:
36-
{ list: { obj: { question: str, reasoning: str, answer: str } } }
32+
question: string
33+
model: string
34+
examples: [{ question: string, reasoning: string, answer: string }]
3735
return:
3836
lastOf:
3937
- call: ${ fewshot_cot }

contrib/prompt_library/ReAct.pdl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: ReAct pattern from Yao et al., [ICLR 2023](https://openreview.net/f
33
defs:
44
react_block:
55
function:
6-
trajectory: { list: obj }
6+
trajectory: [ object ]
77
return:
88
text:
99
- for:
@@ -36,11 +36,11 @@ defs:
3636

3737
react:
3838
function:
39-
task: str
40-
model: str
41-
tool_schema: { list: obj }
42-
tools: obj
43-
trajectories: { list: list }
39+
task: string
40+
model: string
41+
tool_schema: [ object ]
42+
tools: object
43+
trajectories: [ array ]
4444
return:
4545
lastOf:
4646
- role: system
@@ -95,7 +95,7 @@ defs:
9595
temperature: 0
9696
stop: ["\n", "Obs:", "<|eom_id|>"]
9797
include_stop_sequence: false
98-
spec: { name: str, arguments: obj }
98+
spec: { name: string, arguments: object }
9999
- if: ${ action != prev_action }
100100
then:
101101
def: observation

contrib/prompt_library/ReWoo.pdl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: ReWOO (Reasoning without observation) pattern from Xu et al., (http
55
defs:
66
rewoo_block:
77
function:
8-
trajectory: { list: obj }
8+
trajectory: [ object ]
99
return:
1010
text:
1111
- defs:
@@ -47,12 +47,12 @@ defs:
4747

4848
rewoo:
4949
function:
50-
task: str
51-
model: str
52-
tool_schema: { list: obj }
53-
tools: obj
54-
trajectories: { list: list }
55-
show_plans: bool
50+
task: string
51+
model: string
52+
tool_schema: [object]
53+
tools: object
54+
trajectories: array
55+
show_plans: boolean
5656
return:
5757
lastOf:
5858
- |

contrib/prompt_library/tools.pdl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ defs:
1212

1313
filter_tools_by_name:
1414
function:
15-
tools: { list: obj }
16-
tool_names: { list: str }
15+
tools: [object]
16+
tool_names: [string]
1717
return:
1818
data: ${ tools|selectattr('name', 'in', tool_names)|list }
1919

@@ -58,7 +58,7 @@ defs:
5858
object:
5959
calculator:
6060
function:
61-
arguments: obj
61+
arguments: object
6262
return:
6363
lang: python
6464
code: |
@@ -81,7 +81,7 @@ defs:
8181
result = main(**arguments)
8282
search:
8383
function:
84-
arguments: obj
84+
arguments: object
8585
return:
8686
lastOf:
8787
- def: result

docs/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ tools:
535535
object:
536536
hello:
537537
function:
538-
arguments: obj
538+
arguments: object
539539
return:
540540
lang: python
541541
code: |

examples/callback/repair_prompt.pdl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ lastOf:
1515

1616
- lang: python
1717
def: parsed_output
18-
spec: {thought: str, code_line: str}
18+
spec: {thought: string, code_line: string}
1919
code: |
2020
import repair_main
2121
# (In PDL, set `result` to the output you wish for your code block.)
2222
result = repair_main.parse_output(raw_output)
2323

24-
- spec: {before: str, after: str}
24+
- spec: {before: string, after: string}
2525
object:
2626
before: ${code_line}
2727
after: ${parsed_output.code_line}

0 commit comments

Comments
 (0)