@botpress/zai 1.0.1-beta.3 → 1.0.1-beta.5
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/browser/index.js +1 -4
- package/dist/index.d.ts +917 -0
- package/dist/index.js +1743 -0
- package/dist/node/adapters/adapter.d.js +0 -0
- package/dist/node/adapters/botpress-table.d.js +1 -0
- package/dist/node/adapters/botpress-table.js +1 -4
- package/dist/node/adapters/memory.d.js +0 -0
- package/dist/node/index.d.js +9 -0
- package/dist/node/models.d.js +0 -0
- package/dist/node/operations/check.d.js +1 -0
- package/dist/node/operations/check.test.d.js +1 -0
- package/dist/node/operations/constants.d.js +0 -0
- package/dist/node/operations/errors.d.js +0 -0
- package/dist/node/operations/extract.d.js +1 -0
- package/dist/node/operations/extract.test.d.js +1 -0
- package/dist/node/operations/filter.d.js +1 -0
- package/dist/node/operations/filter.test.d.js +1 -0
- package/dist/node/operations/label.d.js +1 -0
- package/dist/node/operations/label.test.d.js +1 -0
- package/dist/node/operations/rewrite.d.js +1 -0
- package/dist/node/operations/rewrite.test.d.js +1 -0
- package/dist/node/operations/summarize.d.js +1 -0
- package/dist/node/operations/summarize.test.d.js +1 -0
- package/dist/node/operations/text.d.js +1 -0
- package/dist/node/operations/text.test.d.js +1 -0
- package/dist/node/operations/zai-learn.test.d.js +1 -0
- package/dist/node/operations/zai-retry.test.d.js +1 -0
- package/dist/node/utils.d.js +0 -0
- package/dist/node/zai.d.js +1 -0
- package/package.json +5 -14
- package/src/adapters/adapter.d.ts +27 -0
- package/src/adapters/botpress-table.d.ts +153 -0
- package/src/adapters/botpress-table.ts +1 -4
- package/src/adapters/memory.d.ts +7 -0
- package/src/index.d.ts +9 -0
- package/src/models.d.ts +351 -0
- package/src/operations/__tests/index.d.ts +20 -0
- package/src/operations/check.d.ts +36 -0
- package/src/operations/check.test.d.ts +1 -0
- package/src/operations/constants.d.ts +2 -0
- package/src/operations/errors.d.ts +5 -0
- package/src/operations/extract.d.ts +20 -0
- package/src/operations/extract.test.d.ts +1 -0
- package/src/operations/filter.d.ts +39 -0
- package/src/operations/filter.test.d.ts +1 -0
- package/src/operations/label.d.ts +79 -0
- package/src/operations/label.test.d.ts +1 -0
- package/src/operations/rewrite.d.ts +34 -0
- package/src/operations/rewrite.test.d.ts +1 -0
- package/src/operations/summarize.d.ts +46 -0
- package/src/operations/summarize.test.d.ts +1 -0
- package/src/operations/text.d.ts +16 -0
- package/src/operations/text.test.d.ts +1 -0
- package/src/operations/zai-learn.test.d.ts +1 -0
- package/src/operations/zai-retry.test.d.ts +1 -0
- package/src/sdk-interfaces/llm/generateContent.d.ts +128 -0
- package/src/sdk-interfaces/llm/listLanguageModels.d.ts +25 -0
- package/src/utils.d.ts +52 -0
- package/src/utils.ts +1 -1
- package/src/zai.d.ts +99 -0
- package/tsconfig.json +2 -2
- package/scripts/update-models.mts +0 -76
- package/scripts/update-types.mts +0 -49
- package/tsup.config.ts +0 -16
- package/vitest.config.ts +0 -9
- package/vitest.setup.ts +0 -24
package/src/models.d.ts
ADDED
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
export declare const Models: readonly [{
|
|
2
|
+
readonly id: "anthropic__claude-3-haiku-20240307";
|
|
3
|
+
readonly name: "Claude 3 Haiku";
|
|
4
|
+
readonly integration: "anthropic";
|
|
5
|
+
readonly input: {
|
|
6
|
+
readonly maxTokens: 200000;
|
|
7
|
+
};
|
|
8
|
+
readonly output: {
|
|
9
|
+
readonly maxTokens: 4096;
|
|
10
|
+
};
|
|
11
|
+
}, {
|
|
12
|
+
readonly id: "anthropic__claude-3-5-sonnet-20240620";
|
|
13
|
+
readonly name: "Claude 3.5 Sonnet";
|
|
14
|
+
readonly integration: "anthropic";
|
|
15
|
+
readonly input: {
|
|
16
|
+
readonly maxTokens: 200000;
|
|
17
|
+
};
|
|
18
|
+
readonly output: {
|
|
19
|
+
readonly maxTokens: 4096;
|
|
20
|
+
};
|
|
21
|
+
}, {
|
|
22
|
+
readonly id: "cerebras__llama3.1-70b";
|
|
23
|
+
readonly name: "Llama 3.1 70B";
|
|
24
|
+
readonly integration: "cerebras";
|
|
25
|
+
readonly input: {
|
|
26
|
+
readonly maxTokens: 8192;
|
|
27
|
+
};
|
|
28
|
+
readonly output: {
|
|
29
|
+
readonly maxTokens: 8192;
|
|
30
|
+
};
|
|
31
|
+
}, {
|
|
32
|
+
readonly id: "cerebras__llama3.1-8b";
|
|
33
|
+
readonly name: "Llama 3.1 8B";
|
|
34
|
+
readonly integration: "cerebras";
|
|
35
|
+
readonly input: {
|
|
36
|
+
readonly maxTokens: 8192;
|
|
37
|
+
};
|
|
38
|
+
readonly output: {
|
|
39
|
+
readonly maxTokens: 8192;
|
|
40
|
+
};
|
|
41
|
+
}, {
|
|
42
|
+
readonly id: "fireworks-ai__accounts/fireworks/models/deepseek-coder-v2-instruct";
|
|
43
|
+
readonly name: "DeepSeek Coder V2 Instruct";
|
|
44
|
+
readonly integration: "fireworks-ai";
|
|
45
|
+
readonly input: {
|
|
46
|
+
readonly maxTokens: 131072;
|
|
47
|
+
};
|
|
48
|
+
readonly output: {
|
|
49
|
+
readonly maxTokens: 131072;
|
|
50
|
+
};
|
|
51
|
+
}, {
|
|
52
|
+
readonly id: "fireworks-ai__accounts/fireworks/models/deepseek-coder-v2-lite-instruct";
|
|
53
|
+
readonly name: "DeepSeek Coder V2 Lite";
|
|
54
|
+
readonly integration: "fireworks-ai";
|
|
55
|
+
readonly input: {
|
|
56
|
+
readonly maxTokens: 163840;
|
|
57
|
+
};
|
|
58
|
+
readonly output: {
|
|
59
|
+
readonly maxTokens: 163840;
|
|
60
|
+
};
|
|
61
|
+
}, {
|
|
62
|
+
readonly id: "fireworks-ai__accounts/fireworks/models/firellava-13b";
|
|
63
|
+
readonly name: "FireLLaVA-13B";
|
|
64
|
+
readonly integration: "fireworks-ai";
|
|
65
|
+
readonly input: {
|
|
66
|
+
readonly maxTokens: 4096;
|
|
67
|
+
};
|
|
68
|
+
readonly output: {
|
|
69
|
+
readonly maxTokens: 4096;
|
|
70
|
+
};
|
|
71
|
+
}, {
|
|
72
|
+
readonly id: "fireworks-ai__accounts/fireworks/models/firefunction-v2";
|
|
73
|
+
readonly name: "Firefunction V2";
|
|
74
|
+
readonly integration: "fireworks-ai";
|
|
75
|
+
readonly input: {
|
|
76
|
+
readonly maxTokens: 8192;
|
|
77
|
+
};
|
|
78
|
+
readonly output: {
|
|
79
|
+
readonly maxTokens: 8192;
|
|
80
|
+
};
|
|
81
|
+
}, {
|
|
82
|
+
readonly id: "fireworks-ai__accounts/fireworks/models/gemma2-9b-it";
|
|
83
|
+
readonly name: "Gemma 2 9B Instruct";
|
|
84
|
+
readonly integration: "fireworks-ai";
|
|
85
|
+
readonly input: {
|
|
86
|
+
readonly maxTokens: 8192;
|
|
87
|
+
};
|
|
88
|
+
readonly output: {
|
|
89
|
+
readonly maxTokens: 8192;
|
|
90
|
+
};
|
|
91
|
+
}, {
|
|
92
|
+
readonly id: "fireworks-ai__accounts/fireworks/models/llama-v3p1-405b-instruct";
|
|
93
|
+
readonly name: "Llama 3.1 405B Instruct";
|
|
94
|
+
readonly integration: "fireworks-ai";
|
|
95
|
+
readonly input: {
|
|
96
|
+
readonly maxTokens: 131072;
|
|
97
|
+
};
|
|
98
|
+
readonly output: {
|
|
99
|
+
readonly maxTokens: 131072;
|
|
100
|
+
};
|
|
101
|
+
}, {
|
|
102
|
+
readonly id: "fireworks-ai__accounts/fireworks/models/llama-v3p1-70b-instruct";
|
|
103
|
+
readonly name: "Llama 3.1 70B Instruct";
|
|
104
|
+
readonly integration: "fireworks-ai";
|
|
105
|
+
readonly input: {
|
|
106
|
+
readonly maxTokens: 131072;
|
|
107
|
+
};
|
|
108
|
+
readonly output: {
|
|
109
|
+
readonly maxTokens: 131072;
|
|
110
|
+
};
|
|
111
|
+
}, {
|
|
112
|
+
readonly id: "fireworks-ai__accounts/fireworks/models/llama-v3p1-8b-instruct";
|
|
113
|
+
readonly name: "Llama 3.1 8B Instruct";
|
|
114
|
+
readonly integration: "fireworks-ai";
|
|
115
|
+
readonly input: {
|
|
116
|
+
readonly maxTokens: 131072;
|
|
117
|
+
};
|
|
118
|
+
readonly output: {
|
|
119
|
+
readonly maxTokens: 131072;
|
|
120
|
+
};
|
|
121
|
+
}, {
|
|
122
|
+
readonly id: "fireworks-ai__accounts/fireworks/models/mixtral-8x22b-instruct";
|
|
123
|
+
readonly name: "Mixtral MoE 8x22B Instruct";
|
|
124
|
+
readonly integration: "fireworks-ai";
|
|
125
|
+
readonly input: {
|
|
126
|
+
readonly maxTokens: 65536;
|
|
127
|
+
};
|
|
128
|
+
readonly output: {
|
|
129
|
+
readonly maxTokens: 65536;
|
|
130
|
+
};
|
|
131
|
+
}, {
|
|
132
|
+
readonly id: "fireworks-ai__accounts/fireworks/models/mixtral-8x7b-instruct";
|
|
133
|
+
readonly name: "Mixtral MoE 8x7B Instruct";
|
|
134
|
+
readonly integration: "fireworks-ai";
|
|
135
|
+
readonly input: {
|
|
136
|
+
readonly maxTokens: 32768;
|
|
137
|
+
};
|
|
138
|
+
readonly output: {
|
|
139
|
+
readonly maxTokens: 32768;
|
|
140
|
+
};
|
|
141
|
+
}, {
|
|
142
|
+
readonly id: "fireworks-ai__accounts/fireworks/models/mythomax-l2-13b";
|
|
143
|
+
readonly name: "MythoMax L2 13b";
|
|
144
|
+
readonly integration: "fireworks-ai";
|
|
145
|
+
readonly input: {
|
|
146
|
+
readonly maxTokens: 4096;
|
|
147
|
+
};
|
|
148
|
+
readonly output: {
|
|
149
|
+
readonly maxTokens: 4096;
|
|
150
|
+
};
|
|
151
|
+
}, {
|
|
152
|
+
readonly id: "fireworks-ai__accounts/fireworks/models/qwen2-72b-instruct";
|
|
153
|
+
readonly name: "Qwen2 72b Instruct";
|
|
154
|
+
readonly integration: "fireworks-ai";
|
|
155
|
+
readonly input: {
|
|
156
|
+
readonly maxTokens: 32768;
|
|
157
|
+
};
|
|
158
|
+
readonly output: {
|
|
159
|
+
readonly maxTokens: 32768;
|
|
160
|
+
};
|
|
161
|
+
}, {
|
|
162
|
+
readonly id: "groq__gemma2-9b-it";
|
|
163
|
+
readonly name: "Gemma2 9B";
|
|
164
|
+
readonly integration: "groq";
|
|
165
|
+
readonly input: {
|
|
166
|
+
readonly maxTokens: 8192;
|
|
167
|
+
};
|
|
168
|
+
readonly output: {
|
|
169
|
+
readonly maxTokens: 8192;
|
|
170
|
+
};
|
|
171
|
+
}, {
|
|
172
|
+
readonly id: "groq__llama3-70b-8192";
|
|
173
|
+
readonly name: "LLaMA 3 70B";
|
|
174
|
+
readonly integration: "groq";
|
|
175
|
+
readonly input: {
|
|
176
|
+
readonly maxTokens: 8192;
|
|
177
|
+
};
|
|
178
|
+
readonly output: {
|
|
179
|
+
readonly maxTokens: 8192;
|
|
180
|
+
};
|
|
181
|
+
}, {
|
|
182
|
+
readonly id: "groq__llama3-8b-8192";
|
|
183
|
+
readonly name: "LLaMA 3 8B";
|
|
184
|
+
readonly integration: "groq";
|
|
185
|
+
readonly input: {
|
|
186
|
+
readonly maxTokens: 8192;
|
|
187
|
+
};
|
|
188
|
+
readonly output: {
|
|
189
|
+
readonly maxTokens: 8192;
|
|
190
|
+
};
|
|
191
|
+
}, {
|
|
192
|
+
readonly id: "groq__llama-3.1-70b-versatile";
|
|
193
|
+
readonly name: "LLaMA 3.1 70B";
|
|
194
|
+
readonly integration: "groq";
|
|
195
|
+
readonly input: {
|
|
196
|
+
readonly maxTokens: 128000;
|
|
197
|
+
};
|
|
198
|
+
readonly output: {
|
|
199
|
+
readonly maxTokens: 8192;
|
|
200
|
+
};
|
|
201
|
+
}, {
|
|
202
|
+
readonly id: "groq__llama-3.1-8b-instant";
|
|
203
|
+
readonly name: "LLaMA 3.1 8B";
|
|
204
|
+
readonly integration: "groq";
|
|
205
|
+
readonly input: {
|
|
206
|
+
readonly maxTokens: 128000;
|
|
207
|
+
};
|
|
208
|
+
readonly output: {
|
|
209
|
+
readonly maxTokens: 8192;
|
|
210
|
+
};
|
|
211
|
+
}, {
|
|
212
|
+
readonly id: "groq__llama-3.2-11b-vision-preview";
|
|
213
|
+
readonly name: "LLaMA 3.2 11B Vision";
|
|
214
|
+
readonly integration: "groq";
|
|
215
|
+
readonly input: {
|
|
216
|
+
readonly maxTokens: 128000;
|
|
217
|
+
};
|
|
218
|
+
readonly output: {
|
|
219
|
+
readonly maxTokens: 8192;
|
|
220
|
+
};
|
|
221
|
+
}, {
|
|
222
|
+
readonly id: "groq__llama-3.2-1b-preview";
|
|
223
|
+
readonly name: "LLaMA 3.2 1B";
|
|
224
|
+
readonly integration: "groq";
|
|
225
|
+
readonly input: {
|
|
226
|
+
readonly maxTokens: 128000;
|
|
227
|
+
};
|
|
228
|
+
readonly output: {
|
|
229
|
+
readonly maxTokens: 8192;
|
|
230
|
+
};
|
|
231
|
+
}, {
|
|
232
|
+
readonly id: "groq__llama-3.2-3b-preview";
|
|
233
|
+
readonly name: "LLaMA 3.2 3B";
|
|
234
|
+
readonly integration: "groq";
|
|
235
|
+
readonly input: {
|
|
236
|
+
readonly maxTokens: 128000;
|
|
237
|
+
};
|
|
238
|
+
readonly output: {
|
|
239
|
+
readonly maxTokens: 8192;
|
|
240
|
+
};
|
|
241
|
+
}, {
|
|
242
|
+
readonly id: "groq__llama-3.2-90b-vision-preview";
|
|
243
|
+
readonly name: "LLaMA 3.2 90B Vision";
|
|
244
|
+
readonly integration: "groq";
|
|
245
|
+
readonly input: {
|
|
246
|
+
readonly maxTokens: 128000;
|
|
247
|
+
};
|
|
248
|
+
readonly output: {
|
|
249
|
+
readonly maxTokens: 8192;
|
|
250
|
+
};
|
|
251
|
+
}, {
|
|
252
|
+
readonly id: "groq__llama-3.3-70b-versatile";
|
|
253
|
+
readonly name: "LLaMA 3.3 70B";
|
|
254
|
+
readonly integration: "groq";
|
|
255
|
+
readonly input: {
|
|
256
|
+
readonly maxTokens: 128000;
|
|
257
|
+
};
|
|
258
|
+
readonly output: {
|
|
259
|
+
readonly maxTokens: 32768;
|
|
260
|
+
};
|
|
261
|
+
}, {
|
|
262
|
+
readonly id: "groq__mixtral-8x7b-32768";
|
|
263
|
+
readonly name: "Mixtral 8x7B";
|
|
264
|
+
readonly integration: "groq";
|
|
265
|
+
readonly input: {
|
|
266
|
+
readonly maxTokens: 32768;
|
|
267
|
+
};
|
|
268
|
+
readonly output: {
|
|
269
|
+
readonly maxTokens: 32768;
|
|
270
|
+
};
|
|
271
|
+
}, {
|
|
272
|
+
readonly id: "openai__o1-2024-12-17";
|
|
273
|
+
readonly name: "GPT o1";
|
|
274
|
+
readonly integration: "openai";
|
|
275
|
+
readonly input: {
|
|
276
|
+
readonly maxTokens: 200000;
|
|
277
|
+
};
|
|
278
|
+
readonly output: {
|
|
279
|
+
readonly maxTokens: 100000;
|
|
280
|
+
};
|
|
281
|
+
}, {
|
|
282
|
+
readonly id: "openai__o1-mini-2024-09-12";
|
|
283
|
+
readonly name: "GPT o1-mini";
|
|
284
|
+
readonly integration: "openai";
|
|
285
|
+
readonly input: {
|
|
286
|
+
readonly maxTokens: 128000;
|
|
287
|
+
};
|
|
288
|
+
readonly output: {
|
|
289
|
+
readonly maxTokens: 65536;
|
|
290
|
+
};
|
|
291
|
+
}, {
|
|
292
|
+
readonly id: "openai__gpt-3.5-turbo-0125";
|
|
293
|
+
readonly name: "GPT-3.5 Turbo";
|
|
294
|
+
readonly integration: "openai";
|
|
295
|
+
readonly input: {
|
|
296
|
+
readonly maxTokens: 128000;
|
|
297
|
+
};
|
|
298
|
+
readonly output: {
|
|
299
|
+
readonly maxTokens: 4096;
|
|
300
|
+
};
|
|
301
|
+
}, {
|
|
302
|
+
readonly id: "openai__gpt-4-turbo-2024-04-09";
|
|
303
|
+
readonly name: "GPT-4 Turbo";
|
|
304
|
+
readonly integration: "openai";
|
|
305
|
+
readonly input: {
|
|
306
|
+
readonly maxTokens: 128000;
|
|
307
|
+
};
|
|
308
|
+
readonly output: {
|
|
309
|
+
readonly maxTokens: 4096;
|
|
310
|
+
};
|
|
311
|
+
}, {
|
|
312
|
+
readonly id: "openai__gpt-4o-2024-08-06";
|
|
313
|
+
readonly name: "GPT-4o (August 2024)";
|
|
314
|
+
readonly integration: "openai";
|
|
315
|
+
readonly input: {
|
|
316
|
+
readonly maxTokens: 128000;
|
|
317
|
+
};
|
|
318
|
+
readonly output: {
|
|
319
|
+
readonly maxTokens: 16384;
|
|
320
|
+
};
|
|
321
|
+
}, {
|
|
322
|
+
readonly id: "openai__gpt-4o-2024-05-13";
|
|
323
|
+
readonly name: "GPT-4o (May 2024)";
|
|
324
|
+
readonly integration: "openai";
|
|
325
|
+
readonly input: {
|
|
326
|
+
readonly maxTokens: 128000;
|
|
327
|
+
};
|
|
328
|
+
readonly output: {
|
|
329
|
+
readonly maxTokens: 4096;
|
|
330
|
+
};
|
|
331
|
+
}, {
|
|
332
|
+
readonly id: "openai__gpt-4o-2024-11-20";
|
|
333
|
+
readonly name: "GPT-4o (November 2024)";
|
|
334
|
+
readonly integration: "openai";
|
|
335
|
+
readonly input: {
|
|
336
|
+
readonly maxTokens: 128000;
|
|
337
|
+
};
|
|
338
|
+
readonly output: {
|
|
339
|
+
readonly maxTokens: 16384;
|
|
340
|
+
};
|
|
341
|
+
}, {
|
|
342
|
+
readonly id: "openai__gpt-4o-mini-2024-07-18";
|
|
343
|
+
readonly name: "GPT-4o Mini";
|
|
344
|
+
readonly integration: "openai";
|
|
345
|
+
readonly input: {
|
|
346
|
+
readonly maxTokens: 128000;
|
|
347
|
+
};
|
|
348
|
+
readonly output: {
|
|
349
|
+
readonly maxTokens: 16384;
|
|
350
|
+
};
|
|
351
|
+
}];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Client } from '@botpress/client';
|
|
2
|
+
import { type TextTokenizer } from '@botpress/wasm';
|
|
3
|
+
import { Zai } from '../..';
|
|
4
|
+
export declare const getClient: () => Client;
|
|
5
|
+
export declare const getCachedClient: () => Client;
|
|
6
|
+
export declare const getZai: () => Zai;
|
|
7
|
+
export declare let tokenizer: TextTokenizer;
|
|
8
|
+
export declare const BotpressDocumentation: string;
|
|
9
|
+
export declare const metadata: {
|
|
10
|
+
cost: {
|
|
11
|
+
input: number;
|
|
12
|
+
output: number;
|
|
13
|
+
};
|
|
14
|
+
latency: number;
|
|
15
|
+
model: string;
|
|
16
|
+
tokens: {
|
|
17
|
+
input: number;
|
|
18
|
+
output: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from '@bpinternal/zui';
|
|
2
|
+
export type Options = z.input<typeof Options>;
|
|
3
|
+
declare const Options: import("@bpinternal/zui").ZodObject<{
|
|
4
|
+
examples: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
5
|
+
input: import("@bpinternal/zui").ZodAny;
|
|
6
|
+
check: import("@bpinternal/zui").ZodBoolean;
|
|
7
|
+
reason: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
8
|
+
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
9
|
+
input?: any;
|
|
10
|
+
check?: boolean;
|
|
11
|
+
reason?: string;
|
|
12
|
+
}, {
|
|
13
|
+
input?: any;
|
|
14
|
+
check?: boolean;
|
|
15
|
+
reason?: string;
|
|
16
|
+
}>, "many">>;
|
|
17
|
+
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
18
|
+
examples?: {
|
|
19
|
+
input?: any;
|
|
20
|
+
check?: boolean;
|
|
21
|
+
reason?: string;
|
|
22
|
+
}[];
|
|
23
|
+
}, {
|
|
24
|
+
examples?: {
|
|
25
|
+
input?: any;
|
|
26
|
+
check?: boolean;
|
|
27
|
+
reason?: string;
|
|
28
|
+
}[];
|
|
29
|
+
}>;
|
|
30
|
+
declare module '@botpress/zai' {
|
|
31
|
+
interface Zai {
|
|
32
|
+
/** Checks wether a condition is true or not */
|
|
33
|
+
check(input: unknown, condition: string, options?: Options): Promise<boolean>;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from '@bpinternal/zui';
|
|
2
|
+
export type Options = z.input<typeof Options>;
|
|
3
|
+
declare const Options: import("@bpinternal/zui").ZodObject<{
|
|
4
|
+
instructions: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
5
|
+
chunkLength: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodNumber>>;
|
|
6
|
+
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
7
|
+
instructions?: string;
|
|
8
|
+
chunkLength?: number;
|
|
9
|
+
}, {
|
|
10
|
+
instructions?: string;
|
|
11
|
+
chunkLength?: number;
|
|
12
|
+
}>;
|
|
13
|
+
declare module '@botpress/zai' {
|
|
14
|
+
interface Zai {
|
|
15
|
+
/** Extracts one or many elements from an arbitrary input */
|
|
16
|
+
extract<S extends z.AnyZodObject>(input: unknown, schema: S, options?: Options): Promise<z.infer<S>>;
|
|
17
|
+
extract<S extends z.AnyZodObject>(input: unknown, schema: z.ZodArray<S>, options?: Options): Promise<Array<z.infer<S>>>;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from '@bpinternal/zui';
|
|
2
|
+
export type Options = z.input<typeof Options>;
|
|
3
|
+
declare const Options: import("@bpinternal/zui").ZodObject<{
|
|
4
|
+
tokensPerItem: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodNumber>>;
|
|
5
|
+
examples: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
6
|
+
input: import("@bpinternal/zui").ZodAny;
|
|
7
|
+
filter: import("@bpinternal/zui").ZodBoolean;
|
|
8
|
+
reason: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
9
|
+
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
10
|
+
input?: any;
|
|
11
|
+
filter?: boolean;
|
|
12
|
+
reason?: string;
|
|
13
|
+
}, {
|
|
14
|
+
input?: any;
|
|
15
|
+
filter?: boolean;
|
|
16
|
+
reason?: string;
|
|
17
|
+
}>, "many">>;
|
|
18
|
+
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
19
|
+
examples?: {
|
|
20
|
+
input?: any;
|
|
21
|
+
filter?: boolean;
|
|
22
|
+
reason?: string;
|
|
23
|
+
}[];
|
|
24
|
+
tokensPerItem?: number;
|
|
25
|
+
}, {
|
|
26
|
+
examples?: {
|
|
27
|
+
input?: any;
|
|
28
|
+
filter?: boolean;
|
|
29
|
+
reason?: string;
|
|
30
|
+
}[];
|
|
31
|
+
tokensPerItem?: number;
|
|
32
|
+
}>;
|
|
33
|
+
declare module '@botpress/zai' {
|
|
34
|
+
interface Zai {
|
|
35
|
+
/** Filters elements of an array against a condition */
|
|
36
|
+
filter<T>(input: Array<T>, condition: string, options?: Options): Promise<Array<T>>;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { z } from '@bpinternal/zui';
|
|
2
|
+
type Label = keyof typeof LABELS;
|
|
3
|
+
declare const LABELS: {
|
|
4
|
+
readonly ABSOLUTELY_NOT: "ABSOLUTELY_NOT";
|
|
5
|
+
readonly PROBABLY_NOT: "PROBABLY_NOT";
|
|
6
|
+
readonly AMBIGUOUS: "AMBIGUOUS";
|
|
7
|
+
readonly PROBABLY_YES: "PROBABLY_YES";
|
|
8
|
+
readonly ABSOLUTELY_YES: "ABSOLUTELY_YES";
|
|
9
|
+
};
|
|
10
|
+
type Example<T extends string> = {
|
|
11
|
+
input: unknown;
|
|
12
|
+
labels: Partial<Record<T, {
|
|
13
|
+
label: Label;
|
|
14
|
+
explanation?: string;
|
|
15
|
+
}>>;
|
|
16
|
+
};
|
|
17
|
+
export type Options<T extends string> = Omit<z.input<typeof Options>, 'examples'> & {
|
|
18
|
+
examples?: Array<Partial<Example<T>>>;
|
|
19
|
+
};
|
|
20
|
+
declare const Options: import("@bpinternal/zui").ZodObject<{
|
|
21
|
+
examples: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
22
|
+
input: import("@bpinternal/zui").ZodAny;
|
|
23
|
+
labels: import("@bpinternal/zui").ZodRecord<import("@bpinternal/zui").ZodString, import("@bpinternal/zui").ZodObject<{
|
|
24
|
+
label: import("@bpinternal/zui").ZodEnum<never>;
|
|
25
|
+
explanation: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
26
|
+
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
27
|
+
label: never;
|
|
28
|
+
explanation?: string;
|
|
29
|
+
}, {
|
|
30
|
+
label: never;
|
|
31
|
+
explanation?: string;
|
|
32
|
+
}>>;
|
|
33
|
+
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
34
|
+
input?: any;
|
|
35
|
+
labels?: Record<string, {
|
|
36
|
+
label: never;
|
|
37
|
+
explanation?: string;
|
|
38
|
+
}>;
|
|
39
|
+
}, {
|
|
40
|
+
input?: any;
|
|
41
|
+
labels?: Record<string, {
|
|
42
|
+
label: never;
|
|
43
|
+
explanation?: string;
|
|
44
|
+
}>;
|
|
45
|
+
}>, "many">>;
|
|
46
|
+
instructions: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
47
|
+
chunkLength: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodNumber>>;
|
|
48
|
+
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
49
|
+
instructions?: string;
|
|
50
|
+
examples?: {
|
|
51
|
+
input?: any;
|
|
52
|
+
labels?: Record<string, {
|
|
53
|
+
label: never;
|
|
54
|
+
explanation?: string;
|
|
55
|
+
}>;
|
|
56
|
+
}[];
|
|
57
|
+
chunkLength?: number;
|
|
58
|
+
}, {
|
|
59
|
+
instructions?: string;
|
|
60
|
+
examples?: {
|
|
61
|
+
input?: any;
|
|
62
|
+
labels?: Record<string, {
|
|
63
|
+
label: never;
|
|
64
|
+
explanation?: string;
|
|
65
|
+
}>;
|
|
66
|
+
}[];
|
|
67
|
+
chunkLength?: number;
|
|
68
|
+
}>;
|
|
69
|
+
type Labels<T extends string> = Record<T, string>;
|
|
70
|
+
declare const Labels: z.ZodTransformer<import("@bpinternal/zui").ZodRecord<import("@bpinternal/zui").ZodString, import("@bpinternal/zui").ZodString>, Record<string, string>, Record<string, string>>;
|
|
71
|
+
declare module '@botpress/zai' {
|
|
72
|
+
interface Zai {
|
|
73
|
+
/** Tags the provided input with a list of predefined labels */
|
|
74
|
+
label<T extends string>(input: unknown, labels: Labels<T>, options?: Options<T>): Promise<{
|
|
75
|
+
[K in T]: boolean;
|
|
76
|
+
}>;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from '@bpinternal/zui';
|
|
2
|
+
export type Options = z.input<typeof Options>;
|
|
3
|
+
declare const Options: import("@bpinternal/zui").ZodObject<{
|
|
4
|
+
examples: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
5
|
+
input: import("@bpinternal/zui").ZodString;
|
|
6
|
+
output: import("@bpinternal/zui").ZodString;
|
|
7
|
+
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
8
|
+
input?: string;
|
|
9
|
+
output?: string;
|
|
10
|
+
}, {
|
|
11
|
+
input?: string;
|
|
12
|
+
output?: string;
|
|
13
|
+
}>, "many">>;
|
|
14
|
+
length: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodNumber>;
|
|
15
|
+
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
16
|
+
length?: number;
|
|
17
|
+
examples?: {
|
|
18
|
+
input?: string;
|
|
19
|
+
output?: string;
|
|
20
|
+
}[];
|
|
21
|
+
}, {
|
|
22
|
+
length?: number;
|
|
23
|
+
examples?: {
|
|
24
|
+
input?: string;
|
|
25
|
+
output?: string;
|
|
26
|
+
}[];
|
|
27
|
+
}>;
|
|
28
|
+
declare module '@botpress/zai' {
|
|
29
|
+
interface Zai {
|
|
30
|
+
/** Rewrites a string according to match the prompt */
|
|
31
|
+
rewrite(original: string, prompt: string, options?: Options): Promise<string>;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from '@bpinternal/zui';
|
|
2
|
+
export type Options = z.input<typeof Options>;
|
|
3
|
+
declare const Options: import("@bpinternal/zui").ZodObject<{
|
|
4
|
+
prompt: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodString>;
|
|
5
|
+
format: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodString>;
|
|
6
|
+
length: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodNumber>;
|
|
7
|
+
intermediateFactor: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodNumber>;
|
|
8
|
+
maxIterations: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodNumber>;
|
|
9
|
+
sliding: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodObject<{
|
|
10
|
+
window: import("@bpinternal/zui").ZodNumber;
|
|
11
|
+
overlap: import("@bpinternal/zui").ZodNumber;
|
|
12
|
+
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
13
|
+
window?: number;
|
|
14
|
+
overlap?: number;
|
|
15
|
+
}, {
|
|
16
|
+
window?: number;
|
|
17
|
+
overlap?: number;
|
|
18
|
+
}>>;
|
|
19
|
+
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
20
|
+
length?: number;
|
|
21
|
+
prompt?: string;
|
|
22
|
+
format?: string;
|
|
23
|
+
intermediateFactor?: number;
|
|
24
|
+
maxIterations?: number;
|
|
25
|
+
sliding?: {
|
|
26
|
+
window?: number;
|
|
27
|
+
overlap?: number;
|
|
28
|
+
};
|
|
29
|
+
}, {
|
|
30
|
+
length?: number;
|
|
31
|
+
prompt?: string;
|
|
32
|
+
format?: string;
|
|
33
|
+
intermediateFactor?: number;
|
|
34
|
+
maxIterations?: number;
|
|
35
|
+
sliding?: {
|
|
36
|
+
window?: number;
|
|
37
|
+
overlap?: number;
|
|
38
|
+
};
|
|
39
|
+
}>;
|
|
40
|
+
declare module '@botpress/zai' {
|
|
41
|
+
interface Zai {
|
|
42
|
+
/** Summarizes a text of any length to a summary of the desired length */
|
|
43
|
+
summarize(original: string, options?: Options): Promise<string>;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from '@bpinternal/zui';
|
|
2
|
+
export type Options = z.input<typeof Options>;
|
|
3
|
+
declare const Options: import("@bpinternal/zui").ZodObject<{
|
|
4
|
+
length: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodNumber>;
|
|
5
|
+
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
6
|
+
length?: number;
|
|
7
|
+
}, {
|
|
8
|
+
length?: number;
|
|
9
|
+
}>;
|
|
10
|
+
declare module '@botpress/zai' {
|
|
11
|
+
interface Zai {
|
|
12
|
+
/** Generates a text of the desired length according to the prompt */
|
|
13
|
+
text(prompt: string, options?: Options): Promise<string>;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|