@sealkeeper/schema 0.4.9 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,298 +0,0 @@
1
- const DEDUPE_INSTRUCTION = 'Remove duplicate lines from the text in input.';
2
- const DEDUPE_OUTPUT = 'Lines are separated by a line feed. Keep each distinct line once, in the order it first appears. Compare lines exactly, so case and spaces matter. Join the kept lines with a line feed and end with exactly one line feed.';
3
- const SORT_INSTRUCTION = 'Sort the lines of the text in input.';
4
- const SORT_OUTPUT = 'Lines are separated by a line feed. Sort them in ascending Unicode code point order, so every capital letter comes before every lower case letter. Keep duplicate lines and change nothing inside a line. Join the lines with a line feed and end with exactly one line feed.';
5
- const SHAPE_INSTRUCTION = 'Turn the sentence in input into one JSON object.';
6
- const SHAPE_OUTPUT_1 = "Return one JSON object with exactly these fields and no others, guest (string), nights (integer), city (string), breakfast (boolean). Take every value from the sentence, and give a fact that is either so or not so as a boolean. It must validate against the task's JSON schema.";
7
- const SHAPE_OUTPUT_2 = "Return one JSON object with exactly these fields and no others, orderId (integer), customer (string), items (integer), total (number), express (boolean). Take every value from the sentence, and give a fact that is either so or not so as a boolean. It must validate against the task's JSON schema.";
8
- const SHAPE_OUTPUT_3 = "Return one JSON object with exactly these fields and no others, station (string), tempC (number), humidity (integer), raining (boolean). Take every value from the sentence, and give a fact that is either so or not so as a boolean. It must validate against the task's JSON schema.";
9
- export const TEMPLATE_VECTORS = [
10
- {
11
- name: 'text_dedupe keeps the first of each line',
12
- taskType: 'text_dedupe',
13
- spec: {
14
- instruction: DEDUPE_INSTRUCTION,
15
- input: 'b\na\nb',
16
- output: DEDUPE_OUTPUT,
17
- },
18
- answer: 'b\na\n',
19
- sha256: 'aea8a04c2f293417e499bf5de2def8ebb1ed40264d128a67180ea56fbe4600ff',
20
- },
21
- {
22
- name: 'text_dedupe compares case and spaces exactly',
23
- taskType: 'text_dedupe',
24
- spec: {
25
- instruction: DEDUPE_INSTRUCTION,
26
- input: 'a b\na b\na b\nA b',
27
- output: DEDUPE_OUTPUT,
28
- },
29
- answer: 'a b\na b\nA b\n',
30
- sha256: 'fb7bd1b067ab306aeab777deb88f8141f2f03263a7f0955905d7e7ce4995cfb9',
31
- },
32
- {
33
- name: 'text_dedupe keeps a composed and a decomposed letter apart',
34
- taskType: 'text_dedupe',
35
- spec: {
36
- instruction: DEDUPE_INSTRUCTION,
37
- input: 'caf\u00e9\ncafe\u0301\ncaf\u00e9\n\ud83d\ude00\n\ud83d\ude00',
38
- output: DEDUPE_OUTPUT,
39
- },
40
- answer: 'caf\u00e9\ncafe\u0301\n\ud83d\ude00\n',
41
- sha256: '649edf74b6a808475fe64e29f3cd9b98e528bf9f86289188b7a306ce635c0975',
42
- },
43
- {
44
- name: 'text_dedupe drawn',
45
- taskType: 'text_dedupe',
46
- spec: {
47
- instruction: DEDUPE_INSTRUCTION,
48
- input: 'birch\nsummit\nsummit\nsummit\nglade\nBirch\nsummit\nglade\nglade\nbirch',
49
- output: DEDUPE_OUTPUT,
50
- },
51
- answer: 'birch\nsummit\nglade\nBirch\n',
52
- sha256: '64466fd7b6ccc6445c2adbfeac0c48b510c151ec391e35ce0685cb0788f94163',
53
- },
54
- {
55
- name: 'text_dedupe keeps a line that starts with a byte order mark',
56
- taskType: 'text_dedupe',
57
- spec: {
58
- instruction: DEDUPE_INSTRUCTION,
59
- input: '\ufeffb\na\n\ufeffb\nb',
60
- output: DEDUPE_OUTPUT,
61
- },
62
- answer: '\ufeffb\na\nb\n',
63
- sha256: '1b7fbe602895eac2063df17a614b47fa561c2b8be1835c94c933be226176c9a7',
64
- },
65
- {
66
- name: 'line_sort puts capitals first',
67
- taskType: 'line_sort',
68
- spec: {
69
- instruction: SORT_INSTRUCTION,
70
- input: 'pear\nApple\nbanana\napple',
71
- output: SORT_OUTPUT,
72
- },
73
- answer: 'Apple\napple\nbanana\npear\n',
74
- sha256: '63244b1e6793cf80e4b0b0977511f1f5565e2dc7e8e8a83efad8f0fac27bf03e',
75
- },
76
- {
77
- name: 'line_sort orders by code point, not UTF-16 unit, and keeps duplicates',
78
- taskType: 'line_sort',
79
- spec: {
80
- instruction: SORT_INSTRUCTION,
81
- input: '\uff5e\n\ud83d\ude00\na\nZ\n\ud83d\ude00',
82
- output: SORT_OUTPUT,
83
- },
84
- answer: 'Z\na\n\uff5e\n\ud83d\ude00\n\ud83d\ude00\n',
85
- sha256: 'fd5d08a5c98c060413cf15bfe23c8bb6bb88e230ed08d97176b55617daff64b8',
86
- },
87
- {
88
- name: 'line_sort compares digits as text',
89
- taskType: 'line_sort',
90
- spec: {
91
- instruction: SORT_INSTRUCTION,
92
- input: 'b 10\nb 9\nb 1',
93
- output: SORT_OUTPUT,
94
- },
95
- answer: 'b 1\nb 10\nb 9\n',
96
- sha256: '8e3daa107a4634994df4aa192ac34e9cc7f45817c90c27dee84399f7b62e581f',
97
- },
98
- {
99
- name: 'line_sort drawn',
100
- taskType: 'line_sort',
101
- spec: {
102
- instruction: SORT_INSTRUCTION,
103
- input: 'birch 417\nSummit 444\nglade 814\ntundra 63\nmeadow 625\ncedar 421\nfjord 635\nriver 742',
104
- output: SORT_OUTPUT,
105
- },
106
- answer: 'Summit 444\nbirch 417\ncedar 421\nfjord 635\nglade 814\nmeadow 625\nriver 742\ntundra 63\n',
107
- sha256: '01503d6c6666daf055f294c5061472a9530fa2dea9b74a29ea49b71aeec6fbd2',
108
- },
109
- {
110
- name: 'line_sort sorts a byte order mark as a character',
111
- taskType: 'line_sort',
112
- spec: {
113
- instruction: SORT_INSTRUCTION,
114
- input: '\ufeffpear\nApple',
115
- output: SORT_OUTPUT,
116
- },
117
- answer: 'Apple\n\ufeffpear\n',
118
- sha256: 'cc16d27a6e19248be0fe05d8f4db040d8f22b659e102e065e0d935ebddb5d837',
119
- },
120
- {
121
- name: 'json_shape booking with breakfast',
122
- taskType: 'json_shape',
123
- spec: {
124
- instruction: SHAPE_INSTRUCTION,
125
- input: 'Alice booked 1 nights in Accra, breakfast included.',
126
- output: SHAPE_OUTPUT_1,
127
- },
128
- answer: '{"guest":"Alice","nights":1,"city":"Accra","breakfast":true}',
129
- sha256: '8e3f3bae5bdfc8bbb148b05216589db1ff55aeff6664ca172b2b146d8623c7ce',
130
- jsonSchema: {
131
- type: 'object',
132
- properties: {
133
- guest: { type: 'string', const: 'Alice' },
134
- nights: { type: 'integer', const: 1 },
135
- city: { type: 'string', const: 'Accra' },
136
- breakfast: { type: 'boolean', const: true },
137
- },
138
- required: ['guest', 'nights', 'city', 'breakfast'],
139
- additionalProperties: false,
140
- },
141
- },
142
- {
143
- name: 'json_shape booking without breakfast',
144
- taskType: 'json_shape',
145
- spec: {
146
- instruction: SHAPE_INSTRUCTION,
147
- input: 'Ivan booked 13 nights in Lagos, breakfast not included.',
148
- output: SHAPE_OUTPUT_1,
149
- },
150
- answer: '{"guest":"Ivan","nights":13,"city":"Lagos","breakfast":false}',
151
- sha256: '4e1ac75c0fc4c35f5476b4e0a7df49580cf5898ed3e4462705990f3386f1ccb7',
152
- jsonSchema: {
153
- type: 'object',
154
- properties: {
155
- guest: { type: 'string', const: 'Ivan' },
156
- nights: { type: 'integer', const: 13 },
157
- city: { type: 'string', const: 'Lagos' },
158
- breakfast: { type: 'boolean', const: false },
159
- },
160
- required: ['guest', 'nights', 'city', 'breakfast'],
161
- additionalProperties: false,
162
- },
163
- },
164
- {
165
- name: 'json_shape express order with a whole total',
166
- taskType: 'json_shape',
167
- spec: {
168
- instruction: SHAPE_INSTRUCTION,
169
- input: 'Order 1000 was placed by Judy for 12 items, total 1.00, with express shipping.',
170
- output: SHAPE_OUTPUT_2,
171
- },
172
- answer: '{"orderId":1000,"customer":"Judy","items":12,"total":1,"express":true}',
173
- sha256: '2410664d0ece991201868f56c4edb8b7316d0d99422ace443e3a8ebff7cdf0bb',
174
- jsonSchema: {
175
- type: 'object',
176
- properties: {
177
- orderId: { type: 'integer', const: 1000 },
178
- customer: { type: 'string', const: 'Judy' },
179
- items: { type: 'integer', const: 12 },
180
- total: { type: 'number', const: 1 },
181
- express: { type: 'boolean', const: true },
182
- },
183
- required: ['orderId', 'customer', 'items', 'total', 'express'],
184
- additionalProperties: false,
185
- },
186
- },
187
- {
188
- name: 'json_shape standard order',
189
- taskType: 'json_shape',
190
- spec: {
191
- instruction: SHAPE_INSTRUCTION,
192
- input: 'Order 78592 was placed by Carol for 1 items, total 465.16, with standard shipping.',
193
- output: SHAPE_OUTPUT_2,
194
- },
195
- answer: '{"orderId":78592,"customer":"Carol","items":1,"total":465.16,"express":false}',
196
- sha256: '6c51416d6c141bbaf3e6f87b4a2f71e8a6b439ff8433e515ede780092914f05d',
197
- jsonSchema: {
198
- type: 'object',
199
- properties: {
200
- orderId: { type: 'integer', const: 78592 },
201
- customer: { type: 'string', const: 'Carol' },
202
- items: { type: 'integer', const: 1 },
203
- total: { type: 'number', const: 465.16 },
204
- express: { type: 'boolean', const: false },
205
- },
206
- required: ['orderId', 'customer', 'items', 'total', 'express'],
207
- additionalProperties: false,
208
- },
209
- },
210
- {
211
- name: 'json_shape station raining at a whole temperature',
212
- taskType: 'json_shape',
213
- spec: {
214
- instruction: SHAPE_INSTRUCTION,
215
- input: 'The Vienna station reads 42.0 C with 100 percent humidity, and it is raining.',
216
- output: SHAPE_OUTPUT_3,
217
- },
218
- answer: '{"station":"Vienna","tempC":42,"humidity":100,"raining":true}',
219
- sha256: '98ca8812f15404b81cd12653dff3ae03bce6a804c19451ca34c12ea8f68a95cc',
220
- jsonSchema: {
221
- type: 'object',
222
- properties: {
223
- station: { type: 'string', const: 'Vienna' },
224
- tempC: { type: 'number', const: 42 },
225
- humidity: { type: 'integer', const: 100 },
226
- raining: { type: 'boolean', const: true },
227
- },
228
- required: ['station', 'tempC', 'humidity', 'raining'],
229
- additionalProperties: false,
230
- },
231
- },
232
- {
233
- name: 'json_shape station below zero',
234
- taskType: 'json_shape',
235
- spec: {
236
- instruction: SHAPE_INSTRUCTION,
237
- input: 'The Oslo station reads -5.5 C with 5 percent humidity, and it is not raining.',
238
- output: SHAPE_OUTPUT_3,
239
- },
240
- answer: '{"station":"Oslo","tempC":-5.5,"humidity":5,"raining":false}',
241
- sha256: '83d7dc3d181de56c688d8d24d40d4e1ad0904b3531bb361c77b56a6eecd5be68',
242
- jsonSchema: {
243
- type: 'object',
244
- properties: {
245
- station: { type: 'string', const: 'Oslo' },
246
- tempC: { type: 'number', const: -5.5 },
247
- humidity: { type: 'integer', const: 5 },
248
- raining: { type: 'boolean', const: false },
249
- },
250
- required: ['station', 'tempC', 'humidity', 'raining'],
251
- additionalProperties: false,
252
- },
253
- },
254
- {
255
- name: 'json_shape station at zero',
256
- taskType: 'json_shape',
257
- spec: {
258
- instruction: SHAPE_INSTRUCTION,
259
- input: 'The Oslo station reads 0.0 C with 50 percent humidity, and it is raining.',
260
- output: SHAPE_OUTPUT_3,
261
- },
262
- answer: '{"station":"Oslo","tempC":0,"humidity":50,"raining":true}',
263
- sha256: '90e2aebf3a32bc59b0d28dd139ffc236145d5587f6c6fba06a90b581fb1b872b',
264
- jsonSchema: {
265
- type: 'object',
266
- properties: {
267
- station: { type: 'string', const: 'Oslo' },
268
- tempC: { type: 'number', const: 0 },
269
- humidity: { type: 'integer', const: 50 },
270
- raining: { type: 'boolean', const: true },
271
- },
272
- required: ['station', 'tempC', 'humidity', 'raining'],
273
- additionalProperties: false,
274
- },
275
- },
276
- {
277
- name: 'json_shape station at the coldest draw',
278
- taskType: 'json_shape',
279
- spec: {
280
- instruction: SHAPE_INSTRUCTION,
281
- input: 'The Accra station reads -15.0 C with 99 percent humidity, and it is not raining.',
282
- output: SHAPE_OUTPUT_3,
283
- },
284
- answer: '{"station":"Accra","tempC":-15,"humidity":99,"raining":false}',
285
- sha256: '3e70b7c72ca7dabf20ac5b4f6b40cf35b9217a0fe4a0580f58953c21217017b7',
286
- jsonSchema: {
287
- type: 'object',
288
- properties: {
289
- station: { type: 'string', const: 'Accra' },
290
- tempC: { type: 'number', const: -15 },
291
- humidity: { type: 'integer', const: 99 },
292
- raining: { type: 'boolean', const: false },
293
- },
294
- required: ['station', 'tempC', 'humidity', 'raining'],
295
- additionalProperties: false,
296
- },
297
- },
298
- ];