@botpress/zai 1.0.0-beta.3 → 1.0.0-beta.4
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/index.cjs +1898 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +916 -0
- package/dist/index.d.ts +916 -0
- package/dist/index.js +1868 -0
- package/dist/index.js.map +1 -0
- package/ensure-env.cjs +9 -0
- package/package.json +20 -19
- package/tsconfig.json +23 -18
- package/tsup.config.ts +16 -0
- package/vitest.config.ts +2 -16
- package/vitest.setup.ts +11 -15
- package/dist/src/adapters/adapter.d.ts +0 -27
- package/dist/src/adapters/adapter.js +0 -3
- package/dist/src/adapters/adapter.js.map +0 -1
- package/dist/src/adapters/botpress-table.d.ts +0 -155
- package/dist/src/adapters/botpress-table.js +0 -170
- package/dist/src/adapters/botpress-table.js.map +0 -1
- package/dist/src/adapters/memory.d.ts +0 -7
- package/dist/src/adapters/memory.js +0 -13
- package/dist/src/adapters/memory.js.map +0 -1
- package/dist/src/env.d.ts +0 -1
- package/dist/src/env.js +0 -27
- package/dist/src/env.js.map +0 -1
- package/dist/src/index.d.ts +0 -9
- package/dist/src/index.js +0 -10
- package/dist/src/index.js.map +0 -1
- package/dist/src/models.d.ts +0 -253
- package/dist/src/models.js +0 -348
- package/dist/src/models.js.map +0 -1
- package/dist/src/operations/__tests/index.d.ts +0 -19
- package/dist/src/operations/__tests/index.js +0 -24
- package/dist/src/operations/__tests/index.js.map +0 -1
- package/dist/src/operations/check.d.ts +0 -36
- package/dist/src/operations/check.js +0 -146
- package/dist/src/operations/check.js.map +0 -1
- package/dist/src/operations/check.test.d.ts +0 -1
- package/dist/src/operations/check.test.js.map +0 -1
- package/dist/src/operations/constants.d.ts +0 -2
- package/dist/src/operations/constants.js +0 -3
- package/dist/src/operations/constants.js.map +0 -1
- package/dist/src/operations/errors.d.ts +0 -5
- package/dist/src/operations/errors.js +0 -11
- package/dist/src/operations/errors.js.map +0 -1
- package/dist/src/operations/extract.d.ts +0 -20
- package/dist/src/operations/extract.js +0 -235
- package/dist/src/operations/extract.js.map +0 -1
- package/dist/src/operations/extract.test.d.ts +0 -1
- package/dist/src/operations/extract.test.js.map +0 -1
- package/dist/src/operations/filter.d.ts +0 -39
- package/dist/src/operations/filter.js +0 -184
- package/dist/src/operations/filter.js.map +0 -1
- package/dist/src/operations/filter.test.d.ts +0 -1
- package/dist/src/operations/filter.test.js.map +0 -1
- package/dist/src/operations/label.d.ts +0 -79
- package/dist/src/operations/label.js +0 -250
- package/dist/src/operations/label.js.map +0 -1
- package/dist/src/operations/label.test.d.ts +0 -1
- package/dist/src/operations/label.test.js.map +0 -1
- package/dist/src/operations/rewrite.d.ts +0 -34
- package/dist/src/operations/rewrite.js +0 -106
- package/dist/src/operations/rewrite.js.map +0 -1
- package/dist/src/operations/rewrite.test.d.ts +0 -1
- package/dist/src/operations/rewrite.test.js.map +0 -1
- package/dist/src/operations/summarize.d.ts +0 -46
- package/dist/src/operations/summarize.js +0 -139
- package/dist/src/operations/summarize.js.map +0 -1
- package/dist/src/operations/summarize.test.d.ts +0 -1
- package/dist/src/operations/summarize.test.js.map +0 -1
- package/dist/src/operations/text.d.ts +0 -16
- package/dist/src/operations/text.js +0 -47
- package/dist/src/operations/text.js.map +0 -1
- package/dist/src/operations/text.test.d.ts +0 -1
- package/dist/src/operations/text.test.js.map +0 -1
- package/dist/src/operations/zai-learn.test.d.ts +0 -1
- package/dist/src/operations/zai-learn.test.js.map +0 -1
- package/dist/src/operations/zai-retry.test.d.ts +0 -1
- package/dist/src/operations/zai-retry.test.js.map +0 -1
- package/dist/src/utils.d.ts +0 -53
- package/dist/src/utils.js +0 -49
- package/dist/src/utils.js.map +0 -1
- package/dist/src/zai.d.ts +0 -91
- package/dist/src/zai.js +0 -139
- package/dist/src/zai.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/typings.d.ts +0 -901
- package/dist/typings.tsbuildinfo +0 -1
- package/dist/vitest.config.d.ts +0 -2
- package/dist/vitest.config.js +0 -21
- package/dist/vitest.config.js.map +0 -1
- package/dist/vitest.setup.d.ts +0 -1
- package/dist/vitest.setup.js +0 -22
- package/dist/vitest.setup.js.map +0 -1
- package/tsconfig.types.json +0 -22
- package/turbo.json +0 -14
package/dist/typings.d.ts
DELETED
|
@@ -1,901 +0,0 @@
|
|
|
1
|
-
declare module "utils" {
|
|
2
|
-
import { Client } from '@botpress/client';
|
|
3
|
-
import { z } from '@bpinternal/zui';
|
|
4
|
-
export const stringify: (input: unknown, beautify?: boolean) => string;
|
|
5
|
-
export const BotpressClient: z.Schema<Client, import("@bpinternal/zui").ZodTypeDef, Client>;
|
|
6
|
-
export function fastHash(str: string): string;
|
|
7
|
-
export const takeUntilTokens: <T>(arr: T[], tokens: number, count: (el: T) => number) => T[];
|
|
8
|
-
export type GenerationMetadata = z.input<typeof GenerationMetadata>;
|
|
9
|
-
export const GenerationMetadata: import("@bpinternal/zui").ZodObject<{
|
|
10
|
-
model: import("@bpinternal/zui").ZodString;
|
|
11
|
-
cost: import("@bpinternal/zui").ZodObject<{
|
|
12
|
-
input: import("@bpinternal/zui").ZodNumber;
|
|
13
|
-
output: import("@bpinternal/zui").ZodNumber;
|
|
14
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
15
|
-
input?: number;
|
|
16
|
-
output?: number;
|
|
17
|
-
}, {
|
|
18
|
-
input?: number;
|
|
19
|
-
output?: number;
|
|
20
|
-
}>;
|
|
21
|
-
latency: import("@bpinternal/zui").ZodNumber;
|
|
22
|
-
tokens: import("@bpinternal/zui").ZodObject<{
|
|
23
|
-
input: import("@bpinternal/zui").ZodNumber;
|
|
24
|
-
output: import("@bpinternal/zui").ZodNumber;
|
|
25
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
26
|
-
input?: number;
|
|
27
|
-
output?: number;
|
|
28
|
-
}, {
|
|
29
|
-
input?: number;
|
|
30
|
-
output?: number;
|
|
31
|
-
}>;
|
|
32
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
33
|
-
model?: string;
|
|
34
|
-
cost?: {
|
|
35
|
-
input?: number;
|
|
36
|
-
output?: number;
|
|
37
|
-
};
|
|
38
|
-
latency?: number;
|
|
39
|
-
tokens?: {
|
|
40
|
-
input?: number;
|
|
41
|
-
output?: number;
|
|
42
|
-
};
|
|
43
|
-
}, {
|
|
44
|
-
model?: string;
|
|
45
|
-
cost?: {
|
|
46
|
-
input?: number;
|
|
47
|
-
output?: number;
|
|
48
|
-
};
|
|
49
|
-
latency?: number;
|
|
50
|
-
tokens?: {
|
|
51
|
-
input?: number;
|
|
52
|
-
output?: number;
|
|
53
|
-
};
|
|
54
|
-
}>;
|
|
55
|
-
}
|
|
56
|
-
declare module "adapters/adapter" {
|
|
57
|
-
import { GenerationMetadata } from "utils";
|
|
58
|
-
export type SaveExampleProps<TInput, TOutput> = {
|
|
59
|
-
key: string;
|
|
60
|
-
taskType: string;
|
|
61
|
-
taskId: string;
|
|
62
|
-
instructions: string;
|
|
63
|
-
input: TInput;
|
|
64
|
-
output: TOutput;
|
|
65
|
-
explanation?: string;
|
|
66
|
-
metadata: GenerationMetadata;
|
|
67
|
-
status?: 'pending' | 'approved';
|
|
68
|
-
};
|
|
69
|
-
export type GetExamplesProps<TInput> = {
|
|
70
|
-
taskType: string;
|
|
71
|
-
taskId: string;
|
|
72
|
-
input: TInput;
|
|
73
|
-
};
|
|
74
|
-
export abstract class Adapter {
|
|
75
|
-
abstract getExamples<TInput, TOutput>(props: GetExamplesProps<TInput>): Promise<Array<{
|
|
76
|
-
key: string;
|
|
77
|
-
input: TInput;
|
|
78
|
-
output: TOutput;
|
|
79
|
-
explanation?: string;
|
|
80
|
-
similarity: number;
|
|
81
|
-
}>>;
|
|
82
|
-
abstract saveExample<TInput, TOutput>(props: SaveExampleProps<TInput, TOutput>): Promise<void>;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
declare module "adapters/botpress-table" {
|
|
86
|
-
import { type Client } from '@botpress/client';
|
|
87
|
-
import { z } from '@bpinternal/zui';
|
|
88
|
-
import { Adapter, GetExamplesProps, SaveExampleProps } from "adapters/adapter";
|
|
89
|
-
const Props: import("@bpinternal/zui").ZodObject<{
|
|
90
|
-
client: z.Schema<Client, import("@bpinternal/zui").ZodTypeDef, Client>;
|
|
91
|
-
tableName: import("@bpinternal/zui").ZodString;
|
|
92
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
93
|
-
client?: Client;
|
|
94
|
-
tableName?: string;
|
|
95
|
-
}, {
|
|
96
|
-
client?: Client;
|
|
97
|
-
tableName?: string;
|
|
98
|
-
}>;
|
|
99
|
-
export type TableSchema = z.input<typeof TableSchema>;
|
|
100
|
-
const TableSchema: import("@bpinternal/zui").ZodObject<{
|
|
101
|
-
taskType: import("@bpinternal/zui").ZodString;
|
|
102
|
-
taskId: import("@bpinternal/zui").ZodString;
|
|
103
|
-
key: import("@bpinternal/zui").ZodString;
|
|
104
|
-
instructions: import("@bpinternal/zui").ZodString;
|
|
105
|
-
input: import("@bpinternal/zui").ZodObject<{}, "passthrough", import("@bpinternal/zui").ZodTypeAny, import("@bpinternal/zui").objectOutputType<{}, import("@bpinternal/zui").ZodTypeAny, "passthrough">, import("@bpinternal/zui").objectInputType<{}, import("@bpinternal/zui").ZodTypeAny, "passthrough">>;
|
|
106
|
-
output: import("@bpinternal/zui").ZodObject<{}, "passthrough", import("@bpinternal/zui").ZodTypeAny, import("@bpinternal/zui").objectOutputType<{}, import("@bpinternal/zui").ZodTypeAny, "passthrough">, import("@bpinternal/zui").objectInputType<{}, import("@bpinternal/zui").ZodTypeAny, "passthrough">>;
|
|
107
|
-
explanation: import("@bpinternal/zui").ZodNullable<import("@bpinternal/zui").ZodString>;
|
|
108
|
-
metadata: import("@bpinternal/zui").ZodObject<{
|
|
109
|
-
model: import("@bpinternal/zui").ZodString;
|
|
110
|
-
cost: import("@bpinternal/zui").ZodObject<{
|
|
111
|
-
input: import("@bpinternal/zui").ZodNumber;
|
|
112
|
-
output: import("@bpinternal/zui").ZodNumber;
|
|
113
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
114
|
-
input?: number;
|
|
115
|
-
output?: number;
|
|
116
|
-
}, {
|
|
117
|
-
input?: number;
|
|
118
|
-
output?: number;
|
|
119
|
-
}>;
|
|
120
|
-
latency: import("@bpinternal/zui").ZodNumber;
|
|
121
|
-
tokens: import("@bpinternal/zui").ZodObject<{
|
|
122
|
-
input: import("@bpinternal/zui").ZodNumber;
|
|
123
|
-
output: import("@bpinternal/zui").ZodNumber;
|
|
124
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
125
|
-
input?: number;
|
|
126
|
-
output?: number;
|
|
127
|
-
}, {
|
|
128
|
-
input?: number;
|
|
129
|
-
output?: number;
|
|
130
|
-
}>;
|
|
131
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
132
|
-
model?: string;
|
|
133
|
-
cost?: {
|
|
134
|
-
input?: number;
|
|
135
|
-
output?: number;
|
|
136
|
-
};
|
|
137
|
-
latency?: number;
|
|
138
|
-
tokens?: {
|
|
139
|
-
input?: number;
|
|
140
|
-
output?: number;
|
|
141
|
-
};
|
|
142
|
-
}, {
|
|
143
|
-
model?: string;
|
|
144
|
-
cost?: {
|
|
145
|
-
input?: number;
|
|
146
|
-
output?: number;
|
|
147
|
-
};
|
|
148
|
-
latency?: number;
|
|
149
|
-
tokens?: {
|
|
150
|
-
input?: number;
|
|
151
|
-
output?: number;
|
|
152
|
-
};
|
|
153
|
-
}>;
|
|
154
|
-
status: import("@bpinternal/zui").ZodEnum<["pending", "rejected", "approved"]>;
|
|
155
|
-
feedback: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodNullable<import("@bpinternal/zui").ZodObject<{
|
|
156
|
-
rating: import("@bpinternal/zui").ZodEnum<["very-bad", "bad", "good", "very-good"]>;
|
|
157
|
-
comment: import("@bpinternal/zui").ZodNullable<import("@bpinternal/zui").ZodString>;
|
|
158
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
159
|
-
rating?: "very-bad" | "bad" | "good" | "very-good";
|
|
160
|
-
comment?: string;
|
|
161
|
-
}, {
|
|
162
|
-
rating?: "very-bad" | "bad" | "good" | "very-good";
|
|
163
|
-
comment?: string;
|
|
164
|
-
}>>>;
|
|
165
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
166
|
-
input?: {} & {
|
|
167
|
-
[k: string]: unknown;
|
|
168
|
-
};
|
|
169
|
-
output?: {} & {
|
|
170
|
-
[k: string]: unknown;
|
|
171
|
-
};
|
|
172
|
-
status?: "pending" | "approved" | "rejected";
|
|
173
|
-
taskType?: string;
|
|
174
|
-
taskId?: string;
|
|
175
|
-
key?: string;
|
|
176
|
-
instructions?: string;
|
|
177
|
-
explanation?: string;
|
|
178
|
-
metadata?: {
|
|
179
|
-
model?: string;
|
|
180
|
-
cost?: {
|
|
181
|
-
input?: number;
|
|
182
|
-
output?: number;
|
|
183
|
-
};
|
|
184
|
-
latency?: number;
|
|
185
|
-
tokens?: {
|
|
186
|
-
input?: number;
|
|
187
|
-
output?: number;
|
|
188
|
-
};
|
|
189
|
-
};
|
|
190
|
-
feedback?: {
|
|
191
|
-
rating?: "very-bad" | "bad" | "good" | "very-good";
|
|
192
|
-
comment?: string;
|
|
193
|
-
};
|
|
194
|
-
}, {
|
|
195
|
-
input?: {} & {
|
|
196
|
-
[k: string]: unknown;
|
|
197
|
-
};
|
|
198
|
-
output?: {} & {
|
|
199
|
-
[k: string]: unknown;
|
|
200
|
-
};
|
|
201
|
-
status?: "pending" | "approved" | "rejected";
|
|
202
|
-
taskType?: string;
|
|
203
|
-
taskId?: string;
|
|
204
|
-
key?: string;
|
|
205
|
-
instructions?: string;
|
|
206
|
-
explanation?: string;
|
|
207
|
-
metadata?: {
|
|
208
|
-
model?: string;
|
|
209
|
-
cost?: {
|
|
210
|
-
input?: number;
|
|
211
|
-
output?: number;
|
|
212
|
-
};
|
|
213
|
-
latency?: number;
|
|
214
|
-
tokens?: {
|
|
215
|
-
input?: number;
|
|
216
|
-
output?: number;
|
|
217
|
-
};
|
|
218
|
-
};
|
|
219
|
-
feedback?: {
|
|
220
|
-
rating?: "very-bad" | "bad" | "good" | "very-good";
|
|
221
|
-
comment?: string;
|
|
222
|
-
};
|
|
223
|
-
}>;
|
|
224
|
-
export class TableAdapter extends Adapter {
|
|
225
|
-
private client;
|
|
226
|
-
private tableName;
|
|
227
|
-
private status;
|
|
228
|
-
private errors;
|
|
229
|
-
constructor(props: z.input<typeof Props>);
|
|
230
|
-
getExamples<TInput, TOutput>({ taskType, taskId, input }: GetExamplesProps<TInput>): Promise<{
|
|
231
|
-
key: any;
|
|
232
|
-
input: TInput;
|
|
233
|
-
output: TOutput;
|
|
234
|
-
explanation: any;
|
|
235
|
-
similarity: any;
|
|
236
|
-
}[]>;
|
|
237
|
-
saveExample<TInput, TOutput>({ key, taskType, taskId, instructions, input, output, explanation, metadata, status }: SaveExampleProps<TInput, TOutput>): Promise<void>;
|
|
238
|
-
private assertTableExists;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
declare module "adapters/memory" {
|
|
242
|
-
import { Adapter } from "adapters/adapter";
|
|
243
|
-
export class MemoryAdapter extends Adapter {
|
|
244
|
-
examples: any[];
|
|
245
|
-
constructor(examples: any[]);
|
|
246
|
-
getExamples(): Promise<any[]>;
|
|
247
|
-
saveExample(): Promise<void>;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
declare module "models" {
|
|
251
|
-
export const Models: readonly [{
|
|
252
|
-
readonly id: "anthropic__claude-3-haiku-20240307";
|
|
253
|
-
readonly name: "Claude 3 Haiku";
|
|
254
|
-
readonly description: "Claude 3 Haiku is Anthropic's fastest and most compact model for near-instant responsiveness. Quick and accurate targeted performance.";
|
|
255
|
-
readonly tags: readonly ["low-cost", "general-purpose"];
|
|
256
|
-
readonly input: {
|
|
257
|
-
readonly costPer1MTokens: 0.25;
|
|
258
|
-
readonly maxTokens: 200000;
|
|
259
|
-
};
|
|
260
|
-
readonly output: {
|
|
261
|
-
readonly costPer1MTokens: 1.25;
|
|
262
|
-
readonly maxTokens: 4096;
|
|
263
|
-
};
|
|
264
|
-
readonly integration: "anthropic";
|
|
265
|
-
}, {
|
|
266
|
-
readonly id: "anthropic__claude-3-5-sonnet-20240620";
|
|
267
|
-
readonly name: "Claude 3.5 Sonnet";
|
|
268
|
-
readonly description: "Claude 3.5 Sonnet delivers better-than-Opus capabilities, faster-than-Sonnet speeds, at the same Sonnet prices. Sonnet is particularly good at coding, data science, visual processing, and agentic tasks.";
|
|
269
|
-
readonly tags: readonly ["recommended", "vision", "general-purpose", "agents", "coding", "function-calling", "storytelling"];
|
|
270
|
-
readonly input: {
|
|
271
|
-
readonly costPer1MTokens: 3;
|
|
272
|
-
readonly maxTokens: 200000;
|
|
273
|
-
};
|
|
274
|
-
readonly output: {
|
|
275
|
-
readonly costPer1MTokens: 15;
|
|
276
|
-
readonly maxTokens: 4096;
|
|
277
|
-
};
|
|
278
|
-
readonly integration: "anthropic";
|
|
279
|
-
}, {
|
|
280
|
-
readonly id: "groq__gemma-7b-it";
|
|
281
|
-
readonly name: "Gemma 7B";
|
|
282
|
-
readonly description: "Gemma is a family of lightweight, state-of-the-art open models from Google, built from the same research and technology used to create the Gemini models. They are text-to-text, decoder-only large language models, available in English, with open weights, pre-trained variants, and instruction-tuned variants. Gemma models are well-suited for a variety of text generation tasks, including question answering, summarization, and reasoning.";
|
|
283
|
-
readonly tags: readonly ["deprecated", "low-cost"];
|
|
284
|
-
readonly input: {
|
|
285
|
-
readonly costPer1MTokens: 0.07;
|
|
286
|
-
readonly maxTokens: 8192;
|
|
287
|
-
};
|
|
288
|
-
readonly output: {
|
|
289
|
-
readonly costPer1MTokens: 0.07;
|
|
290
|
-
readonly maxTokens: 8192;
|
|
291
|
-
};
|
|
292
|
-
readonly integration: "groq";
|
|
293
|
-
}, {
|
|
294
|
-
readonly id: "groq__gemma2-9b-it";
|
|
295
|
-
readonly name: "Gemma2 9B";
|
|
296
|
-
readonly description: "Redesigned for outsized performance and unmatched efficiency, Gemma 2 optimizes for blazing-fast inference on diverse hardware. Gemma is a family of lightweight, state-of-the-art open models from Google, built from the same research and technology used to create the Gemini models. They are text-to-text, decoder-only large language models, available in English, with open weights, pre-trained variants, and instruction-tuned variants. Gemma models are well-suited for a variety of text generation tasks, including question answering, summarization, and reasoning.";
|
|
297
|
-
readonly tags: readonly ["low-cost", "general-purpose"];
|
|
298
|
-
readonly input: {
|
|
299
|
-
readonly costPer1MTokens: 0.2;
|
|
300
|
-
readonly maxTokens: 8192;
|
|
301
|
-
};
|
|
302
|
-
readonly output: {
|
|
303
|
-
readonly costPer1MTokens: 0.2;
|
|
304
|
-
readonly maxTokens: 8192;
|
|
305
|
-
};
|
|
306
|
-
readonly integration: "groq";
|
|
307
|
-
}, {
|
|
308
|
-
readonly id: "groq__llama3-70b-8192";
|
|
309
|
-
readonly name: "LLaMA 3 70B";
|
|
310
|
-
readonly tags: readonly ["general-purpose"];
|
|
311
|
-
readonly description: "Meta developed and released the Meta Llama 3 family of large language models (LLMs), a collection of pretrained and instruction tuned generative text models in 8 and 70B sizes. The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of the available open source chat models on common industry benchmarks.";
|
|
312
|
-
readonly input: {
|
|
313
|
-
readonly costPer1MTokens: 0.59;
|
|
314
|
-
readonly maxTokens: 8192;
|
|
315
|
-
};
|
|
316
|
-
readonly output: {
|
|
317
|
-
readonly costPer1MTokens: 0.79;
|
|
318
|
-
readonly maxTokens: 8192;
|
|
319
|
-
};
|
|
320
|
-
readonly integration: "groq";
|
|
321
|
-
}, {
|
|
322
|
-
readonly id: "groq__llama3-8b-8192";
|
|
323
|
-
readonly name: "LLaMA 3 8B";
|
|
324
|
-
readonly description: "Meta developed and released the Meta Llama 3 family of large language models (LLMs), a collection of pretrained and instruction tuned generative text models in 8 and 70B sizes. The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of the available open source chat models on common industry benchmarks.";
|
|
325
|
-
readonly tags: readonly ["low-cost", "general-purpose", "deprecated"];
|
|
326
|
-
readonly input: {
|
|
327
|
-
readonly costPer1MTokens: 0.05;
|
|
328
|
-
readonly maxTokens: 8192;
|
|
329
|
-
};
|
|
330
|
-
readonly output: {
|
|
331
|
-
readonly costPer1MTokens: 0.08;
|
|
332
|
-
readonly maxTokens: 8192;
|
|
333
|
-
};
|
|
334
|
-
readonly integration: "groq";
|
|
335
|
-
}, {
|
|
336
|
-
readonly id: "groq__llama-3.1-70b-versatile";
|
|
337
|
-
readonly name: "LLaMA 3.1 70B";
|
|
338
|
-
readonly description: "The Llama 3.1 instruction-tuned, text-only models are optimized for multilingual dialogue use cases.";
|
|
339
|
-
readonly tags: readonly ["recommended", "general-purpose"];
|
|
340
|
-
readonly input: {
|
|
341
|
-
readonly costPer1MTokens: 0.59;
|
|
342
|
-
readonly maxTokens: 128000;
|
|
343
|
-
};
|
|
344
|
-
readonly output: {
|
|
345
|
-
readonly costPer1MTokens: 0.79;
|
|
346
|
-
readonly maxTokens: 8192;
|
|
347
|
-
};
|
|
348
|
-
readonly integration: "groq";
|
|
349
|
-
}, {
|
|
350
|
-
readonly id: "groq__llama-3.1-8b-instant";
|
|
351
|
-
readonly name: "LLaMA 3.1 8B";
|
|
352
|
-
readonly description: "The Llama 3.1 instruction-tuned, text-only models are optimized for multilingual dialogue use cases.";
|
|
353
|
-
readonly tags: readonly ["low-cost", "general-purpose"];
|
|
354
|
-
readonly input: {
|
|
355
|
-
readonly costPer1MTokens: 0.05;
|
|
356
|
-
readonly maxTokens: 128000;
|
|
357
|
-
};
|
|
358
|
-
readonly output: {
|
|
359
|
-
readonly costPer1MTokens: 0.08;
|
|
360
|
-
readonly maxTokens: 8192;
|
|
361
|
-
};
|
|
362
|
-
readonly integration: "groq";
|
|
363
|
-
}, {
|
|
364
|
-
readonly id: "groq__llama-3.2-11b-vision-preview";
|
|
365
|
-
readonly name: "LLaMA 3.2 11B Vision (Preview)";
|
|
366
|
-
readonly description: "[BETA preview version] The Llama 3.2-Vision instruction-tuned models are optimized for visual recognition, image reasoning, captioning, and answering general questions about an image.";
|
|
367
|
-
readonly tags: readonly ["low-cost", "vision", "general-purpose"];
|
|
368
|
-
readonly input: {
|
|
369
|
-
readonly costPer1MTokens: 0.18;
|
|
370
|
-
readonly maxTokens: 128000;
|
|
371
|
-
};
|
|
372
|
-
readonly output: {
|
|
373
|
-
readonly costPer1MTokens: 0.18;
|
|
374
|
-
readonly maxTokens: 8192;
|
|
375
|
-
};
|
|
376
|
-
readonly integration: "groq";
|
|
377
|
-
}, {
|
|
378
|
-
readonly id: "groq__llama-3.2-1b-preview";
|
|
379
|
-
readonly name: "LLaMA 3.2 1B (Preview)";
|
|
380
|
-
readonly description: "[BETA preview version] The Llama 3.2 instruction-tuned, text-only models are optimized for multilingual dialogue use cases, including agentic retrieval and summarization tasks.";
|
|
381
|
-
readonly tags: readonly ["low-cost"];
|
|
382
|
-
readonly input: {
|
|
383
|
-
readonly costPer1MTokens: 0.04;
|
|
384
|
-
readonly maxTokens: 128000;
|
|
385
|
-
};
|
|
386
|
-
readonly output: {
|
|
387
|
-
readonly costPer1MTokens: 0.04;
|
|
388
|
-
readonly maxTokens: 8192;
|
|
389
|
-
};
|
|
390
|
-
readonly integration: "groq";
|
|
391
|
-
}, {
|
|
392
|
-
readonly id: "groq__llama-3.2-3b-preview";
|
|
393
|
-
readonly name: "LLaMA 3.2 3B (Preview)";
|
|
394
|
-
readonly description: "[BETA preview version] The Llama 3.2 instruction-tuned, text-only models are optimized for multilingual dialogue use cases, including agentic retrieval and summarization tasks.";
|
|
395
|
-
readonly tags: readonly ["low-cost", "general-purpose"];
|
|
396
|
-
readonly input: {
|
|
397
|
-
readonly costPer1MTokens: 0.06;
|
|
398
|
-
readonly maxTokens: 128000;
|
|
399
|
-
};
|
|
400
|
-
readonly output: {
|
|
401
|
-
readonly costPer1MTokens: 0.06;
|
|
402
|
-
readonly maxTokens: 8192;
|
|
403
|
-
};
|
|
404
|
-
readonly integration: "groq";
|
|
405
|
-
}, {
|
|
406
|
-
readonly id: "groq__llama-3.2-90b-vision-preview";
|
|
407
|
-
readonly name: "LLaMA 3.2 90B Vision (Preview)";
|
|
408
|
-
readonly description: "[BETA preview version] The Llama 3.2-Vision instruction-tuned models are optimized for visual recognition, image reasoning, captioning, and answering general questions about an image.";
|
|
409
|
-
readonly tags: readonly ["recommended", "vision", "general-purpose"];
|
|
410
|
-
readonly input: {
|
|
411
|
-
readonly costPer1MTokens: 0.9;
|
|
412
|
-
readonly maxTokens: 128000;
|
|
413
|
-
};
|
|
414
|
-
readonly output: {
|
|
415
|
-
readonly costPer1MTokens: 0.9;
|
|
416
|
-
readonly maxTokens: 8192;
|
|
417
|
-
};
|
|
418
|
-
readonly integration: "groq";
|
|
419
|
-
}, {
|
|
420
|
-
readonly id: "groq__mixtral-8x7b-32768";
|
|
421
|
-
readonly name: "Mixtral 8x7B";
|
|
422
|
-
readonly tags: readonly ["low-cost", "general-purpose", "deprecated"];
|
|
423
|
-
readonly description: "Mistral MoE 8x7B Instruct v0.1 model with Sparse Mixture of Experts. Fine tuned for instruction following";
|
|
424
|
-
readonly input: {
|
|
425
|
-
readonly costPer1MTokens: 0.24;
|
|
426
|
-
readonly maxTokens: 32768;
|
|
427
|
-
};
|
|
428
|
-
readonly output: {
|
|
429
|
-
readonly costPer1MTokens: 0.24;
|
|
430
|
-
readonly maxTokens: 32768;
|
|
431
|
-
};
|
|
432
|
-
readonly integration: "groq";
|
|
433
|
-
}, {
|
|
434
|
-
readonly id: "openai__gpt-3.5-turbo-0125";
|
|
435
|
-
readonly name: "GPT-3.5 Turbo";
|
|
436
|
-
readonly description: "GPT-3.5 Turbo can understand and generate natural language or code and has been optimized for chat but works well for non-chat tasks as well.";
|
|
437
|
-
readonly tags: readonly ["deprecated", "general-purpose", "low-cost"];
|
|
438
|
-
readonly input: {
|
|
439
|
-
readonly costPer1MTokens: 0.5;
|
|
440
|
-
readonly maxTokens: 128000;
|
|
441
|
-
};
|
|
442
|
-
readonly output: {
|
|
443
|
-
readonly costPer1MTokens: 1.5;
|
|
444
|
-
readonly maxTokens: 4096;
|
|
445
|
-
};
|
|
446
|
-
readonly integration: "openai";
|
|
447
|
-
}, {
|
|
448
|
-
readonly id: "openai__gpt-4-turbo-2024-04-09";
|
|
449
|
-
readonly name: "GPT-4 Turbo";
|
|
450
|
-
readonly description: "GPT-4 is a large multimodal model (accepting text or image inputs and outputting text) that can solve difficult problems with greater accuracy than any of our previous models, thanks to its broader general knowledge and advanced reasoning capabilities.";
|
|
451
|
-
readonly tags: readonly ["deprecated", "general-purpose", "coding", "agents", "function-calling"];
|
|
452
|
-
readonly input: {
|
|
453
|
-
readonly costPer1MTokens: 10;
|
|
454
|
-
readonly maxTokens: 128000;
|
|
455
|
-
};
|
|
456
|
-
readonly output: {
|
|
457
|
-
readonly costPer1MTokens: 30;
|
|
458
|
-
readonly maxTokens: 4096;
|
|
459
|
-
};
|
|
460
|
-
readonly integration: "openai";
|
|
461
|
-
}, {
|
|
462
|
-
readonly id: "openai__gpt-4o-2024-08-06";
|
|
463
|
-
readonly name: "GPT-4o (August 2024)";
|
|
464
|
-
readonly description: "GPT-4o (“o” for “omni”) is OpenAI's most advanced model. It is multimodal (accepting text or image inputs and outputting text), and it has the same high intelligence as GPT-4 Turbo but is cheaper and more efficient.";
|
|
465
|
-
readonly tags: readonly ["recommended", "vision", "general-purpose", "coding", "agents", "function-calling"];
|
|
466
|
-
readonly input: {
|
|
467
|
-
readonly costPer1MTokens: 2.5;
|
|
468
|
-
readonly maxTokens: 128000;
|
|
469
|
-
};
|
|
470
|
-
readonly output: {
|
|
471
|
-
readonly costPer1MTokens: 10;
|
|
472
|
-
readonly maxTokens: 16384;
|
|
473
|
-
};
|
|
474
|
-
readonly integration: "openai";
|
|
475
|
-
}, {
|
|
476
|
-
readonly id: "openai__gpt-4o-2024-05-13";
|
|
477
|
-
readonly name: "GPT-4o (May 2024)";
|
|
478
|
-
readonly description: "GPT-4o (“o” for “omni”) is OpenAI's most advanced model. It is multimodal (accepting text or image inputs and outputting text), and it has the same high intelligence as GPT-4 Turbo but is cheaper and more efficient.";
|
|
479
|
-
readonly tags: readonly ["vision", "general-purpose", "coding", "agents", "function-calling"];
|
|
480
|
-
readonly input: {
|
|
481
|
-
readonly costPer1MTokens: 5;
|
|
482
|
-
readonly maxTokens: 128000;
|
|
483
|
-
};
|
|
484
|
-
readonly output: {
|
|
485
|
-
readonly costPer1MTokens: 15;
|
|
486
|
-
readonly maxTokens: 4096;
|
|
487
|
-
};
|
|
488
|
-
readonly integration: "openai";
|
|
489
|
-
}, {
|
|
490
|
-
readonly id: "openai__gpt-4o-mini-2024-07-18";
|
|
491
|
-
readonly name: "GPT-4o Mini";
|
|
492
|
-
readonly description: "GPT-4o mini (“o” for “omni”) is OpenAI's most advanced model in the small models category, and their cheapest model yet. It is multimodal (accepting text or image inputs and outputting text), has higher intelligence than gpt-3.5-turbo but is just as fast. It is meant to be used for smaller tasks, including vision tasks. It's recommended to choose gpt-4o-mini where you would have previously used gpt-3.5-turbo as this model is more capable and cheaper.";
|
|
493
|
-
readonly tags: readonly ["recommended", "vision", "low-cost", "general-purpose", "function-calling"];
|
|
494
|
-
readonly input: {
|
|
495
|
-
readonly costPer1MTokens: 0.15;
|
|
496
|
-
readonly maxTokens: 128000;
|
|
497
|
-
};
|
|
498
|
-
readonly output: {
|
|
499
|
-
readonly costPer1MTokens: 0.6;
|
|
500
|
-
readonly maxTokens: 16384;
|
|
501
|
-
};
|
|
502
|
-
readonly integration: "openai";
|
|
503
|
-
}];
|
|
504
|
-
}
|
|
505
|
-
declare module "zai" {
|
|
506
|
-
import { Client } from '@botpress/client';
|
|
507
|
-
import { type TextTokenizer } from '@botpress/wasm';
|
|
508
|
-
import { z } from '@bpinternal/zui';
|
|
509
|
-
import { Adapter } from "adapters/adapter";
|
|
510
|
-
import { Models } from "models";
|
|
511
|
-
type ActiveLearning = z.input<typeof ActiveLearning>;
|
|
512
|
-
const ActiveLearning: import("@bpinternal/zui").ZodObject<{
|
|
513
|
-
enable: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodBoolean>;
|
|
514
|
-
tableName: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodString>;
|
|
515
|
-
taskId: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodString>;
|
|
516
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
517
|
-
tableName?: string;
|
|
518
|
-
taskId?: string;
|
|
519
|
-
enable?: boolean;
|
|
520
|
-
}, {
|
|
521
|
-
tableName?: string;
|
|
522
|
-
taskId?: string;
|
|
523
|
-
enable?: boolean;
|
|
524
|
-
}>;
|
|
525
|
-
type ZaiConfig = z.input<typeof ZaiConfig>;
|
|
526
|
-
const ZaiConfig: import("@bpinternal/zui").ZodObject<{
|
|
527
|
-
client: z.Schema<Client, import("@bpinternal/zui").ZodTypeDef, Client>;
|
|
528
|
-
userId: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
529
|
-
retry: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodObject<{
|
|
530
|
-
maxRetries: import("@bpinternal/zui").ZodNumber;
|
|
531
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
532
|
-
maxRetries?: number;
|
|
533
|
-
}, {
|
|
534
|
-
maxRetries?: number;
|
|
535
|
-
}>>;
|
|
536
|
-
modelId: import("@bpinternal/zui").ZodDefault<z.Schema<"anthropic__claude-3-haiku-20240307" | "anthropic__claude-3-5-sonnet-20240620" | "groq__gemma-7b-it" | "groq__gemma2-9b-it" | "groq__llama3-70b-8192" | "groq__llama3-8b-8192" | "groq__llama-3.1-70b-versatile" | "groq__llama-3.1-8b-instant" | "groq__llama-3.2-11b-vision-preview" | "groq__llama-3.2-1b-preview" | "groq__llama-3.2-3b-preview" | "groq__llama-3.2-90b-vision-preview" | "groq__mixtral-8x7b-32768" | "openai__gpt-3.5-turbo-0125" | "openai__gpt-4-turbo-2024-04-09" | "openai__gpt-4o-2024-08-06" | "openai__gpt-4o-2024-05-13" | "openai__gpt-4o-mini-2024-07-18", import("@bpinternal/zui").ZodTypeDef, "anthropic__claude-3-haiku-20240307" | "anthropic__claude-3-5-sonnet-20240620" | "groq__gemma-7b-it" | "groq__gemma2-9b-it" | "groq__llama3-70b-8192" | "groq__llama3-8b-8192" | "groq__llama-3.1-70b-versatile" | "groq__llama-3.1-8b-instant" | "groq__llama-3.2-11b-vision-preview" | "groq__llama-3.2-1b-preview" | "groq__llama-3.2-3b-preview" | "groq__llama-3.2-90b-vision-preview" | "groq__mixtral-8x7b-32768" | "openai__gpt-3.5-turbo-0125" | "openai__gpt-4-turbo-2024-04-09" | "openai__gpt-4o-2024-08-06" | "openai__gpt-4o-2024-05-13" | "openai__gpt-4o-mini-2024-07-18">>;
|
|
537
|
-
activeLearning: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodObject<{
|
|
538
|
-
enable: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodBoolean>;
|
|
539
|
-
tableName: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodString>;
|
|
540
|
-
taskId: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodString>;
|
|
541
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
542
|
-
tableName?: string;
|
|
543
|
-
taskId?: string;
|
|
544
|
-
enable?: boolean;
|
|
545
|
-
}, {
|
|
546
|
-
tableName?: string;
|
|
547
|
-
taskId?: string;
|
|
548
|
-
enable?: boolean;
|
|
549
|
-
}>>;
|
|
550
|
-
namespace: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodString>;
|
|
551
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
552
|
-
client?: Client;
|
|
553
|
-
userId?: string;
|
|
554
|
-
retry?: {
|
|
555
|
-
maxRetries?: number;
|
|
556
|
-
};
|
|
557
|
-
modelId?: "anthropic__claude-3-haiku-20240307" | "anthropic__claude-3-5-sonnet-20240620" | "groq__gemma-7b-it" | "groq__gemma2-9b-it" | "groq__llama3-70b-8192" | "groq__llama3-8b-8192" | "groq__llama-3.1-70b-versatile" | "groq__llama-3.1-8b-instant" | "groq__llama-3.2-11b-vision-preview" | "groq__llama-3.2-1b-preview" | "groq__llama-3.2-3b-preview" | "groq__llama-3.2-90b-vision-preview" | "groq__mixtral-8x7b-32768" | "openai__gpt-3.5-turbo-0125" | "openai__gpt-4-turbo-2024-04-09" | "openai__gpt-4o-2024-08-06" | "openai__gpt-4o-2024-05-13" | "openai__gpt-4o-mini-2024-07-18";
|
|
558
|
-
activeLearning?: {
|
|
559
|
-
tableName?: string;
|
|
560
|
-
taskId?: string;
|
|
561
|
-
enable?: boolean;
|
|
562
|
-
};
|
|
563
|
-
namespace?: string;
|
|
564
|
-
}, {
|
|
565
|
-
client?: Client;
|
|
566
|
-
userId?: string;
|
|
567
|
-
retry?: {
|
|
568
|
-
maxRetries?: number;
|
|
569
|
-
};
|
|
570
|
-
modelId?: "anthropic__claude-3-haiku-20240307" | "anthropic__claude-3-5-sonnet-20240620" | "groq__gemma-7b-it" | "groq__gemma2-9b-it" | "groq__llama3-70b-8192" | "groq__llama3-8b-8192" | "groq__llama-3.1-70b-versatile" | "groq__llama-3.1-8b-instant" | "groq__llama-3.2-11b-vision-preview" | "groq__llama-3.2-1b-preview" | "groq__llama-3.2-3b-preview" | "groq__llama-3.2-90b-vision-preview" | "groq__mixtral-8x7b-32768" | "openai__gpt-3.5-turbo-0125" | "openai__gpt-4-turbo-2024-04-09" | "openai__gpt-4o-2024-08-06" | "openai__gpt-4o-2024-05-13" | "openai__gpt-4o-mini-2024-07-18";
|
|
571
|
-
activeLearning?: {
|
|
572
|
-
tableName?: string;
|
|
573
|
-
taskId?: string;
|
|
574
|
-
enable?: boolean;
|
|
575
|
-
};
|
|
576
|
-
namespace?: string;
|
|
577
|
-
}>;
|
|
578
|
-
export class Zai {
|
|
579
|
-
protected static tokenizer: TextTokenizer;
|
|
580
|
-
protected client: Client;
|
|
581
|
-
private originalConfig;
|
|
582
|
-
private userId;
|
|
583
|
-
private integration;
|
|
584
|
-
private model;
|
|
585
|
-
private retry;
|
|
586
|
-
protected Model: (typeof Models)[number];
|
|
587
|
-
protected namespace: string;
|
|
588
|
-
protected adapter: Adapter;
|
|
589
|
-
protected activeLearning: ActiveLearning;
|
|
590
|
-
constructor(config: ZaiConfig);
|
|
591
|
-
protected getTokenizer(): Promise<TextTokenizer>;
|
|
592
|
-
protected get taskId(): string;
|
|
593
|
-
with(options: Partial<ZaiConfig>): Zai;
|
|
594
|
-
learn(taskId: string): Zai;
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
declare module "operations/constants" {
|
|
598
|
-
export const PROMPT_INPUT_BUFFER = 1048;
|
|
599
|
-
export const PROMPT_OUTPUT_BUFFER = 512;
|
|
600
|
-
}
|
|
601
|
-
declare module "operations/text" {
|
|
602
|
-
import { z } from '@bpinternal/zui';
|
|
603
|
-
export type Options = z.input<typeof Options>;
|
|
604
|
-
const Options: import("@bpinternal/zui").ZodObject<{
|
|
605
|
-
length: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodNumber>;
|
|
606
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
607
|
-
length?: number;
|
|
608
|
-
}, {
|
|
609
|
-
length?: number;
|
|
610
|
-
}>;
|
|
611
|
-
module "zai" {
|
|
612
|
-
interface Zai {
|
|
613
|
-
/** Generates a text of the desired length according to the prompt */
|
|
614
|
-
text(prompt: string, options?: Options): Promise<string>;
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
declare module "operations/rewrite" {
|
|
619
|
-
import { z } from '@bpinternal/zui';
|
|
620
|
-
export type Options = z.input<typeof Options>;
|
|
621
|
-
const Options: import("@bpinternal/zui").ZodObject<{
|
|
622
|
-
examples: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
623
|
-
input: import("@bpinternal/zui").ZodString;
|
|
624
|
-
output: import("@bpinternal/zui").ZodString;
|
|
625
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
626
|
-
input?: string;
|
|
627
|
-
output?: string;
|
|
628
|
-
}, {
|
|
629
|
-
input?: string;
|
|
630
|
-
output?: string;
|
|
631
|
-
}>, "many">>;
|
|
632
|
-
length: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodNumber>;
|
|
633
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
634
|
-
length?: number;
|
|
635
|
-
examples?: {
|
|
636
|
-
input?: string;
|
|
637
|
-
output?: string;
|
|
638
|
-
}[];
|
|
639
|
-
}, {
|
|
640
|
-
length?: number;
|
|
641
|
-
examples?: {
|
|
642
|
-
input?: string;
|
|
643
|
-
output?: string;
|
|
644
|
-
}[];
|
|
645
|
-
}>;
|
|
646
|
-
module "zai" {
|
|
647
|
-
interface Zai {
|
|
648
|
-
/** Rewrites a string according to match the prompt */
|
|
649
|
-
rewrite(original: string, prompt: string, options?: Options): Promise<string>;
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
declare module "operations/summarize" {
|
|
654
|
-
import { z } from '@bpinternal/zui';
|
|
655
|
-
export type Options = z.input<typeof Options>;
|
|
656
|
-
const Options: import("@bpinternal/zui").ZodObject<{
|
|
657
|
-
prompt: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodString>;
|
|
658
|
-
format: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodString>;
|
|
659
|
-
length: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodNumber>;
|
|
660
|
-
intermediateFactor: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodNumber>;
|
|
661
|
-
maxIterations: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodNumber>;
|
|
662
|
-
sliding: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodObject<{
|
|
663
|
-
window: import("@bpinternal/zui").ZodNumber;
|
|
664
|
-
overlap: import("@bpinternal/zui").ZodNumber;
|
|
665
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
666
|
-
window?: number;
|
|
667
|
-
overlap?: number;
|
|
668
|
-
}, {
|
|
669
|
-
window?: number;
|
|
670
|
-
overlap?: number;
|
|
671
|
-
}>>;
|
|
672
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
673
|
-
length?: number;
|
|
674
|
-
prompt?: string;
|
|
675
|
-
format?: string;
|
|
676
|
-
intermediateFactor?: number;
|
|
677
|
-
maxIterations?: number;
|
|
678
|
-
sliding?: {
|
|
679
|
-
window?: number;
|
|
680
|
-
overlap?: number;
|
|
681
|
-
};
|
|
682
|
-
}, {
|
|
683
|
-
length?: number;
|
|
684
|
-
prompt?: string;
|
|
685
|
-
format?: string;
|
|
686
|
-
intermediateFactor?: number;
|
|
687
|
-
maxIterations?: number;
|
|
688
|
-
sliding?: {
|
|
689
|
-
window?: number;
|
|
690
|
-
overlap?: number;
|
|
691
|
-
};
|
|
692
|
-
}>;
|
|
693
|
-
module "zai" {
|
|
694
|
-
interface Zai {
|
|
695
|
-
/** Summarizes a text of any length to a summary of the desired length */
|
|
696
|
-
summarize(original: string, options?: Options): Promise<string>;
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
declare module "operations/check" {
|
|
701
|
-
import { z } from '@bpinternal/zui';
|
|
702
|
-
export type Options = z.input<typeof Options>;
|
|
703
|
-
const Options: import("@bpinternal/zui").ZodObject<{
|
|
704
|
-
examples: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
705
|
-
input: import("@bpinternal/zui").ZodAny;
|
|
706
|
-
check: import("@bpinternal/zui").ZodBoolean;
|
|
707
|
-
reason: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
708
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
709
|
-
input?: any;
|
|
710
|
-
check?: boolean;
|
|
711
|
-
reason?: string;
|
|
712
|
-
}, {
|
|
713
|
-
input?: any;
|
|
714
|
-
check?: boolean;
|
|
715
|
-
reason?: string;
|
|
716
|
-
}>, "many">>;
|
|
717
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
718
|
-
examples?: {
|
|
719
|
-
input?: any;
|
|
720
|
-
check?: boolean;
|
|
721
|
-
reason?: string;
|
|
722
|
-
}[];
|
|
723
|
-
}, {
|
|
724
|
-
examples?: {
|
|
725
|
-
input?: any;
|
|
726
|
-
check?: boolean;
|
|
727
|
-
reason?: string;
|
|
728
|
-
}[];
|
|
729
|
-
}>;
|
|
730
|
-
module "zai" {
|
|
731
|
-
interface Zai {
|
|
732
|
-
/** Checks wether a condition is true or not */
|
|
733
|
-
check(input: unknown, condition: string, options?: Options): Promise<boolean>;
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
declare module "operations/filter" {
|
|
738
|
-
import { z } from '@bpinternal/zui';
|
|
739
|
-
export type Options = z.input<typeof Options>;
|
|
740
|
-
const Options: import("@bpinternal/zui").ZodObject<{
|
|
741
|
-
tokensPerItem: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodNumber>>;
|
|
742
|
-
examples: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
743
|
-
input: import("@bpinternal/zui").ZodAny;
|
|
744
|
-
filter: import("@bpinternal/zui").ZodBoolean;
|
|
745
|
-
reason: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
746
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
747
|
-
input?: any;
|
|
748
|
-
filter?: boolean;
|
|
749
|
-
reason?: string;
|
|
750
|
-
}, {
|
|
751
|
-
input?: any;
|
|
752
|
-
filter?: boolean;
|
|
753
|
-
reason?: string;
|
|
754
|
-
}>, "many">>;
|
|
755
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
756
|
-
examples?: {
|
|
757
|
-
input?: any;
|
|
758
|
-
filter?: boolean;
|
|
759
|
-
reason?: string;
|
|
760
|
-
}[];
|
|
761
|
-
tokensPerItem?: number;
|
|
762
|
-
}, {
|
|
763
|
-
examples?: {
|
|
764
|
-
input?: any;
|
|
765
|
-
filter?: boolean;
|
|
766
|
-
reason?: string;
|
|
767
|
-
}[];
|
|
768
|
-
tokensPerItem?: number;
|
|
769
|
-
}>;
|
|
770
|
-
module "zai" {
|
|
771
|
-
interface Zai {
|
|
772
|
-
/** Filters elements of an array against a condition */
|
|
773
|
-
filter<T>(input: Array<T>, condition: string, options?: Options): Promise<Array<T>>;
|
|
774
|
-
}
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
declare module "operations/errors" {
|
|
778
|
-
export class JsonParsingError extends Error {
|
|
779
|
-
json: unknown;
|
|
780
|
-
error: Error;
|
|
781
|
-
constructor(json: unknown, error: Error);
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
declare module "operations/extract" {
|
|
785
|
-
import { ZodObject, z } from '@bpinternal/zui';
|
|
786
|
-
export type Options = z.input<typeof Options>;
|
|
787
|
-
const Options: ZodObject<{
|
|
788
|
-
instructions: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
789
|
-
chunkLength: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodNumber>>;
|
|
790
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
791
|
-
instructions?: string;
|
|
792
|
-
chunkLength?: number;
|
|
793
|
-
}, {
|
|
794
|
-
instructions?: string;
|
|
795
|
-
chunkLength?: number;
|
|
796
|
-
}>;
|
|
797
|
-
module "zai" {
|
|
798
|
-
interface Zai {
|
|
799
|
-
/** Extracts one or many elements from an arbitrary input */
|
|
800
|
-
extract<S extends z.AnyZodObject>(input: unknown, schema: S, options?: Options): Promise<z.infer<S>>;
|
|
801
|
-
extract<S extends z.AnyZodObject>(input: unknown, schema: z.ZodArray<S>, options?: Options): Promise<Array<z.infer<S>>>;
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
declare module "operations/label" {
|
|
806
|
-
import { z } from '@bpinternal/zui';
|
|
807
|
-
type Label = keyof typeof LABELS;
|
|
808
|
-
const LABELS: {
|
|
809
|
-
readonly ABSOLUTELY_NOT: "ABSOLUTELY_NOT";
|
|
810
|
-
readonly PROBABLY_NOT: "PROBABLY_NOT";
|
|
811
|
-
readonly AMBIGUOUS: "AMBIGUOUS";
|
|
812
|
-
readonly PROBABLY_YES: "PROBABLY_YES";
|
|
813
|
-
readonly ABSOLUTELY_YES: "ABSOLUTELY_YES";
|
|
814
|
-
};
|
|
815
|
-
type Example<T extends string> = {
|
|
816
|
-
input: unknown;
|
|
817
|
-
labels: Partial<Record<T, {
|
|
818
|
-
label: Label;
|
|
819
|
-
explanation?: string;
|
|
820
|
-
}>>;
|
|
821
|
-
};
|
|
822
|
-
export type Options<T extends string> = Omit<z.input<typeof Options>, 'examples'> & {
|
|
823
|
-
examples?: Array<Partial<Example<T>>>;
|
|
824
|
-
};
|
|
825
|
-
const Options: import("@bpinternal/zui").ZodObject<{
|
|
826
|
-
examples: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
827
|
-
input: import("@bpinternal/zui").ZodAny;
|
|
828
|
-
labels: import("@bpinternal/zui").ZodRecord<import("@bpinternal/zui").ZodString, import("@bpinternal/zui").ZodObject<{
|
|
829
|
-
label: import("@bpinternal/zui").ZodEnum<never>;
|
|
830
|
-
explanation: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
831
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
832
|
-
label: never;
|
|
833
|
-
explanation?: string;
|
|
834
|
-
}, {
|
|
835
|
-
label: never;
|
|
836
|
-
explanation?: string;
|
|
837
|
-
}>>;
|
|
838
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
839
|
-
input?: any;
|
|
840
|
-
labels?: Record<string, {
|
|
841
|
-
label: never;
|
|
842
|
-
explanation?: string;
|
|
843
|
-
}>;
|
|
844
|
-
}, {
|
|
845
|
-
input?: any;
|
|
846
|
-
labels?: Record<string, {
|
|
847
|
-
label: never;
|
|
848
|
-
explanation?: string;
|
|
849
|
-
}>;
|
|
850
|
-
}>, "many">>;
|
|
851
|
-
instructions: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
852
|
-
chunkLength: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodNumber>>;
|
|
853
|
-
}, "strip", import("@bpinternal/zui").ZodTypeAny, {
|
|
854
|
-
instructions?: string;
|
|
855
|
-
examples?: {
|
|
856
|
-
input?: any;
|
|
857
|
-
labels?: Record<string, {
|
|
858
|
-
label: never;
|
|
859
|
-
explanation?: string;
|
|
860
|
-
}>;
|
|
861
|
-
}[];
|
|
862
|
-
chunkLength?: number;
|
|
863
|
-
}, {
|
|
864
|
-
instructions?: string;
|
|
865
|
-
examples?: {
|
|
866
|
-
input?: any;
|
|
867
|
-
labels?: Record<string, {
|
|
868
|
-
label: never;
|
|
869
|
-
explanation?: string;
|
|
870
|
-
}>;
|
|
871
|
-
}[];
|
|
872
|
-
chunkLength?: number;
|
|
873
|
-
}>;
|
|
874
|
-
type Labels<T extends string> = Record<T, string>;
|
|
875
|
-
const Labels: z.ZodTransformer<import("@bpinternal/zui").ZodRecord<import("@bpinternal/zui").ZodString, import("@bpinternal/zui").ZodString>, Record<string, string>, Record<string, string>>;
|
|
876
|
-
module "zai" {
|
|
877
|
-
interface Zai {
|
|
878
|
-
/** Tags the provided input with a list of predefined labels */
|
|
879
|
-
label<T extends string>(input: unknown, labels: Labels<T>, options?: Options<T>): Promise<{
|
|
880
|
-
[K in T]: boolean;
|
|
881
|
-
}>;
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
}
|
|
885
|
-
declare module "index" {
|
|
886
|
-
import { Zai } from "zai";
|
|
887
|
-
import "operations/text";
|
|
888
|
-
import "operations/rewrite";
|
|
889
|
-
import "operations/summarize";
|
|
890
|
-
import "operations/check";
|
|
891
|
-
import "operations/filter";
|
|
892
|
-
import "operations/extract";
|
|
893
|
-
import "operations/label";
|
|
894
|
-
export { Zai };
|
|
895
|
-
}
|
|
896
|
-
declare module "env" {
|
|
897
|
-
export {};
|
|
898
|
-
}
|
|
899
|
-
declare module "scripts/update-models" {
|
|
900
|
-
import "env";
|
|
901
|
-
}
|