@botpress/vai 0.0.1 → 0.0.2
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.
- package/dist/assertions/check.js +23 -0
- package/dist/assertions/extension.js +36 -0
- package/dist/assertions/extract.js +27 -0
- package/dist/assertions/filter.js +70 -0
- package/dist/assertions/rate.js +33 -0
- package/dist/context.js +44 -0
- package/dist/hooks/setEvaluator.js +10 -0
- package/dist/hooks/setupClient.js +5 -0
- package/dist/index.d.ts +21 -21
- package/dist/index.js +8 -473
- package/dist/models.js +388 -0
- package/dist/scripts/update-models.js +58 -0
- package/dist/scripts/update-types.js +42 -0
- package/dist/task/compare.js +45 -0
- package/dist/utils/asyncAssertion.js +37 -0
- package/dist/utils/deferred.js +15 -0
- package/dist/utils/predictJson.js +75 -0
- package/package.json +9 -7
- package/tsup.config.ts +3 -9
- package/dist/index.cjs +0 -503
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -473
- package/dist/index.js.map +0 -1
package/dist/index.d.cts
DELETED
|
@@ -1,473 +0,0 @@
|
|
|
1
|
-
import * as _botpress_sdk from '@botpress/sdk';
|
|
2
|
-
import { z } from '@botpress/sdk';
|
|
3
|
-
import { TestFunction } from 'vitest';
|
|
4
|
-
import { Client } from '@botpress/client';
|
|
5
|
-
|
|
6
|
-
type ScenarioLike = z.infer<typeof ScenarioLike>;
|
|
7
|
-
declare const ScenarioLike: _botpress_sdk.ZodUnion<[_botpress_sdk.ZodString, _botpress_sdk.ZodObject<{
|
|
8
|
-
name: _botpress_sdk.ZodString;
|
|
9
|
-
}, "passthrough", _botpress_sdk.ZodTypeAny, _botpress_sdk.objectOutputType<{
|
|
10
|
-
name: _botpress_sdk.ZodString;
|
|
11
|
-
}, _botpress_sdk.ZodTypeAny, "passthrough">, _botpress_sdk.objectInputType<{
|
|
12
|
-
name: _botpress_sdk.ZodString;
|
|
13
|
-
}, _botpress_sdk.ZodTypeAny, "passthrough">>, _botpress_sdk.ZodObject<{
|
|
14
|
-
id: _botpress_sdk.ZodString;
|
|
15
|
-
}, "passthrough", _botpress_sdk.ZodTypeAny, _botpress_sdk.objectOutputType<{
|
|
16
|
-
id: _botpress_sdk.ZodString;
|
|
17
|
-
}, _botpress_sdk.ZodTypeAny, "passthrough">, _botpress_sdk.objectInputType<{
|
|
18
|
-
id: _botpress_sdk.ZodString;
|
|
19
|
-
}, _botpress_sdk.ZodTypeAny, "passthrough">>]>;
|
|
20
|
-
declare function compare<T extends ReadonlyArray<ScenarioLike>>(name: string | Function, scenarios: T, fn?: TestFunction<{
|
|
21
|
-
scenario: T[number];
|
|
22
|
-
}>): void;
|
|
23
|
-
|
|
24
|
-
type Input = z.infer<typeof Input>;
|
|
25
|
-
declare const Input: _botpress_sdk.ZodUnion<[_botpress_sdk.ZodUnion<[_botpress_sdk.ZodString, z.ZodTransformer<_botpress_sdk.ZodObject<{}, "passthrough", _botpress_sdk.ZodTypeAny, _botpress_sdk.objectOutputType<{}, _botpress_sdk.ZodTypeAny, "passthrough">, _botpress_sdk.objectInputType<{}, _botpress_sdk.ZodTypeAny, "passthrough">>, _botpress_sdk.objectOutputType<{}, _botpress_sdk.ZodTypeAny, "passthrough">, _botpress_sdk.objectInputType<{}, _botpress_sdk.ZodTypeAny, "passthrough">>]>, _botpress_sdk.ZodArray<_botpress_sdk.ZodAny, "many">]>;
|
|
26
|
-
type Output<T = any> = z.infer<typeof Output> & {
|
|
27
|
-
result: T;
|
|
28
|
-
};
|
|
29
|
-
declare const Output: _botpress_sdk.ZodObject<{
|
|
30
|
-
reason: _botpress_sdk.ZodString;
|
|
31
|
-
result: _botpress_sdk.ZodAny;
|
|
32
|
-
}, "strip", _botpress_sdk.ZodTypeAny, {
|
|
33
|
-
reason: string;
|
|
34
|
-
result?: any;
|
|
35
|
-
}, {
|
|
36
|
-
reason: string;
|
|
37
|
-
result?: any;
|
|
38
|
-
}>;
|
|
39
|
-
|
|
40
|
-
declare class AsyncExpectError<T> extends Error {
|
|
41
|
-
readonly output: Output<T>;
|
|
42
|
-
constructor(message: string, output: Output<T>);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
type CheckOptions<T> = {
|
|
46
|
-
examples?: {
|
|
47
|
-
value: T;
|
|
48
|
-
expected: boolean;
|
|
49
|
-
reason: string;
|
|
50
|
-
}[];
|
|
51
|
-
};
|
|
52
|
-
declare function check<T extends Input>(value: T, condition: string, options?: CheckOptions<T>): {
|
|
53
|
-
toBe: (expected: boolean) => Promise<Output<boolean> | AsyncExpectError<boolean>>;
|
|
54
|
-
toMatchInlineSnapshot: (expected?: string) => Promise<void | Output<boolean> | AsyncExpectError<boolean>>;
|
|
55
|
-
then<TResult1 = Output<boolean>, TResult2 = never>(onfulfilled?: ((value: Output<boolean>) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): PromiseLike<TResult1 | TResult2>;
|
|
56
|
-
value: PromiseLike<boolean>;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
type ExtractOptions<T, S> = {
|
|
60
|
-
description?: string;
|
|
61
|
-
examples?: {
|
|
62
|
-
value: T;
|
|
63
|
-
extracted: S;
|
|
64
|
-
reason: string;
|
|
65
|
-
}[];
|
|
66
|
-
};
|
|
67
|
-
declare function extract<T extends Input, S extends z.AnyZodObject>(value: T, shape: S, options?: ExtractOptions<T, z.infer<S>>): {
|
|
68
|
-
toBe: (expected: z.infer<S>) => Promise<Output<z.infer<S>> | AsyncExpectError<z.infer<S>>>;
|
|
69
|
-
toMatchObject: (expected: Partial<z.infer<S>>) => Promise<Output<z.infer<S>> | AsyncExpectError<z.infer<S>>>;
|
|
70
|
-
toMatchInlineSnapshot: (expected?: string) => Promise<void | Output<z.infer<S>> | AsyncExpectError<z.infer<S>>>;
|
|
71
|
-
then<TResult1 = Output<z.infer<S>>, TResult2 = never>(onfulfilled?: ((value: Output<z.infer<S>>) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): PromiseLike<TResult1 | TResult2>;
|
|
72
|
-
value: PromiseLike<z.infer<S>>;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
type FilterOptions<T> = {
|
|
76
|
-
examples?: {
|
|
77
|
-
value: T;
|
|
78
|
-
reason: string;
|
|
79
|
-
keep: boolean;
|
|
80
|
-
}[];
|
|
81
|
-
};
|
|
82
|
-
declare function filter<U>(values: U[], condition: string, options?: FilterOptions<U>): {
|
|
83
|
-
toBe: (expected: U[]) => Promise<Output<U[]> | AsyncExpectError<U[]>>;
|
|
84
|
-
toMatchInlineSnapshot: (expected?: string) => Promise<void | Output<U[]> | AsyncExpectError<U[]>>;
|
|
85
|
-
toHaveNoneFiltered: () => Promise<Output<U[]> | AsyncExpectError<U[]>>;
|
|
86
|
-
toHaveSomeFiltered: () => Promise<Output<U[]> | AsyncExpectError<U[]>>;
|
|
87
|
-
toBeEmpty: () => Promise<Output<U[]> | AsyncExpectError<U[]>>;
|
|
88
|
-
length: {
|
|
89
|
-
toBe: (expected: number) => Promise<Output<U[]> | AsyncExpectError<U[]>>;
|
|
90
|
-
toBeGreaterThanOrEqual: (expected: number) => Promise<Output<U[]> | AsyncExpectError<U[]>>;
|
|
91
|
-
toBeLessThanOrEqual: (expected: number) => Promise<Output<U[]> | AsyncExpectError<U[]>>;
|
|
92
|
-
toBeBetween: (min: number, max: number) => Promise<Output<U[]> | AsyncExpectError<U[]>>;
|
|
93
|
-
};
|
|
94
|
-
then<TResult1 = Output<U[]>, TResult2 = never>(onfulfilled?: ((value: Output<U[]>) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): PromiseLike<TResult1 | TResult2>;
|
|
95
|
-
value: PromiseLike<U[]>;
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
type RatingScore = 1 | 2 | 3 | 4 | 5;
|
|
99
|
-
type RateOptions<T> = {
|
|
100
|
-
examples?: {
|
|
101
|
-
value: T;
|
|
102
|
-
rating: number;
|
|
103
|
-
reason: string;
|
|
104
|
-
}[];
|
|
105
|
-
};
|
|
106
|
-
declare function rate<T extends Input>(value: T, condition: string, options?: RateOptions<T>): {
|
|
107
|
-
toBe: (expected: number) => Promise<Output<number> | AsyncExpectError<number>>;
|
|
108
|
-
toMatchInlineSnapshot: (expected?: string) => Promise<void | Output<number> | AsyncExpectError<number>>;
|
|
109
|
-
toBeGreaterThanOrEqual: (expected: RatingScore) => Promise<Output<number> | AsyncExpectError<number>>;
|
|
110
|
-
toBeLessThanOrEqual: (expected: RatingScore) => Promise<Output<number> | AsyncExpectError<number>>;
|
|
111
|
-
then<TResult1 = Output<number>, TResult2 = never>(onfulfilled?: ((value: Output<number>) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): PromiseLike<TResult1 | TResult2>;
|
|
112
|
-
value: PromiseLike<number>;
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
declare const Models: readonly [{
|
|
116
|
-
readonly id: "anthropic__claude-3-haiku-20240307";
|
|
117
|
-
readonly name: "Claude 3 Haiku";
|
|
118
|
-
readonly integration: "anthropic";
|
|
119
|
-
readonly input: {
|
|
120
|
-
readonly maxTokens: 200000;
|
|
121
|
-
};
|
|
122
|
-
readonly output: {
|
|
123
|
-
readonly maxTokens: 4096;
|
|
124
|
-
};
|
|
125
|
-
}, {
|
|
126
|
-
readonly id: "anthropic__claude-3-5-sonnet-20240620";
|
|
127
|
-
readonly name: "Claude 3.5 Sonnet";
|
|
128
|
-
readonly integration: "anthropic";
|
|
129
|
-
readonly input: {
|
|
130
|
-
readonly maxTokens: 200000;
|
|
131
|
-
};
|
|
132
|
-
readonly output: {
|
|
133
|
-
readonly maxTokens: 4096;
|
|
134
|
-
};
|
|
135
|
-
}, {
|
|
136
|
-
readonly id: "cerebras__llama3.1-70b";
|
|
137
|
-
readonly name: "Llama 3.1 70B";
|
|
138
|
-
readonly integration: "cerebras";
|
|
139
|
-
readonly input: {
|
|
140
|
-
readonly maxTokens: 8192;
|
|
141
|
-
};
|
|
142
|
-
readonly output: {
|
|
143
|
-
readonly maxTokens: 8192;
|
|
144
|
-
};
|
|
145
|
-
}, {
|
|
146
|
-
readonly id: "cerebras__llama3.1-8b";
|
|
147
|
-
readonly name: "Llama 3.1 8B";
|
|
148
|
-
readonly integration: "cerebras";
|
|
149
|
-
readonly input: {
|
|
150
|
-
readonly maxTokens: 8192;
|
|
151
|
-
};
|
|
152
|
-
readonly output: {
|
|
153
|
-
readonly maxTokens: 8192;
|
|
154
|
-
};
|
|
155
|
-
}, {
|
|
156
|
-
readonly id: "fireworks-ai__accounts/fireworks/models/deepseek-coder-v2-instruct";
|
|
157
|
-
readonly name: "DeepSeek Coder V2 Instruct";
|
|
158
|
-
readonly integration: "fireworks-ai";
|
|
159
|
-
readonly input: {
|
|
160
|
-
readonly maxTokens: 131072;
|
|
161
|
-
};
|
|
162
|
-
readonly output: {
|
|
163
|
-
readonly maxTokens: 131072;
|
|
164
|
-
};
|
|
165
|
-
}, {
|
|
166
|
-
readonly id: "fireworks-ai__accounts/fireworks/models/deepseek-coder-v2-lite-instruct";
|
|
167
|
-
readonly name: "DeepSeek Coder V2 Lite";
|
|
168
|
-
readonly integration: "fireworks-ai";
|
|
169
|
-
readonly input: {
|
|
170
|
-
readonly maxTokens: 163840;
|
|
171
|
-
};
|
|
172
|
-
readonly output: {
|
|
173
|
-
readonly maxTokens: 163840;
|
|
174
|
-
};
|
|
175
|
-
}, {
|
|
176
|
-
readonly id: "fireworks-ai__accounts/fireworks/models/firellava-13b";
|
|
177
|
-
readonly name: "FireLLaVA-13B";
|
|
178
|
-
readonly integration: "fireworks-ai";
|
|
179
|
-
readonly input: {
|
|
180
|
-
readonly maxTokens: 4096;
|
|
181
|
-
};
|
|
182
|
-
readonly output: {
|
|
183
|
-
readonly maxTokens: 4096;
|
|
184
|
-
};
|
|
185
|
-
}, {
|
|
186
|
-
readonly id: "fireworks-ai__accounts/fireworks/models/firefunction-v2";
|
|
187
|
-
readonly name: "Firefunction V2";
|
|
188
|
-
readonly integration: "fireworks-ai";
|
|
189
|
-
readonly input: {
|
|
190
|
-
readonly maxTokens: 8192;
|
|
191
|
-
};
|
|
192
|
-
readonly output: {
|
|
193
|
-
readonly maxTokens: 8192;
|
|
194
|
-
};
|
|
195
|
-
}, {
|
|
196
|
-
readonly id: "fireworks-ai__accounts/fireworks/models/gemma2-9b-it";
|
|
197
|
-
readonly name: "Gemma 2 9B Instruct";
|
|
198
|
-
readonly integration: "fireworks-ai";
|
|
199
|
-
readonly input: {
|
|
200
|
-
readonly maxTokens: 8192;
|
|
201
|
-
};
|
|
202
|
-
readonly output: {
|
|
203
|
-
readonly maxTokens: 8192;
|
|
204
|
-
};
|
|
205
|
-
}, {
|
|
206
|
-
readonly id: "fireworks-ai__accounts/fireworks/models/llama-v3p1-405b-instruct";
|
|
207
|
-
readonly name: "Llama 3.1 405B Instruct";
|
|
208
|
-
readonly integration: "fireworks-ai";
|
|
209
|
-
readonly input: {
|
|
210
|
-
readonly maxTokens: 131072;
|
|
211
|
-
};
|
|
212
|
-
readonly output: {
|
|
213
|
-
readonly maxTokens: 131072;
|
|
214
|
-
};
|
|
215
|
-
}, {
|
|
216
|
-
readonly id: "fireworks-ai__accounts/fireworks/models/llama-v3p1-70b-instruct";
|
|
217
|
-
readonly name: "Llama 3.1 70B Instruct";
|
|
218
|
-
readonly integration: "fireworks-ai";
|
|
219
|
-
readonly input: {
|
|
220
|
-
readonly maxTokens: 131072;
|
|
221
|
-
};
|
|
222
|
-
readonly output: {
|
|
223
|
-
readonly maxTokens: 131072;
|
|
224
|
-
};
|
|
225
|
-
}, {
|
|
226
|
-
readonly id: "fireworks-ai__accounts/fireworks/models/llama-v3p1-8b-instruct";
|
|
227
|
-
readonly name: "Llama 3.1 8B Instruct";
|
|
228
|
-
readonly integration: "fireworks-ai";
|
|
229
|
-
readonly input: {
|
|
230
|
-
readonly maxTokens: 131072;
|
|
231
|
-
};
|
|
232
|
-
readonly output: {
|
|
233
|
-
readonly maxTokens: 131072;
|
|
234
|
-
};
|
|
235
|
-
}, {
|
|
236
|
-
readonly id: "fireworks-ai__accounts/fireworks/models/mixtral-8x22b-instruct";
|
|
237
|
-
readonly name: "Mixtral MoE 8x22B Instruct";
|
|
238
|
-
readonly integration: "fireworks-ai";
|
|
239
|
-
readonly input: {
|
|
240
|
-
readonly maxTokens: 65536;
|
|
241
|
-
};
|
|
242
|
-
readonly output: {
|
|
243
|
-
readonly maxTokens: 65536;
|
|
244
|
-
};
|
|
245
|
-
}, {
|
|
246
|
-
readonly id: "fireworks-ai__accounts/fireworks/models/mixtral-8x7b-instruct";
|
|
247
|
-
readonly name: "Mixtral MoE 8x7B Instruct";
|
|
248
|
-
readonly integration: "fireworks-ai";
|
|
249
|
-
readonly input: {
|
|
250
|
-
readonly maxTokens: 32768;
|
|
251
|
-
};
|
|
252
|
-
readonly output: {
|
|
253
|
-
readonly maxTokens: 32768;
|
|
254
|
-
};
|
|
255
|
-
}, {
|
|
256
|
-
readonly id: "fireworks-ai__accounts/fireworks/models/mythomax-l2-13b";
|
|
257
|
-
readonly name: "MythoMax L2 13b";
|
|
258
|
-
readonly integration: "fireworks-ai";
|
|
259
|
-
readonly input: {
|
|
260
|
-
readonly maxTokens: 4096;
|
|
261
|
-
};
|
|
262
|
-
readonly output: {
|
|
263
|
-
readonly maxTokens: 4096;
|
|
264
|
-
};
|
|
265
|
-
}, {
|
|
266
|
-
readonly id: "fireworks-ai__accounts/fireworks/models/qwen2-72b-instruct";
|
|
267
|
-
readonly name: "Qwen2 72b Instruct";
|
|
268
|
-
readonly integration: "fireworks-ai";
|
|
269
|
-
readonly input: {
|
|
270
|
-
readonly maxTokens: 32768;
|
|
271
|
-
};
|
|
272
|
-
readonly output: {
|
|
273
|
-
readonly maxTokens: 32768;
|
|
274
|
-
};
|
|
275
|
-
}, {
|
|
276
|
-
readonly id: "groq__gemma2-9b-it";
|
|
277
|
-
readonly name: "Gemma2 9B";
|
|
278
|
-
readonly integration: "groq";
|
|
279
|
-
readonly input: {
|
|
280
|
-
readonly maxTokens: 8192;
|
|
281
|
-
};
|
|
282
|
-
readonly output: {
|
|
283
|
-
readonly maxTokens: 8192;
|
|
284
|
-
};
|
|
285
|
-
}, {
|
|
286
|
-
readonly id: "groq__llama3-70b-8192";
|
|
287
|
-
readonly name: "LLaMA 3 70B";
|
|
288
|
-
readonly integration: "groq";
|
|
289
|
-
readonly input: {
|
|
290
|
-
readonly maxTokens: 8192;
|
|
291
|
-
};
|
|
292
|
-
readonly output: {
|
|
293
|
-
readonly maxTokens: 8192;
|
|
294
|
-
};
|
|
295
|
-
}, {
|
|
296
|
-
readonly id: "groq__llama3-8b-8192";
|
|
297
|
-
readonly name: "LLaMA 3 8B";
|
|
298
|
-
readonly integration: "groq";
|
|
299
|
-
readonly input: {
|
|
300
|
-
readonly maxTokens: 8192;
|
|
301
|
-
};
|
|
302
|
-
readonly output: {
|
|
303
|
-
readonly maxTokens: 8192;
|
|
304
|
-
};
|
|
305
|
-
}, {
|
|
306
|
-
readonly id: "groq__llama-3.1-70b-versatile";
|
|
307
|
-
readonly name: "LLaMA 3.1 70B";
|
|
308
|
-
readonly integration: "groq";
|
|
309
|
-
readonly input: {
|
|
310
|
-
readonly maxTokens: 128000;
|
|
311
|
-
};
|
|
312
|
-
readonly output: {
|
|
313
|
-
readonly maxTokens: 8192;
|
|
314
|
-
};
|
|
315
|
-
}, {
|
|
316
|
-
readonly id: "groq__llama-3.1-8b-instant";
|
|
317
|
-
readonly name: "LLaMA 3.1 8B";
|
|
318
|
-
readonly integration: "groq";
|
|
319
|
-
readonly input: {
|
|
320
|
-
readonly maxTokens: 128000;
|
|
321
|
-
};
|
|
322
|
-
readonly output: {
|
|
323
|
-
readonly maxTokens: 8192;
|
|
324
|
-
};
|
|
325
|
-
}, {
|
|
326
|
-
readonly id: "groq__llama-3.2-11b-vision-preview";
|
|
327
|
-
readonly name: "LLaMA 3.2 11B Vision";
|
|
328
|
-
readonly integration: "groq";
|
|
329
|
-
readonly input: {
|
|
330
|
-
readonly maxTokens: 128000;
|
|
331
|
-
};
|
|
332
|
-
readonly output: {
|
|
333
|
-
readonly maxTokens: 8192;
|
|
334
|
-
};
|
|
335
|
-
}, {
|
|
336
|
-
readonly id: "groq__llama-3.2-1b-preview";
|
|
337
|
-
readonly name: "LLaMA 3.2 1B";
|
|
338
|
-
readonly integration: "groq";
|
|
339
|
-
readonly input: {
|
|
340
|
-
readonly maxTokens: 128000;
|
|
341
|
-
};
|
|
342
|
-
readonly output: {
|
|
343
|
-
readonly maxTokens: 8192;
|
|
344
|
-
};
|
|
345
|
-
}, {
|
|
346
|
-
readonly id: "groq__llama-3.2-3b-preview";
|
|
347
|
-
readonly name: "LLaMA 3.2 3B";
|
|
348
|
-
readonly integration: "groq";
|
|
349
|
-
readonly input: {
|
|
350
|
-
readonly maxTokens: 128000;
|
|
351
|
-
};
|
|
352
|
-
readonly output: {
|
|
353
|
-
readonly maxTokens: 8192;
|
|
354
|
-
};
|
|
355
|
-
}, {
|
|
356
|
-
readonly id: "groq__llama-3.2-90b-vision-preview";
|
|
357
|
-
readonly name: "LLaMA 3.2 90B Vision";
|
|
358
|
-
readonly integration: "groq";
|
|
359
|
-
readonly input: {
|
|
360
|
-
readonly maxTokens: 128000;
|
|
361
|
-
};
|
|
362
|
-
readonly output: {
|
|
363
|
-
readonly maxTokens: 8192;
|
|
364
|
-
};
|
|
365
|
-
}, {
|
|
366
|
-
readonly id: "groq__llama-3.3-70b-versatile";
|
|
367
|
-
readonly name: "LLaMA 3.3 70B";
|
|
368
|
-
readonly integration: "groq";
|
|
369
|
-
readonly input: {
|
|
370
|
-
readonly maxTokens: 128000;
|
|
371
|
-
};
|
|
372
|
-
readonly output: {
|
|
373
|
-
readonly maxTokens: 32768;
|
|
374
|
-
};
|
|
375
|
-
}, {
|
|
376
|
-
readonly id: "groq__mixtral-8x7b-32768";
|
|
377
|
-
readonly name: "Mixtral 8x7B";
|
|
378
|
-
readonly integration: "groq";
|
|
379
|
-
readonly input: {
|
|
380
|
-
readonly maxTokens: 32768;
|
|
381
|
-
};
|
|
382
|
-
readonly output: {
|
|
383
|
-
readonly maxTokens: 32768;
|
|
384
|
-
};
|
|
385
|
-
}, {
|
|
386
|
-
readonly id: "openai__o1-2024-12-17";
|
|
387
|
-
readonly name: "GPT o1";
|
|
388
|
-
readonly integration: "openai";
|
|
389
|
-
readonly input: {
|
|
390
|
-
readonly maxTokens: 200000;
|
|
391
|
-
};
|
|
392
|
-
readonly output: {
|
|
393
|
-
readonly maxTokens: 100000;
|
|
394
|
-
};
|
|
395
|
-
}, {
|
|
396
|
-
readonly id: "openai__o1-mini-2024-09-12";
|
|
397
|
-
readonly name: "GPT o1-mini";
|
|
398
|
-
readonly integration: "openai";
|
|
399
|
-
readonly input: {
|
|
400
|
-
readonly maxTokens: 128000;
|
|
401
|
-
};
|
|
402
|
-
readonly output: {
|
|
403
|
-
readonly maxTokens: 65536;
|
|
404
|
-
};
|
|
405
|
-
}, {
|
|
406
|
-
readonly id: "openai__gpt-3.5-turbo-0125";
|
|
407
|
-
readonly name: "GPT-3.5 Turbo";
|
|
408
|
-
readonly integration: "openai";
|
|
409
|
-
readonly input: {
|
|
410
|
-
readonly maxTokens: 128000;
|
|
411
|
-
};
|
|
412
|
-
readonly output: {
|
|
413
|
-
readonly maxTokens: 4096;
|
|
414
|
-
};
|
|
415
|
-
}, {
|
|
416
|
-
readonly id: "openai__gpt-4-turbo-2024-04-09";
|
|
417
|
-
readonly name: "GPT-4 Turbo";
|
|
418
|
-
readonly integration: "openai";
|
|
419
|
-
readonly input: {
|
|
420
|
-
readonly maxTokens: 128000;
|
|
421
|
-
};
|
|
422
|
-
readonly output: {
|
|
423
|
-
readonly maxTokens: 4096;
|
|
424
|
-
};
|
|
425
|
-
}, {
|
|
426
|
-
readonly id: "openai__gpt-4o-2024-08-06";
|
|
427
|
-
readonly name: "GPT-4o (August 2024)";
|
|
428
|
-
readonly integration: "openai";
|
|
429
|
-
readonly input: {
|
|
430
|
-
readonly maxTokens: 128000;
|
|
431
|
-
};
|
|
432
|
-
readonly output: {
|
|
433
|
-
readonly maxTokens: 16384;
|
|
434
|
-
};
|
|
435
|
-
}, {
|
|
436
|
-
readonly id: "openai__gpt-4o-2024-05-13";
|
|
437
|
-
readonly name: "GPT-4o (May 2024)";
|
|
438
|
-
readonly integration: "openai";
|
|
439
|
-
readonly input: {
|
|
440
|
-
readonly maxTokens: 128000;
|
|
441
|
-
};
|
|
442
|
-
readonly output: {
|
|
443
|
-
readonly maxTokens: 4096;
|
|
444
|
-
};
|
|
445
|
-
}, {
|
|
446
|
-
readonly id: "openai__gpt-4o-2024-11-20";
|
|
447
|
-
readonly name: "GPT-4o (November 2024)";
|
|
448
|
-
readonly integration: "openai";
|
|
449
|
-
readonly input: {
|
|
450
|
-
readonly maxTokens: 128000;
|
|
451
|
-
};
|
|
452
|
-
readonly output: {
|
|
453
|
-
readonly maxTokens: 16384;
|
|
454
|
-
};
|
|
455
|
-
}, {
|
|
456
|
-
readonly id: "openai__gpt-4o-mini-2024-07-18";
|
|
457
|
-
readonly name: "GPT-4o Mini";
|
|
458
|
-
readonly integration: "openai";
|
|
459
|
-
readonly input: {
|
|
460
|
-
readonly maxTokens: 128000;
|
|
461
|
-
};
|
|
462
|
-
readonly output: {
|
|
463
|
-
readonly maxTokens: 16384;
|
|
464
|
-
};
|
|
465
|
-
}];
|
|
466
|
-
|
|
467
|
-
type EvaluatorModel = (typeof Models)[number]['id'];
|
|
468
|
-
|
|
469
|
-
declare const setEvaluator: (model: EvaluatorModel) => void;
|
|
470
|
-
|
|
471
|
-
declare const setupClient: (client: Client) => void;
|
|
472
|
-
|
|
473
|
-
export { check, compare, extract, filter, rate, setEvaluator, setupClient };
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/zui.ts","../src/task/compare.ts","../src/utils/deferred.ts","../src/context.ts","../src/utils/asyncAssertion.ts","../src/utils/predictJson.ts","../src/assertions/extension.ts","../src/assertions/check.ts","../src/assertions/extract.ts","../src/assertions/filter.ts","../src/assertions/rate.ts","../src/hooks/setEvaluator.ts","../src/hooks/setupClient.ts"],"sourcesContent":["import sdk from '@botpress/sdk'\n\nexport const z = sdk.z\n","import { z as Z } from '@botpress/sdk'\nimport { z } from '../utils/zui'\n\nimport { TestFunction } from 'vitest'\nimport { createTaskCollector, getCurrentSuite } from 'vitest/suite'\nimport { TestMetadata } from '../context'\nimport { Deferred } from '../utils/deferred'\n\nconst scenarioId = z\n .string()\n .trim()\n .min(1, 'Scenario ID/name must not be empty')\n .max(50, 'Scenario ID/name is too long')\n\nexport type ScenarioLike = Z.infer<typeof ScenarioLike>\nconst ScenarioLike = z.union([\n scenarioId,\n z.object({ name: scenarioId }).passthrough(),\n z.object({ id: scenarioId }).passthrough()\n])\n\nconst getScenarioName = (scenario: ScenarioLike) =>\n (typeof scenario === 'string' ? scenario : 'name' in scenario ? scenario?.name : scenario?.id) as string\n\nconst scenarioArgs = z\n .array(ScenarioLike)\n .min(2, 'You need at least two scenarios to compare')\n .max(10, 'You can only compare up to 10 scenarios')\n .refine((scenarios) => {\n const set = new Set<string>()\n scenarios.forEach((scenario) => set.add(getScenarioName(scenario)))\n return set.size === scenarios.length\n }, 'Scenarios names must be unique')\n\nexport function compare<T extends ReadonlyArray<ScenarioLike>>(\n name: string | Function,\n scenarios: T,\n fn?: TestFunction<{\n scenario: T[number]\n }>\n) {\n scenarios = scenarioArgs.parse(scenarios) as unknown as T\n\n return createTaskCollector((_name, fn, timeout) => {\n const currentSuite = getCurrentSuite()\n\n let completedCount = 0\n const finished = new Deferred<void>()\n\n for (const scenario of scenarios) {\n const key = getScenarioName(scenario)\n\n currentSuite.task(key, {\n meta: {\n scenario: key,\n isVaiTest: true\n } satisfies TestMetadata,\n handler: async (context) => {\n const extendedContext = Object.freeze({\n scenario\n })\n context.onTestFinished(() => {\n if (++completedCount === scenarios.length) {\n finished.resolve()\n }\n })\n\n await fn({ ...context, ...extendedContext })\n },\n timeout: timeout ?? 10_000\n })\n }\n })(name, fn)\n}\n","export class Deferred<T> {\n promise: Promise<T>\n private _resolve!: (value: T | PromiseLike<T>) => void\n private _reject!: (reason?: unknown) => void\n\n constructor() {\n this.promise = new Promise<T>((resolve, reject) => {\n this._resolve = resolve\n this._reject = reject\n })\n }\n\n resolve(value: T | PromiseLike<T>): void {\n this._resolve(value)\n }\n\n reject(reason?: unknown): void {\n this._reject(reason)\n }\n}\n","import type { Client } from '@botpress/client'\nimport { onTestFinished } from 'vitest'\nimport { getCurrentTest } from 'vitest/suite'\nimport { Models } from './models'\n\nexport type EvaluatorModel = (typeof Models)[number]['id']\n\nexport type TestMetadata = {\n isVaiTest: boolean\n scenario?: string\n evaluatorModel?: EvaluatorModel\n}\n\nconst getTestMetadata = (): TestMetadata => {\n const test = getCurrentTest()\n return (test?.meta ?? {\n isVaiTest: false\n }) as TestMetadata\n}\n\nclass VaiContext {\n #client: Client | null = null\n #wrapError = false\n\n get wrapError() {\n return this.#wrapError\n }\n\n get client() {\n if (!this.#client) {\n throw new Error('Botpress client is not set')\n }\n\n return this.#client\n }\n\n get evaluatorModel(): EvaluatorModel {\n return getTestMetadata().evaluatorModel ?? 'openai__gpt-4o-mini-2024-07-18'\n }\n\n get scenario() {\n return getTestMetadata().scenario\n }\n\n get isVaiTest() {\n return getTestMetadata().isVaiTest\n }\n\n setClient(cognitive: Client) {\n this.#client = cognitive\n }\n\n swallowErrors() {\n if (!getCurrentTest()) {\n throw new Error('cancelBail is a Vitest hook and must be called within a test')\n }\n\n this.#wrapError = true\n onTestFinished(() => {\n this.#wrapError = false\n })\n }\n}\n\nexport const Context = new VaiContext()\n","import { Assertion, expect } from 'vitest'\nimport { getCurrentTest } from 'vitest/suite'\nimport { Context } from '../context'\nimport { Output } from './predictJson'\n\nexport class AsyncExpectError<T> extends Error {\n constructor(message: string, public readonly output: Output<T>) {\n super(message)\n this.name = 'AsyncExpectError'\n }\n}\n\nconst getErrorMessages = (e: unknown): string => {\n if (e instanceof Error) {\n return e.message\n } else if (typeof e === 'string') {\n return e\n } else if (typeof e === 'object' && e !== null) {\n return JSON.stringify(e)\n }\n\n return `Unknown error: ${e}`\n}\n\nexport const asyncExpect = <T>(output: Promise<Output<T>>, assertion: (assert: Assertion<T>) => void) => {\n const promise = output.then((x) => {\n try {\n assertion(expect(x.result, x.reason))\n } catch (e: unknown) {\n if (Context.wrapError) {\n return new AsyncExpectError<T>(getErrorMessages(e), x)\n }\n throw e\n }\n return x\n })\n getCurrentTest()!.promises ??= []\n getCurrentTest()!.promises!.push(promise)\n return promise\n}\n","import { z } from '../utils/zui'\nimport { type ZodSchema, z as Z } from '@botpress/sdk'\nimport JSON5 from 'json5'\nimport { Context } from '../context'\nimport { llm } from '../sdk-interfaces/llm/generateContent'\n\nconst nonEmptyString = z.string().trim().min(1)\nconst nonEmptyObject = z\n .object({})\n .passthrough()\n .refine((value) => Object.keys(value).length > 0, {\n message: 'Expected a non-empty object'\n })\n\nexport type Input = Z.infer<typeof Input>\nconst Input = nonEmptyString.or(nonEmptyObject).or(z.array(z.any()))\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type Output<T = any> = Z.infer<typeof Output> & { result: T }\nconst Output = z.object({\n reason: nonEmptyString.describe('A human-readable explanation of the result'),\n result: z\n .any()\n .describe(\n 'Your best guess at the output according to the instructions provided, rooted in the context of the input and the reason above'\n )\n})\n\ntype Example = Z.infer<typeof Example>\nconst Example = z.object({\n input: Input,\n output: Output\n})\n\ntype InputOptions<T extends ZodSchema = ZodSchema> = Z.input<typeof Options> & { outputSchema: T }\ntype Options = Z.infer<typeof Options>\nconst Options = z.object({\n systemMessage: z.string(),\n examples: z.array(Example).default([]),\n input: Input,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n outputSchema: z.custom<ZodSchema<any>>((value) => typeof value === 'object' && value !== null && '_def' in value),\n model: z.string()\n})\n\ntype Message = {\n role: 'user' | 'assistant' | 'system'\n content: string\n}\n\nconst isValidExample =\n (outputSchema: ZodSchema) =>\n (example: Example): example is Example =>\n Input.safeParse(example.input).success &&\n Output.safeParse(example.output).success &&\n outputSchema.safeParse(example.output.result).success\n\nexport async function predictJson<T extends ZodSchema>(_options: InputOptions<T>): Promise<Output<Z.infer<T>>> {\n const options = Options.parse(_options)\n const [integration, model] = options.model.split('__')\n\n if (!model?.length) {\n throw new Error('Invalid model')\n }\n\n const exampleMessages = options.examples\n .filter(isValidExample(options.outputSchema))\n .flatMap(({ input, output }) => [\n { role: 'user', content: JSON.stringify(input, null, 2) } satisfies Message,\n { role: 'assistant', content: JSON.stringify(output, null, 2) } satisfies Message\n ])\n\n const outputSchema = Output.extend({\n result: options.outputSchema.describe(Output.shape.result.description!)\n })\n\n const result = await Context.client.callAction({\n type: `${integration}:generateContent`,\n input: {\n systemPrompt: `\n${options.systemMessage}\n\n---\nPlease generate a JSON response with the following format:\n\\`\\`\\`typescript\n${await outputSchema.toTypescriptAsync()}\n\\`\\`\\`\n`.trim(),\n messages: [\n ...exampleMessages,\n {\n role: 'user',\n content: JSON.stringify(options.input, null, 2)\n }\n ],\n temperature: 0,\n responseFormat: 'json_object',\n model: { id: model! }\n } satisfies llm.generateContent.Input\n })\n\n const output = result.output as llm.generateContent.Output\n\n if (!output.choices.length || typeof output.choices?.[0]?.content !== 'string') {\n throw new Error('Invalid response from the model')\n }\n\n const json = output.choices[0].content.trim()\n\n if (!json.length) {\n throw new Error('No response from the model')\n }\n\n return outputSchema.parse(JSON5.parse(json)) as Output<Z.infer<T>>\n}\n","import json5 from 'json5'\nimport { expect } from 'vitest'\nimport { getCurrentTest } from 'vitest/suite'\n\nimport { asyncExpect } from '../utils/asyncAssertion'\nimport { Output } from '../utils/predictJson'\n\nexport type ExtendedPromise<T> = PromiseLike<Output<T>> & {\n value: PromiseLike<T>\n}\n\nexport const toAssertion = <T>(promise: Promise<Output<T>>): ExtendedPromise<T> => {\n return {\n then: promise.then.bind(promise),\n value: promise.then((value) => value.result)\n }\n}\n\nexport const makeToMatchInlineSnapshot =\n <T>(promise: Promise<Output<T>>) =>\n async (expected?: string) => {\n const stack = new Error().stack!.split('\\n')[2]\n const newStack = `\nat __INLINE_SNAPSHOT__ (node:internal/process/task_queues:1:1)\nat randomLine (node:internal/process/task_queues:1:1)\n${stack}\n`.trim()\n\n const obj = json5.parse(expected ?? '\"\"')\n const expectation = asyncExpect(promise, (expect) => expect.toMatchObject(obj)).catch(() => {\n // we swallow the error here, as we're going to throw a new one with the correct stack\n // this is just to make vitest happy and show a nice error message\n })\n\n try {\n expect((await promise).result).toMatchObject(obj)\n } catch (err) {\n const newError = new Error()\n newError.stack = newStack\n\n expect.getState().snapshotState.match({\n isInline: true,\n received: (await promise).result,\n testName: getCurrentTest()!.name,\n error: newError,\n inlineSnapshot: expected\n })\n }\n\n return expectation\n }\n","import { z } from '../utils/zui'\nimport { Context } from '../context'\nimport { asyncExpect } from '../utils/asyncAssertion'\nimport { Input, predictJson } from '../utils/predictJson'\nimport { makeToMatchInlineSnapshot, toAssertion } from './extension'\n\nexport type CheckOptions<T> = {\n examples?: { value: T; expected: boolean; reason: string }[]\n}\n\nexport function check<T extends Input>(value: T, condition: string, options?: CheckOptions<T>) {\n const promise = predictJson({\n systemMessage: `Check that the value meets the condition: ${condition}`,\n examples: options?.examples?.map(({ value, reason, expected }) => ({\n input: value,\n output: { reason, result: expected }\n })),\n outputSchema: z.boolean(),\n model: Context.evaluatorModel,\n input: value\n })\n\n return {\n ...toAssertion(promise),\n toBe: (expected: boolean) => asyncExpect(promise, (expect) => expect.toEqual(expected)),\n toMatchInlineSnapshot: makeToMatchInlineSnapshot(promise)\n }\n}\n","import { z as Z } from '@botpress/sdk'\n\nimport { Context } from '../context'\nimport { asyncExpect } from '../utils/asyncAssertion'\nimport { Input, predictJson } from '../utils/predictJson'\nimport { makeToMatchInlineSnapshot, toAssertion } from './extension'\n\nexport type ExtractOptions<T, S> = {\n description?: string\n examples?: { value: T; extracted: S; reason: string }[]\n}\n\nexport function extract<T extends Input, S extends Z.AnyZodObject>(\n value: T,\n shape: S,\n options?: ExtractOptions<T, Z.infer<S>>\n) {\n const additionalMessage = options?.description\n ? `\\nIn order to extract the right information, follow these instructions:\\n${options.description}\\n`\n : ''\n const promise = predictJson({\n systemMessage:\n 'From the given input, extract the required information into the requested format.' + additionalMessage.trim(),\n examples: options?.examples?.map(({ value, reason, extracted }) => ({\n input: value,\n output: { reason, result: extracted }\n })),\n outputSchema: shape,\n model: Context.evaluatorModel,\n input: value\n })\n\n return {\n ...toAssertion(promise),\n toBe: (expected: Z.infer<S>) => asyncExpect(promise, (expect) => expect.toEqual(expected)),\n toMatchObject: (expected: Partial<Z.infer<S>>) => asyncExpect(promise, (expect) => expect.toMatchObject(expected)),\n toMatchInlineSnapshot: makeToMatchInlineSnapshot(promise)\n }\n}\n","import { z } from '../utils/zui'\n\nimport { Context } from '../context'\nimport { asyncExpect } from '../utils/asyncAssertion'\nimport { predictJson } from '../utils/predictJson'\nimport { makeToMatchInlineSnapshot, toAssertion } from './extension'\n\nexport type FilterOptions<T> = {\n examples?: { value: T; reason: string; keep: boolean }[]\n}\n\nexport function filter<U>(values: U[], condition: string, options?: FilterOptions<U>) {\n const mappedValues = values.map((_, idx) =>\n z.object({\n index: z.literal(idx),\n reason: z.string(),\n keep: z.boolean()\n })\n )\n\n const input = values.map((value, idx) => ({\n index: idx,\n value\n }))\n\n const schema = z\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .tuple(mappedValues as any)\n .describe(\n 'An array of the objects with the index and a boolean value indicating if the object should be kept or not'\n )\n\n const promise = predictJson({\n systemMessage: `\nBased on the following qualification criteria, you need to filter the given list of objects.\nCiteria: ${condition}\n\n---\nYou need to return an array of objects with the index and a boolean value indicating if the object should be kept or not.\n`.trim(),\n examples: options?.examples\n ? [\n {\n input: options?.examples?.map((v, index) => ({\n index,\n value: v.value\n })),\n output: {\n reason: 'Here are some examples',\n result: options?.examples?.map((v, idx) => ({\n index: idx,\n reason: v.reason,\n keep: v.keep\n }))\n }\n }\n ]\n : undefined,\n outputSchema: schema,\n model: Context.evaluatorModel,\n input\n }).then((x) => {\n const results = schema.parse(x.result) as { index: number; keep: boolean }[]\n return {\n result: values.filter((_, idx) => results.find((r) => r.index === idx)?.keep),\n reason: x.reason\n }\n })\n\n return {\n ...toAssertion(promise),\n toBe: (expected: U[]) => asyncExpect(promise, (expect) => expect.toEqual(expected)),\n toMatchInlineSnapshot: makeToMatchInlineSnapshot(promise),\n toHaveNoneFiltered: () => asyncExpect(promise, (expect) => expect.toEqual(values)),\n toHaveSomeFiltered: () => asyncExpect(promise, (expect) => expect.not.toEqual(values)),\n toBeEmpty: () => asyncExpect(promise, (expect) => expect.toHaveLength(0)),\n length: {\n toBe: (expected: number) => asyncExpect(promise, (expect) => expect.toHaveLength(expected)),\n toBeGreaterThanOrEqual: (expected: number) =>\n asyncExpect(promise, (expect) => expect.length.greaterThanOrEqual(expected)),\n toBeLessThanOrEqual: (expected: number) =>\n asyncExpect(promise, (expect) => expect.length.lessThanOrEqual(expected)),\n toBeBetween: (min: number, max: number) => asyncExpect(promise, (expect) => expect.length.within(min, max))\n }\n }\n}\n","import { z } from '../utils/zui'\n\nimport { Context } from '../context'\nimport { asyncExpect } from '../utils/asyncAssertion'\nimport { Input, predictJson } from '../utils/predictJson'\nimport { makeToMatchInlineSnapshot, toAssertion } from './extension'\n\nexport type RatingScore = 1 | 2 | 3 | 4 | 5\nexport type RateOptions<T> = {\n examples?: { value: T; rating: number; reason: string }[]\n}\n\nexport function rate<T extends Input>(value: T, condition: string, options?: RateOptions<T>) {\n const schema = z.number().min(1).max(5).describe('Rating score, higher is better (1 is the worst, 5 is the best)')\n const promise = predictJson({\n systemMessage: `Based on the following qualification criteria, you need to rate the given situation from a score of 1 to 5.\\nScoring: 1 is the worst score, 5 is the best score possible.\\nCriteria: ${condition}`,\n examples: options?.examples?.map(({ value, reason, rating }) => ({\n input: value,\n output: { reason, result: rating }\n })),\n outputSchema: schema,\n model: Context.evaluatorModel,\n input: value\n }).then((x) => {\n return {\n result: typeof x.result === 'number' ? x.result : parseInt(x.result, 10),\n reason: x.reason\n }\n })\n\n return {\n ...toAssertion(promise),\n toBe: (expected: number) => asyncExpect(promise, (expect) => expect.toEqual(expected)),\n toMatchInlineSnapshot: makeToMatchInlineSnapshot(promise),\n toBeGreaterThanOrEqual: (expected: RatingScore) =>\n asyncExpect(promise, (expect) => expect.toBeGreaterThanOrEqual(expected)),\n toBeLessThanOrEqual: (expected: RatingScore) =>\n asyncExpect(promise, (expect) => expect.toBeLessThanOrEqual(expected))\n }\n}\n","import { getCurrentTest } from 'vitest/suite'\nimport { EvaluatorModel, TestMetadata } from '../context'\n\nexport const setEvaluator = (model: EvaluatorModel) => {\n const test = getCurrentTest()\n\n if (!test) {\n throw new Error('setEvaluator is a Vitest hook and must be called within a test')\n }\n\n const meta = test.meta as TestMetadata\n meta.evaluatorModel = model\n}\n","import { Client } from '@botpress/client'\nimport { Context } from '../context'\n\nexport const setupClient = (client: Client) => {\n Context.setClient(client)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,SAAS;AAET,IAAM,IAAI,IAAI;;;ACErB,SAAS,qBAAqB,uBAAuB;;;ACJ9C,IAAM,YAAN,MAAM,UAAY;AAAA,EAKvB,cAAc;AACZ,SAAK,UAAU,IAAI,QAAW,CAAC,SAAS,WAAW;AACjD,WAAK,WAAW;AAChB,WAAK,UAAU;AAAA,IACjB,CAAC;AAAA,EACH;AAAA,EAEA,QAAQ,OAAiC;AACvC,SAAK,SAAS,KAAK;AAAA,EACrB;AAAA,EAEA,OAAO,QAAwB;AAC7B,SAAK,QAAQ,MAAM;AAAA,EACrB;AACF;AAnByB;AAAlB,IAAM,WAAN;;;ADQP,IAAM,aAAa,EAChB,OAAO,EACP,KA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B,IAAM,cAAc,wBAAC,WAAmB;AAC7C,UAAQ,UAAU,MAAM;AAC1B,GAF2B;","names":["fn","getCurrentTest","getCurrentTest","output","expect","getCurrentTest","expect","getCurrentTest","value","expect","value","expect","_a","expect","value","expect","getCurrentTest","getCurrentTest"]}
|