@llmops/core 1.0.0-beta.3 → 1.0.0-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/index.cjs +13788 -1499
- package/dist/index.d.cts +86 -1060
- package/dist/index.d.mts +86 -1060
- package/dist/index.mjs +13556 -1246
- package/package.json +2 -17
- package/dist/bun-sqlite-dialect-CHpTFgAo.mjs +0 -155
- package/dist/bun-sqlite-dialect-CVUG5QUU.cjs +0 -156
- package/dist/db/index.cjs +0 -40
- package/dist/db/index.d.cts +0 -2
- package/dist/db/index.d.mts +0 -2
- package/dist/db/index.mjs +0 -4
- package/dist/db-CZ8KtpL-.mjs +0 -14325
- package/dist/db-DZv0NtMm.cjs +0 -14640
- package/dist/index-BlFAMkmT.d.mts +0 -2711
- package/dist/index-DjIHdwhi.d.cts +0 -2711
- package/dist/neon-dialect-BOnuygPe.cjs +0 -3
- package/dist/neon-dialect-ByrFa9iy.cjs +0 -42
- package/dist/neon-dialect-DySGBYUi.mjs +0 -30
- package/dist/neon-dialect-Hmo08nUq.mjs +0 -3
- package/dist/node-sqlite-dialect-B5oKhOm1.mjs +0 -155
- package/dist/node-sqlite-dialect-fwmW40Ar.cjs +0 -156
|
@@ -1,2711 +0,0 @@
|
|
|
1
|
-
import { ColumnType, Dialect, Generated, Kysely, MssqlDialect, MysqlDialect, PostgresDialect, SqliteDialect } from "kysely";
|
|
2
|
-
import { NeonQueryFunction } from "@neondatabase/serverless";
|
|
3
|
-
import * as zod0 from "zod";
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
|
|
6
|
-
//#region src/db/schema.d.ts
|
|
7
|
-
declare const configsSchema: z.ZodObject<{
|
|
8
|
-
slug: z.ZodString;
|
|
9
|
-
name: z.ZodOptional<z.ZodString>;
|
|
10
|
-
id: z.ZodString;
|
|
11
|
-
createdAt: z.ZodDate;
|
|
12
|
-
updatedAt: z.ZodDate;
|
|
13
|
-
}, z.core.$strip>;
|
|
14
|
-
declare const variantsSchema: z.ZodObject<{
|
|
15
|
-
name: z.ZodString;
|
|
16
|
-
id: z.ZodString;
|
|
17
|
-
createdAt: z.ZodDate;
|
|
18
|
-
updatedAt: z.ZodDate;
|
|
19
|
-
}, z.core.$strip>;
|
|
20
|
-
declare const variantVersionsSchema: z.ZodObject<{
|
|
21
|
-
variantId: z.ZodString;
|
|
22
|
-
version: z.ZodNumber;
|
|
23
|
-
provider: z.ZodString;
|
|
24
|
-
modelName: z.ZodString;
|
|
25
|
-
jsonData: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
26
|
-
id: z.ZodString;
|
|
27
|
-
createdAt: z.ZodDate;
|
|
28
|
-
updatedAt: z.ZodDate;
|
|
29
|
-
}, z.core.$strip>;
|
|
30
|
-
declare const environmentsSchema: z.ZodObject<{
|
|
31
|
-
name: z.ZodString;
|
|
32
|
-
slug: z.ZodString;
|
|
33
|
-
isProd: z.ZodDefault<z.ZodBoolean>;
|
|
34
|
-
id: z.ZodString;
|
|
35
|
-
createdAt: z.ZodDate;
|
|
36
|
-
updatedAt: z.ZodDate;
|
|
37
|
-
}, z.core.$strip>;
|
|
38
|
-
declare const environmentSecretsSchema: z.ZodObject<{
|
|
39
|
-
environmentId: z.ZodString;
|
|
40
|
-
keyName: z.ZodString;
|
|
41
|
-
keyValue: z.ZodString;
|
|
42
|
-
id: z.ZodString;
|
|
43
|
-
createdAt: z.ZodDate;
|
|
44
|
-
updatedAt: z.ZodDate;
|
|
45
|
-
}, z.core.$strip>;
|
|
46
|
-
declare const configVariantsSchema: z.ZodObject<{
|
|
47
|
-
configId: z.ZodString;
|
|
48
|
-
variantId: z.ZodString;
|
|
49
|
-
id: z.ZodString;
|
|
50
|
-
createdAt: z.ZodDate;
|
|
51
|
-
updatedAt: z.ZodDate;
|
|
52
|
-
}, z.core.$strip>;
|
|
53
|
-
declare const targetingRulesSchema: z.ZodObject<{
|
|
54
|
-
environmentId: z.ZodString;
|
|
55
|
-
configId: z.ZodString;
|
|
56
|
-
configVariantId: z.ZodString;
|
|
57
|
-
variantVersionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
58
|
-
weight: z.ZodDefault<z.ZodNumber>;
|
|
59
|
-
priority: z.ZodDefault<z.ZodNumber>;
|
|
60
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
61
|
-
conditions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
62
|
-
id: z.ZodString;
|
|
63
|
-
createdAt: z.ZodDate;
|
|
64
|
-
updatedAt: z.ZodDate;
|
|
65
|
-
}, z.core.$strip>;
|
|
66
|
-
declare const workspaceSettingsSchema: z.ZodObject<{
|
|
67
|
-
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
68
|
-
setupComplete: z.ZodDefault<z.ZodBoolean>;
|
|
69
|
-
superAdminId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
70
|
-
id: z.ZodString;
|
|
71
|
-
createdAt: z.ZodDate;
|
|
72
|
-
updatedAt: z.ZodDate;
|
|
73
|
-
}, z.core.$strip>;
|
|
74
|
-
declare const providerConfigsSchema: z.ZodObject<{
|
|
75
|
-
providerId: z.ZodString;
|
|
76
|
-
slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
77
|
-
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
78
|
-
config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
79
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
80
|
-
id: z.ZodString;
|
|
81
|
-
createdAt: z.ZodDate;
|
|
82
|
-
updatedAt: z.ZodDate;
|
|
83
|
-
}, z.core.$strip>;
|
|
84
|
-
declare const playgroundColumnSchema: z.ZodObject<{
|
|
85
|
-
id: z.ZodString;
|
|
86
|
-
name: z.ZodString;
|
|
87
|
-
position: z.ZodNumber;
|
|
88
|
-
providerConfigId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
89
|
-
providerSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
90
|
-
modelName: z.ZodString;
|
|
91
|
-
messages: z.ZodArray<z.ZodObject<{
|
|
92
|
-
role: z.ZodEnum<{
|
|
93
|
-
system: "system";
|
|
94
|
-
user: "user";
|
|
95
|
-
assistant: "assistant";
|
|
96
|
-
}>;
|
|
97
|
-
content: z.ZodString;
|
|
98
|
-
}, z.core.$strip>>;
|
|
99
|
-
temperature: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
100
|
-
maxTokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
101
|
-
topP: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
102
|
-
frequencyPenalty: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
103
|
-
presencePenalty: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
104
|
-
}, z.core.$strip>;
|
|
105
|
-
declare const playgroundsSchema: z.ZodObject<{
|
|
106
|
-
name: z.ZodString;
|
|
107
|
-
datasetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
108
|
-
columns: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
109
|
-
id: z.ZodString;
|
|
110
|
-
name: z.ZodString;
|
|
111
|
-
position: z.ZodNumber;
|
|
112
|
-
providerConfigId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
113
|
-
providerSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
114
|
-
modelName: z.ZodString;
|
|
115
|
-
messages: z.ZodArray<z.ZodObject<{
|
|
116
|
-
role: z.ZodEnum<{
|
|
117
|
-
system: "system";
|
|
118
|
-
user: "user";
|
|
119
|
-
assistant: "assistant";
|
|
120
|
-
}>;
|
|
121
|
-
content: z.ZodString;
|
|
122
|
-
}, z.core.$strip>>;
|
|
123
|
-
temperature: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
124
|
-
maxTokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
125
|
-
topP: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
126
|
-
frequencyPenalty: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
127
|
-
presencePenalty: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
128
|
-
}, z.core.$strip>>>;
|
|
129
|
-
id: z.ZodString;
|
|
130
|
-
createdAt: z.ZodDate;
|
|
131
|
-
updatedAt: z.ZodDate;
|
|
132
|
-
}, z.core.$strip>;
|
|
133
|
-
declare const playgroundRunsSchema: z.ZodObject<{
|
|
134
|
-
playgroundId: z.ZodString;
|
|
135
|
-
datasetId: z.ZodNullable<z.ZodString>;
|
|
136
|
-
datasetVersionId: z.ZodNullable<z.ZodString>;
|
|
137
|
-
status: z.ZodEnum<{
|
|
138
|
-
pending: "pending";
|
|
139
|
-
running: "running";
|
|
140
|
-
completed: "completed";
|
|
141
|
-
failed: "failed";
|
|
142
|
-
cancelled: "cancelled";
|
|
143
|
-
}>;
|
|
144
|
-
startedAt: z.ZodNullable<z.ZodDate>;
|
|
145
|
-
completedAt: z.ZodNullable<z.ZodDate>;
|
|
146
|
-
totalRecords: z.ZodDefault<z.ZodNumber>;
|
|
147
|
-
completedRecords: z.ZodDefault<z.ZodNumber>;
|
|
148
|
-
id: z.ZodString;
|
|
149
|
-
createdAt: z.ZodDate;
|
|
150
|
-
updatedAt: z.ZodDate;
|
|
151
|
-
}, z.core.$strip>;
|
|
152
|
-
declare const playgroundResultsSchema: z.ZodObject<{
|
|
153
|
-
runId: z.ZodString;
|
|
154
|
-
columnId: z.ZodString;
|
|
155
|
-
datasetRecordId: z.ZodNullable<z.ZodString>;
|
|
156
|
-
inputVariables: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
157
|
-
outputContent: z.ZodNullable<z.ZodString>;
|
|
158
|
-
status: z.ZodEnum<{
|
|
159
|
-
pending: "pending";
|
|
160
|
-
running: "running";
|
|
161
|
-
completed: "completed";
|
|
162
|
-
failed: "failed";
|
|
163
|
-
}>;
|
|
164
|
-
error: z.ZodNullable<z.ZodString>;
|
|
165
|
-
latencyMs: z.ZodNullable<z.ZodNumber>;
|
|
166
|
-
promptTokens: z.ZodNullable<z.ZodNumber>;
|
|
167
|
-
completionTokens: z.ZodNullable<z.ZodNumber>;
|
|
168
|
-
totalTokens: z.ZodNullable<z.ZodNumber>;
|
|
169
|
-
cost: z.ZodNullable<z.ZodNumber>;
|
|
170
|
-
id: z.ZodString;
|
|
171
|
-
createdAt: z.ZodDate;
|
|
172
|
-
updatedAt: z.ZodDate;
|
|
173
|
-
}, z.core.$strip>;
|
|
174
|
-
declare const datasetsSchema: z.ZodObject<{
|
|
175
|
-
name: z.ZodString;
|
|
176
|
-
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
177
|
-
recordCount: z.ZodDefault<z.ZodNumber>;
|
|
178
|
-
latestVersionNumber: z.ZodDefault<z.ZodNumber>;
|
|
179
|
-
id: z.ZodString;
|
|
180
|
-
createdAt: z.ZodDate;
|
|
181
|
-
updatedAt: z.ZodDate;
|
|
182
|
-
}, z.core.$strip>;
|
|
183
|
-
declare const datasetVersionsSchema: z.ZodObject<{
|
|
184
|
-
datasetId: z.ZodString;
|
|
185
|
-
versionNumber: z.ZodNumber;
|
|
186
|
-
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
187
|
-
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
188
|
-
recordCount: z.ZodDefault<z.ZodNumber>;
|
|
189
|
-
snapshotHash: z.ZodString;
|
|
190
|
-
id: z.ZodString;
|
|
191
|
-
createdAt: z.ZodDate;
|
|
192
|
-
updatedAt: z.ZodDate;
|
|
193
|
-
}, z.core.$strip>;
|
|
194
|
-
declare const datasetRecordsSchema: z.ZodObject<{
|
|
195
|
-
datasetId: z.ZodString;
|
|
196
|
-
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
197
|
-
expected: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
198
|
-
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
199
|
-
id: z.ZodString;
|
|
200
|
-
createdAt: z.ZodDate;
|
|
201
|
-
updatedAt: z.ZodDate;
|
|
202
|
-
}, z.core.$strip>;
|
|
203
|
-
declare const datasetVersionRecordsSchema: z.ZodObject<{
|
|
204
|
-
datasetVersionId: z.ZodString;
|
|
205
|
-
datasetRecordId: z.ZodString;
|
|
206
|
-
position: z.ZodDefault<z.ZodNumber>;
|
|
207
|
-
id: z.ZodString;
|
|
208
|
-
createdAt: z.ZodDate;
|
|
209
|
-
updatedAt: z.ZodDate;
|
|
210
|
-
}, z.core.$strip>;
|
|
211
|
-
declare const guardrailConfigsSchema: z.ZodObject<{
|
|
212
|
-
name: z.ZodString;
|
|
213
|
-
pluginId: z.ZodString;
|
|
214
|
-
functionId: z.ZodString;
|
|
215
|
-
hookType: z.ZodEnum<{
|
|
216
|
-
beforeRequestHook: "beforeRequestHook";
|
|
217
|
-
afterRequestHook: "afterRequestHook";
|
|
218
|
-
}>;
|
|
219
|
-
parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
220
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
221
|
-
priority: z.ZodDefault<z.ZodNumber>;
|
|
222
|
-
onFail: z.ZodDefault<z.ZodEnum<{
|
|
223
|
-
block: "block";
|
|
224
|
-
log: "log";
|
|
225
|
-
}>>;
|
|
226
|
-
id: z.ZodString;
|
|
227
|
-
createdAt: z.ZodDate;
|
|
228
|
-
updatedAt: z.ZodDate;
|
|
229
|
-
}, z.core.$strip>;
|
|
230
|
-
declare const providerGuardrailOverridesSchema: z.ZodObject<{
|
|
231
|
-
providerConfigId: z.ZodString;
|
|
232
|
-
guardrailConfigId: z.ZodString;
|
|
233
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
234
|
-
parameters: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
235
|
-
id: z.ZodString;
|
|
236
|
-
createdAt: z.ZodDate;
|
|
237
|
-
updatedAt: z.ZodDate;
|
|
238
|
-
}, z.core.$strip>;
|
|
239
|
-
declare const guardrailResultSchema: z.ZodObject<{
|
|
240
|
-
checkId: z.ZodString;
|
|
241
|
-
functionId: z.ZodString;
|
|
242
|
-
hookType: z.ZodEnum<{
|
|
243
|
-
beforeRequestHook: "beforeRequestHook";
|
|
244
|
-
afterRequestHook: "afterRequestHook";
|
|
245
|
-
}>;
|
|
246
|
-
verdict: z.ZodBoolean;
|
|
247
|
-
latencyMs: z.ZodNumber;
|
|
248
|
-
}, z.core.$strip>;
|
|
249
|
-
declare const guardrailResultsSchema: z.ZodObject<{
|
|
250
|
-
results: z.ZodArray<z.ZodObject<{
|
|
251
|
-
checkId: z.ZodString;
|
|
252
|
-
functionId: z.ZodString;
|
|
253
|
-
hookType: z.ZodEnum<{
|
|
254
|
-
beforeRequestHook: "beforeRequestHook";
|
|
255
|
-
afterRequestHook: "afterRequestHook";
|
|
256
|
-
}>;
|
|
257
|
-
verdict: z.ZodBoolean;
|
|
258
|
-
latencyMs: z.ZodNumber;
|
|
259
|
-
}, z.core.$strip>>;
|
|
260
|
-
action: z.ZodEnum<{
|
|
261
|
-
allowed: "allowed";
|
|
262
|
-
blocked: "blocked";
|
|
263
|
-
logged: "logged";
|
|
264
|
-
}>;
|
|
265
|
-
totalLatencyMs: z.ZodNumber;
|
|
266
|
-
}, z.core.$strip>;
|
|
267
|
-
declare const llmRequestsSchema: z.ZodObject<{
|
|
268
|
-
requestId: z.ZodString;
|
|
269
|
-
configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
270
|
-
variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
271
|
-
environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
272
|
-
providerConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
273
|
-
provider: z.ZodString;
|
|
274
|
-
model: z.ZodString;
|
|
275
|
-
promptTokens: z.ZodDefault<z.ZodNumber>;
|
|
276
|
-
completionTokens: z.ZodDefault<z.ZodNumber>;
|
|
277
|
-
totalTokens: z.ZodDefault<z.ZodNumber>;
|
|
278
|
-
cachedTokens: z.ZodDefault<z.ZodNumber>;
|
|
279
|
-
cacheCreationTokens: z.ZodDefault<z.ZodNumber>;
|
|
280
|
-
cost: z.ZodDefault<z.ZodNumber>;
|
|
281
|
-
cacheSavings: z.ZodDefault<z.ZodNumber>;
|
|
282
|
-
inputCost: z.ZodDefault<z.ZodNumber>;
|
|
283
|
-
outputCost: z.ZodDefault<z.ZodNumber>;
|
|
284
|
-
endpoint: z.ZodString;
|
|
285
|
-
statusCode: z.ZodNumber;
|
|
286
|
-
latencyMs: z.ZodDefault<z.ZodNumber>;
|
|
287
|
-
isStreaming: z.ZodDefault<z.ZodBoolean>;
|
|
288
|
-
userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
289
|
-
tags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
290
|
-
guardrailResults: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
291
|
-
results: z.ZodArray<z.ZodObject<{
|
|
292
|
-
checkId: z.ZodString;
|
|
293
|
-
functionId: z.ZodString;
|
|
294
|
-
hookType: z.ZodEnum<{
|
|
295
|
-
beforeRequestHook: "beforeRequestHook";
|
|
296
|
-
afterRequestHook: "afterRequestHook";
|
|
297
|
-
}>;
|
|
298
|
-
verdict: z.ZodBoolean;
|
|
299
|
-
latencyMs: z.ZodNumber;
|
|
300
|
-
}, z.core.$strip>>;
|
|
301
|
-
action: z.ZodEnum<{
|
|
302
|
-
allowed: "allowed";
|
|
303
|
-
blocked: "blocked";
|
|
304
|
-
logged: "logged";
|
|
305
|
-
}>;
|
|
306
|
-
totalLatencyMs: z.ZodNumber;
|
|
307
|
-
}, z.core.$strip>>>;
|
|
308
|
-
traceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
309
|
-
spanId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
310
|
-
parentSpanId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
311
|
-
sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
312
|
-
id: z.ZodString;
|
|
313
|
-
createdAt: z.ZodDate;
|
|
314
|
-
updatedAt: z.ZodDate;
|
|
315
|
-
}, z.core.$strip>;
|
|
316
|
-
declare const tracesSchema: z.ZodObject<{
|
|
317
|
-
traceId: z.ZodString;
|
|
318
|
-
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
319
|
-
sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
320
|
-
userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
321
|
-
status: z.ZodDefault<z.ZodString>;
|
|
322
|
-
startTime: z.ZodDate;
|
|
323
|
-
endTime: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
324
|
-
durationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
325
|
-
spanCount: z.ZodDefault<z.ZodNumber>;
|
|
326
|
-
totalInputTokens: z.ZodDefault<z.ZodNumber>;
|
|
327
|
-
totalOutputTokens: z.ZodDefault<z.ZodNumber>;
|
|
328
|
-
totalTokens: z.ZodDefault<z.ZodNumber>;
|
|
329
|
-
totalCost: z.ZodDefault<z.ZodNumber>;
|
|
330
|
-
tags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
331
|
-
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
332
|
-
id: z.ZodString;
|
|
333
|
-
createdAt: z.ZodDate;
|
|
334
|
-
updatedAt: z.ZodDate;
|
|
335
|
-
}, z.core.$strip>;
|
|
336
|
-
declare const spansSchema: z.ZodObject<{
|
|
337
|
-
traceId: z.ZodString;
|
|
338
|
-
spanId: z.ZodString;
|
|
339
|
-
parentSpanId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
340
|
-
name: z.ZodString;
|
|
341
|
-
kind: z.ZodDefault<z.ZodNumber>;
|
|
342
|
-
status: z.ZodDefault<z.ZodNumber>;
|
|
343
|
-
statusMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
344
|
-
startTime: z.ZodDate;
|
|
345
|
-
endTime: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
346
|
-
durationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
347
|
-
provider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
348
|
-
model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
349
|
-
promptTokens: z.ZodDefault<z.ZodNumber>;
|
|
350
|
-
completionTokens: z.ZodDefault<z.ZodNumber>;
|
|
351
|
-
totalTokens: z.ZodDefault<z.ZodNumber>;
|
|
352
|
-
cost: z.ZodDefault<z.ZodNumber>;
|
|
353
|
-
configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
354
|
-
variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
355
|
-
environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
356
|
-
providerConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
357
|
-
requestId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
358
|
-
source: z.ZodDefault<z.ZodString>;
|
|
359
|
-
input: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
360
|
-
output: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
361
|
-
attributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
362
|
-
id: z.ZodString;
|
|
363
|
-
createdAt: z.ZodDate;
|
|
364
|
-
updatedAt: z.ZodDate;
|
|
365
|
-
}, z.core.$strip>;
|
|
366
|
-
declare const spanEventsSchema: z.ZodObject<{
|
|
367
|
-
id: z.ZodString;
|
|
368
|
-
traceId: z.ZodString;
|
|
369
|
-
spanId: z.ZodString;
|
|
370
|
-
name: z.ZodString;
|
|
371
|
-
timestamp: z.ZodDate;
|
|
372
|
-
attributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
373
|
-
createdAt: z.ZodDate;
|
|
374
|
-
}, z.core.$strip>;
|
|
375
|
-
/**
|
|
376
|
-
* Zod inferred types (for runtime validation)
|
|
377
|
-
*/
|
|
378
|
-
type Config = z.infer<typeof configsSchema>;
|
|
379
|
-
type Variant = z.infer<typeof variantsSchema>;
|
|
380
|
-
type VariantVersion = z.infer<typeof variantVersionsSchema>;
|
|
381
|
-
type Environment = z.infer<typeof environmentsSchema>;
|
|
382
|
-
type EnvironmentSecret = z.infer<typeof environmentSecretsSchema>;
|
|
383
|
-
type ConfigVariant = z.infer<typeof configVariantsSchema>;
|
|
384
|
-
type TargetingRule = z.infer<typeof targetingRulesSchema>;
|
|
385
|
-
type WorkspaceSettings = z.infer<typeof workspaceSettingsSchema>;
|
|
386
|
-
type ProviderConfig = z.infer<typeof providerConfigsSchema>;
|
|
387
|
-
type PlaygroundColumn = z.infer<typeof playgroundColumnSchema>;
|
|
388
|
-
type Playground = z.infer<typeof playgroundsSchema>;
|
|
389
|
-
type PlaygroundRun = z.infer<typeof playgroundRunsSchema>;
|
|
390
|
-
type PlaygroundResult = z.infer<typeof playgroundResultsSchema>;
|
|
391
|
-
type GuardrailConfig = z.infer<typeof guardrailConfigsSchema>;
|
|
392
|
-
type ProviderGuardrailOverride = z.infer<typeof providerGuardrailOverridesSchema>;
|
|
393
|
-
type GuardrailResult = z.infer<typeof guardrailResultSchema>;
|
|
394
|
-
type GuardrailResults = z.infer<typeof guardrailResultsSchema>;
|
|
395
|
-
type Dataset = z.infer<typeof datasetsSchema>;
|
|
396
|
-
type DatasetVersion = z.infer<typeof datasetVersionsSchema>;
|
|
397
|
-
type DatasetRecord = z.infer<typeof datasetRecordsSchema>;
|
|
398
|
-
type DatasetVersionRecord = z.infer<typeof datasetVersionRecordsSchema>;
|
|
399
|
-
type LLMRequest = z.infer<typeof llmRequestsSchema>;
|
|
400
|
-
type Trace = z.infer<typeof tracesSchema>;
|
|
401
|
-
type Span = z.infer<typeof spansSchema>;
|
|
402
|
-
type SpanEvent = z.infer<typeof spanEventsSchema>;
|
|
403
|
-
/**
|
|
404
|
-
* Kysely Table Interfaces
|
|
405
|
-
* Derived from Zod schemas with proper column types
|
|
406
|
-
*/
|
|
407
|
-
interface BaseTable {
|
|
408
|
-
id: Generated<string>;
|
|
409
|
-
createdAt: ColumnType<Date, string | undefined, string | undefined>;
|
|
410
|
-
updatedAt: ColumnType<Date, string | undefined, string | undefined>;
|
|
411
|
-
}
|
|
412
|
-
interface ConfigsTable extends BaseTable {
|
|
413
|
-
slug: string;
|
|
414
|
-
name?: string;
|
|
415
|
-
}
|
|
416
|
-
interface VariantsTable extends BaseTable {
|
|
417
|
-
name: string;
|
|
418
|
-
}
|
|
419
|
-
interface VariantVersionsTable extends BaseTable {
|
|
420
|
-
variantId: string;
|
|
421
|
-
version: number;
|
|
422
|
-
provider: string;
|
|
423
|
-
modelName: string;
|
|
424
|
-
jsonData: ColumnType<Record<string, unknown>, string, string>;
|
|
425
|
-
}
|
|
426
|
-
interface EnvironmentsTable extends BaseTable {
|
|
427
|
-
name: string;
|
|
428
|
-
slug: string;
|
|
429
|
-
isProd: ColumnType<boolean, boolean | undefined, boolean | undefined>;
|
|
430
|
-
}
|
|
431
|
-
interface EnvironmentSecretsTable extends BaseTable {
|
|
432
|
-
environmentId: string;
|
|
433
|
-
keyName: string;
|
|
434
|
-
keyValue: string;
|
|
435
|
-
}
|
|
436
|
-
interface ConfigVariantsTable extends BaseTable {
|
|
437
|
-
configId: string;
|
|
438
|
-
variantId: string;
|
|
439
|
-
}
|
|
440
|
-
interface TargetingRulesTable extends BaseTable {
|
|
441
|
-
environmentId: string;
|
|
442
|
-
configId: string;
|
|
443
|
-
configVariantId: string;
|
|
444
|
-
variantVersionId: string | null;
|
|
445
|
-
weight: ColumnType<number, number | undefined, number | undefined>;
|
|
446
|
-
priority: ColumnType<number, number | undefined, number | undefined>;
|
|
447
|
-
enabled: ColumnType<boolean, boolean | undefined, boolean | undefined>;
|
|
448
|
-
conditions: ColumnType<Record<string, unknown>, string, string>;
|
|
449
|
-
}
|
|
450
|
-
interface WorkspaceSettingsTable extends BaseTable {
|
|
451
|
-
name: string | null;
|
|
452
|
-
setupComplete: ColumnType<boolean, boolean | undefined, boolean | undefined>;
|
|
453
|
-
superAdminId: string | null;
|
|
454
|
-
}
|
|
455
|
-
interface ProviderConfigsTable extends BaseTable {
|
|
456
|
-
providerId: string;
|
|
457
|
-
slug: string | null;
|
|
458
|
-
name: string | null;
|
|
459
|
-
config: ColumnType<Record<string, unknown>, string, string>;
|
|
460
|
-
enabled: ColumnType<boolean, boolean | undefined, boolean | undefined>;
|
|
461
|
-
}
|
|
462
|
-
interface PlaygroundsTable extends BaseTable {
|
|
463
|
-
name: string;
|
|
464
|
-
datasetId: string | null;
|
|
465
|
-
columns: ColumnType<PlaygroundColumn[] | null, string | null, string | null>;
|
|
466
|
-
}
|
|
467
|
-
interface PlaygroundRunsTable extends BaseTable {
|
|
468
|
-
playgroundId: string;
|
|
469
|
-
datasetId: string | null;
|
|
470
|
-
datasetVersionId: string | null;
|
|
471
|
-
status: string;
|
|
472
|
-
startedAt: ColumnType<Date | null, string | null, string | null>;
|
|
473
|
-
completedAt: ColumnType<Date | null, string | null, string | null>;
|
|
474
|
-
totalRecords: ColumnType<number, number | undefined, number | undefined>;
|
|
475
|
-
completedRecords: ColumnType<number, number | undefined, number | undefined>;
|
|
476
|
-
}
|
|
477
|
-
interface PlaygroundResultsTable extends BaseTable {
|
|
478
|
-
runId: string;
|
|
479
|
-
columnId: string;
|
|
480
|
-
datasetRecordId: string | null;
|
|
481
|
-
inputVariables: ColumnType<Record<string, unknown>, string, string>;
|
|
482
|
-
outputContent: string | null;
|
|
483
|
-
status: string;
|
|
484
|
-
error: string | null;
|
|
485
|
-
latencyMs: number | null;
|
|
486
|
-
promptTokens: number | null;
|
|
487
|
-
completionTokens: number | null;
|
|
488
|
-
totalTokens: number | null;
|
|
489
|
-
cost: number | null;
|
|
490
|
-
}
|
|
491
|
-
interface DatasetsTable extends BaseTable {
|
|
492
|
-
name: string;
|
|
493
|
-
description: string | null;
|
|
494
|
-
recordCount: ColumnType<number, number | undefined, number | undefined>;
|
|
495
|
-
latestVersionNumber: ColumnType<number, number | undefined, number | undefined>;
|
|
496
|
-
}
|
|
497
|
-
interface DatasetVersionsTable extends BaseTable {
|
|
498
|
-
datasetId: string;
|
|
499
|
-
versionNumber: number;
|
|
500
|
-
name: string | null;
|
|
501
|
-
description: string | null;
|
|
502
|
-
recordCount: ColumnType<number, number | undefined, number | undefined>;
|
|
503
|
-
snapshotHash: string;
|
|
504
|
-
}
|
|
505
|
-
interface DatasetRecordsTable extends BaseTable {
|
|
506
|
-
datasetId: string;
|
|
507
|
-
input: ColumnType<Record<string, unknown>, string, string>;
|
|
508
|
-
expected: ColumnType<Record<string, unknown> | null, string | null, string | null>;
|
|
509
|
-
metadata: ColumnType<Record<string, unknown>, string, string>;
|
|
510
|
-
}
|
|
511
|
-
interface DatasetVersionRecordsTable extends BaseTable {
|
|
512
|
-
datasetVersionId: string;
|
|
513
|
-
datasetRecordId: string;
|
|
514
|
-
position: ColumnType<number, number | undefined, number | undefined>;
|
|
515
|
-
}
|
|
516
|
-
interface GuardrailConfigsTable extends BaseTable {
|
|
517
|
-
name: string;
|
|
518
|
-
pluginId: string;
|
|
519
|
-
functionId: string;
|
|
520
|
-
hookType: string;
|
|
521
|
-
parameters: ColumnType<Record<string, unknown>, string, string>;
|
|
522
|
-
enabled: ColumnType<boolean, boolean | undefined, boolean | undefined>;
|
|
523
|
-
priority: ColumnType<number, number | undefined, number | undefined>;
|
|
524
|
-
onFail: ColumnType<string, string | undefined, string | undefined>;
|
|
525
|
-
}
|
|
526
|
-
interface ProviderGuardrailOverridesTable extends BaseTable {
|
|
527
|
-
providerConfigId: string;
|
|
528
|
-
guardrailConfigId: string;
|
|
529
|
-
enabled: ColumnType<boolean, boolean | undefined, boolean | undefined>;
|
|
530
|
-
parameters: ColumnType<Record<string, unknown> | null, string | null, string | null>;
|
|
531
|
-
}
|
|
532
|
-
interface LLMRequestsTable extends BaseTable {
|
|
533
|
-
requestId: string;
|
|
534
|
-
configId: string | null;
|
|
535
|
-
variantId: string | null;
|
|
536
|
-
environmentId: string | null;
|
|
537
|
-
providerConfigId: string | null;
|
|
538
|
-
provider: string;
|
|
539
|
-
model: string;
|
|
540
|
-
promptTokens: ColumnType<number, number | undefined, number | undefined>;
|
|
541
|
-
completionTokens: ColumnType<number, number | undefined, number | undefined>;
|
|
542
|
-
totalTokens: ColumnType<number, number | undefined, number | undefined>;
|
|
543
|
-
cachedTokens: ColumnType<number, number | undefined, number | undefined>;
|
|
544
|
-
cacheCreationTokens: ColumnType<number, number | undefined, number | undefined>;
|
|
545
|
-
cost: ColumnType<number, number | undefined, number | undefined>;
|
|
546
|
-
cacheSavings: ColumnType<number, number | undefined, number | undefined>;
|
|
547
|
-
inputCost: ColumnType<number, number | undefined, number | undefined>;
|
|
548
|
-
outputCost: ColumnType<number, number | undefined, number | undefined>;
|
|
549
|
-
endpoint: string;
|
|
550
|
-
statusCode: number;
|
|
551
|
-
latencyMs: ColumnType<number, number | undefined, number | undefined>;
|
|
552
|
-
isStreaming: ColumnType<boolean, boolean | undefined, boolean | undefined>;
|
|
553
|
-
userId: string | null;
|
|
554
|
-
tags: ColumnType<Record<string, string>, string, string>;
|
|
555
|
-
guardrailResults: ColumnType<GuardrailResults | null, string | null, string | null>;
|
|
556
|
-
traceId: string | null;
|
|
557
|
-
spanId: string | null;
|
|
558
|
-
parentSpanId: string | null;
|
|
559
|
-
sessionId: string | null;
|
|
560
|
-
}
|
|
561
|
-
interface TracesTable extends BaseTable {
|
|
562
|
-
traceId: string;
|
|
563
|
-
name: string | null;
|
|
564
|
-
sessionId: string | null;
|
|
565
|
-
userId: string | null;
|
|
566
|
-
status: ColumnType<string, string | undefined, string | undefined>;
|
|
567
|
-
startTime: ColumnType<Date, string, string>;
|
|
568
|
-
endTime: ColumnType<Date | null, string | null, string | null>;
|
|
569
|
-
durationMs: number | null;
|
|
570
|
-
spanCount: ColumnType<number, number | undefined, number | undefined>;
|
|
571
|
-
totalInputTokens: ColumnType<number, number | undefined, number | undefined>;
|
|
572
|
-
totalOutputTokens: ColumnType<number, number | undefined, number | undefined>;
|
|
573
|
-
totalTokens: ColumnType<number, number | undefined, number | undefined>;
|
|
574
|
-
totalCost: ColumnType<number, number | undefined, number | undefined>;
|
|
575
|
-
tags: ColumnType<Record<string, string>, string, string>;
|
|
576
|
-
metadata: ColumnType<Record<string, unknown>, string, string>;
|
|
577
|
-
}
|
|
578
|
-
interface SpansTable extends BaseTable {
|
|
579
|
-
traceId: string;
|
|
580
|
-
spanId: string;
|
|
581
|
-
parentSpanId: string | null;
|
|
582
|
-
name: string;
|
|
583
|
-
kind: ColumnType<number, number | undefined, number | undefined>;
|
|
584
|
-
status: ColumnType<number, number | undefined, number | undefined>;
|
|
585
|
-
statusMessage: string | null;
|
|
586
|
-
startTime: ColumnType<Date, string, string>;
|
|
587
|
-
endTime: ColumnType<Date | null, string | null, string | null>;
|
|
588
|
-
durationMs: number | null;
|
|
589
|
-
provider: string | null;
|
|
590
|
-
model: string | null;
|
|
591
|
-
promptTokens: ColumnType<number, number | undefined, number | undefined>;
|
|
592
|
-
completionTokens: ColumnType<number, number | undefined, number | undefined>;
|
|
593
|
-
totalTokens: ColumnType<number, number | undefined, number | undefined>;
|
|
594
|
-
cost: ColumnType<number, number | undefined, number | undefined>;
|
|
595
|
-
configId: string | null;
|
|
596
|
-
variantId: string | null;
|
|
597
|
-
environmentId: string | null;
|
|
598
|
-
providerConfigId: string | null;
|
|
599
|
-
requestId: string | null;
|
|
600
|
-
source: ColumnType<string, string | undefined, string | undefined>;
|
|
601
|
-
input: ColumnType<unknown | null, string | null, string | null>;
|
|
602
|
-
output: ColumnType<unknown | null, string | null, string | null>;
|
|
603
|
-
attributes: ColumnType<Record<string, unknown>, string, string>;
|
|
604
|
-
}
|
|
605
|
-
interface SpanEventsTable {
|
|
606
|
-
id: Generated<string>;
|
|
607
|
-
traceId: string;
|
|
608
|
-
spanId: string;
|
|
609
|
-
name: string;
|
|
610
|
-
timestamp: ColumnType<Date, string, string>;
|
|
611
|
-
attributes: ColumnType<Record<string, unknown>, string, string>;
|
|
612
|
-
createdAt: ColumnType<Date, string | undefined, string | undefined>;
|
|
613
|
-
}
|
|
614
|
-
/**
|
|
615
|
-
* Main Kysely Database interface
|
|
616
|
-
*/
|
|
617
|
-
interface Database {
|
|
618
|
-
workspace_settings: WorkspaceSettingsTable;
|
|
619
|
-
playgrounds: PlaygroundsTable;
|
|
620
|
-
playground_runs: PlaygroundRunsTable;
|
|
621
|
-
playground_results: PlaygroundResultsTable;
|
|
622
|
-
datasets: DatasetsTable;
|
|
623
|
-
dataset_versions: DatasetVersionsTable;
|
|
624
|
-
dataset_records: DatasetRecordsTable;
|
|
625
|
-
dataset_version_records: DatasetVersionRecordsTable;
|
|
626
|
-
llm_requests: LLMRequestsTable;
|
|
627
|
-
traces: TracesTable;
|
|
628
|
-
spans: SpansTable;
|
|
629
|
-
span_events: SpanEventsTable;
|
|
630
|
-
}
|
|
631
|
-
/**
|
|
632
|
-
* Table names as a union type
|
|
633
|
-
*/
|
|
634
|
-
type TableName = keyof Database;
|
|
635
|
-
/**
|
|
636
|
-
* Utility types for type-safe operations
|
|
637
|
-
*/
|
|
638
|
-
type Insertable<T extends TableName> = { [K in keyof Database[T]]: Database[T][K] extends ColumnType<infer _SelectType, infer InsertType, infer _UpdateType> ? InsertType : Database[T][K] extends Generated<infer _GeneratedType> ? never : Database[T][K] };
|
|
639
|
-
type Selectable<T extends TableName> = { [K in keyof Database[T]]: Database[T][K] extends ColumnType<infer SelectType, infer _InsertType, infer _UpdateType> ? SelectType : Database[T][K] extends Generated<infer GeneratedType> ? GeneratedType : Database[T][K] };
|
|
640
|
-
type Updateable<T extends TableName> = { [K in keyof Database[T]]?: Database[T][K] extends ColumnType<infer _SelectType, infer _InsertType, infer UpdateType> ? UpdateType : Database[T][K] extends Generated<infer _GeneratedType> ? never : Database[T][K] };
|
|
641
|
-
/**
|
|
642
|
-
* Schema metadata for migrations
|
|
643
|
-
* Derived from Zod schemas
|
|
644
|
-
*/
|
|
645
|
-
declare const SCHEMA_METADATA: {
|
|
646
|
-
readonly tables: {
|
|
647
|
-
readonly workspace_settings: {
|
|
648
|
-
readonly order: 8;
|
|
649
|
-
readonly schema: z.ZodObject<{
|
|
650
|
-
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
651
|
-
setupComplete: z.ZodDefault<z.ZodBoolean>;
|
|
652
|
-
superAdminId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
653
|
-
id: z.ZodString;
|
|
654
|
-
createdAt: z.ZodDate;
|
|
655
|
-
updatedAt: z.ZodDate;
|
|
656
|
-
}, z.core.$strip>;
|
|
657
|
-
readonly fields: {
|
|
658
|
-
readonly id: {
|
|
659
|
-
readonly type: "uuid";
|
|
660
|
-
readonly primaryKey: true;
|
|
661
|
-
};
|
|
662
|
-
readonly name: {
|
|
663
|
-
readonly type: "text";
|
|
664
|
-
readonly nullable: true;
|
|
665
|
-
};
|
|
666
|
-
readonly setupComplete: {
|
|
667
|
-
readonly type: "boolean";
|
|
668
|
-
readonly default: false;
|
|
669
|
-
};
|
|
670
|
-
readonly superAdminId: {
|
|
671
|
-
readonly type: "text";
|
|
672
|
-
readonly nullable: true;
|
|
673
|
-
};
|
|
674
|
-
readonly createdAt: {
|
|
675
|
-
readonly type: "timestamp";
|
|
676
|
-
readonly default: "now()";
|
|
677
|
-
};
|
|
678
|
-
readonly updatedAt: {
|
|
679
|
-
readonly type: "timestamp";
|
|
680
|
-
readonly default: "now()";
|
|
681
|
-
readonly onUpdate: "now()";
|
|
682
|
-
};
|
|
683
|
-
};
|
|
684
|
-
};
|
|
685
|
-
readonly playgrounds: {
|
|
686
|
-
readonly order: 20;
|
|
687
|
-
readonly schema: z.ZodObject<{
|
|
688
|
-
name: z.ZodString;
|
|
689
|
-
datasetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
690
|
-
columns: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
691
|
-
id: z.ZodString;
|
|
692
|
-
name: z.ZodString;
|
|
693
|
-
position: z.ZodNumber;
|
|
694
|
-
providerConfigId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
695
|
-
providerSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
696
|
-
modelName: z.ZodString;
|
|
697
|
-
messages: z.ZodArray<z.ZodObject<{
|
|
698
|
-
role: z.ZodEnum<{
|
|
699
|
-
system: "system";
|
|
700
|
-
user: "user";
|
|
701
|
-
assistant: "assistant";
|
|
702
|
-
}>;
|
|
703
|
-
content: z.ZodString;
|
|
704
|
-
}, z.core.$strip>>;
|
|
705
|
-
temperature: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
706
|
-
maxTokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
707
|
-
topP: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
708
|
-
frequencyPenalty: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
709
|
-
presencePenalty: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
710
|
-
}, z.core.$strip>>>;
|
|
711
|
-
id: z.ZodString;
|
|
712
|
-
createdAt: z.ZodDate;
|
|
713
|
-
updatedAt: z.ZodDate;
|
|
714
|
-
}, z.core.$strip>;
|
|
715
|
-
readonly fields: {
|
|
716
|
-
readonly id: {
|
|
717
|
-
readonly type: "uuid";
|
|
718
|
-
readonly primaryKey: true;
|
|
719
|
-
};
|
|
720
|
-
readonly name: {
|
|
721
|
-
readonly type: "text";
|
|
722
|
-
};
|
|
723
|
-
readonly datasetId: {
|
|
724
|
-
readonly type: "uuid";
|
|
725
|
-
readonly nullable: true;
|
|
726
|
-
readonly references: {
|
|
727
|
-
readonly table: "datasets";
|
|
728
|
-
readonly column: "id";
|
|
729
|
-
};
|
|
730
|
-
};
|
|
731
|
-
readonly columns: {
|
|
732
|
-
readonly type: "jsonb";
|
|
733
|
-
readonly nullable: true;
|
|
734
|
-
};
|
|
735
|
-
readonly createdAt: {
|
|
736
|
-
readonly type: "timestamp";
|
|
737
|
-
readonly default: "now()";
|
|
738
|
-
};
|
|
739
|
-
readonly updatedAt: {
|
|
740
|
-
readonly type: "timestamp";
|
|
741
|
-
readonly default: "now()";
|
|
742
|
-
readonly onUpdate: "now()";
|
|
743
|
-
};
|
|
744
|
-
};
|
|
745
|
-
};
|
|
746
|
-
readonly playground_runs: {
|
|
747
|
-
readonly order: 21;
|
|
748
|
-
readonly schema: z.ZodObject<{
|
|
749
|
-
playgroundId: z.ZodString;
|
|
750
|
-
datasetId: z.ZodNullable<z.ZodString>;
|
|
751
|
-
datasetVersionId: z.ZodNullable<z.ZodString>;
|
|
752
|
-
status: z.ZodEnum<{
|
|
753
|
-
pending: "pending";
|
|
754
|
-
running: "running";
|
|
755
|
-
completed: "completed";
|
|
756
|
-
failed: "failed";
|
|
757
|
-
cancelled: "cancelled";
|
|
758
|
-
}>;
|
|
759
|
-
startedAt: z.ZodNullable<z.ZodDate>;
|
|
760
|
-
completedAt: z.ZodNullable<z.ZodDate>;
|
|
761
|
-
totalRecords: z.ZodDefault<z.ZodNumber>;
|
|
762
|
-
completedRecords: z.ZodDefault<z.ZodNumber>;
|
|
763
|
-
id: z.ZodString;
|
|
764
|
-
createdAt: z.ZodDate;
|
|
765
|
-
updatedAt: z.ZodDate;
|
|
766
|
-
}, z.core.$strip>;
|
|
767
|
-
readonly fields: {
|
|
768
|
-
readonly id: {
|
|
769
|
-
readonly type: "uuid";
|
|
770
|
-
readonly primaryKey: true;
|
|
771
|
-
};
|
|
772
|
-
readonly playgroundId: {
|
|
773
|
-
readonly type: "uuid";
|
|
774
|
-
readonly references: {
|
|
775
|
-
readonly table: "playgrounds";
|
|
776
|
-
readonly column: "id";
|
|
777
|
-
};
|
|
778
|
-
};
|
|
779
|
-
readonly datasetId: {
|
|
780
|
-
readonly type: "uuid";
|
|
781
|
-
readonly nullable: true;
|
|
782
|
-
readonly references: {
|
|
783
|
-
readonly table: "datasets";
|
|
784
|
-
readonly column: "id";
|
|
785
|
-
};
|
|
786
|
-
};
|
|
787
|
-
readonly datasetVersionId: {
|
|
788
|
-
readonly type: "uuid";
|
|
789
|
-
readonly nullable: true;
|
|
790
|
-
readonly references: {
|
|
791
|
-
readonly table: "dataset_versions";
|
|
792
|
-
readonly column: "id";
|
|
793
|
-
};
|
|
794
|
-
};
|
|
795
|
-
readonly status: {
|
|
796
|
-
readonly type: "text";
|
|
797
|
-
};
|
|
798
|
-
readonly startedAt: {
|
|
799
|
-
readonly type: "timestamp";
|
|
800
|
-
readonly nullable: true;
|
|
801
|
-
};
|
|
802
|
-
readonly completedAt: {
|
|
803
|
-
readonly type: "timestamp";
|
|
804
|
-
readonly nullable: true;
|
|
805
|
-
};
|
|
806
|
-
readonly totalRecords: {
|
|
807
|
-
readonly type: "integer";
|
|
808
|
-
readonly default: 0;
|
|
809
|
-
};
|
|
810
|
-
readonly completedRecords: {
|
|
811
|
-
readonly type: "integer";
|
|
812
|
-
readonly default: 0;
|
|
813
|
-
};
|
|
814
|
-
readonly createdAt: {
|
|
815
|
-
readonly type: "timestamp";
|
|
816
|
-
readonly default: "now()";
|
|
817
|
-
};
|
|
818
|
-
readonly updatedAt: {
|
|
819
|
-
readonly type: "timestamp";
|
|
820
|
-
readonly default: "now()";
|
|
821
|
-
readonly onUpdate: "now()";
|
|
822
|
-
};
|
|
823
|
-
};
|
|
824
|
-
};
|
|
825
|
-
readonly playground_results: {
|
|
826
|
-
readonly order: 22;
|
|
827
|
-
readonly schema: z.ZodObject<{
|
|
828
|
-
runId: z.ZodString;
|
|
829
|
-
columnId: z.ZodString;
|
|
830
|
-
datasetRecordId: z.ZodNullable<z.ZodString>;
|
|
831
|
-
inputVariables: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
832
|
-
outputContent: z.ZodNullable<z.ZodString>;
|
|
833
|
-
status: z.ZodEnum<{
|
|
834
|
-
pending: "pending";
|
|
835
|
-
running: "running";
|
|
836
|
-
completed: "completed";
|
|
837
|
-
failed: "failed";
|
|
838
|
-
}>;
|
|
839
|
-
error: z.ZodNullable<z.ZodString>;
|
|
840
|
-
latencyMs: z.ZodNullable<z.ZodNumber>;
|
|
841
|
-
promptTokens: z.ZodNullable<z.ZodNumber>;
|
|
842
|
-
completionTokens: z.ZodNullable<z.ZodNumber>;
|
|
843
|
-
totalTokens: z.ZodNullable<z.ZodNumber>;
|
|
844
|
-
cost: z.ZodNullable<z.ZodNumber>;
|
|
845
|
-
id: z.ZodString;
|
|
846
|
-
createdAt: z.ZodDate;
|
|
847
|
-
updatedAt: z.ZodDate;
|
|
848
|
-
}, z.core.$strip>;
|
|
849
|
-
readonly fields: {
|
|
850
|
-
readonly id: {
|
|
851
|
-
readonly type: "uuid";
|
|
852
|
-
readonly primaryKey: true;
|
|
853
|
-
};
|
|
854
|
-
readonly runId: {
|
|
855
|
-
readonly type: "uuid";
|
|
856
|
-
readonly references: {
|
|
857
|
-
readonly table: "playground_runs";
|
|
858
|
-
readonly column: "id";
|
|
859
|
-
};
|
|
860
|
-
};
|
|
861
|
-
readonly columnId: {
|
|
862
|
-
readonly type: "uuid";
|
|
863
|
-
};
|
|
864
|
-
readonly datasetRecordId: {
|
|
865
|
-
readonly type: "uuid";
|
|
866
|
-
readonly nullable: true;
|
|
867
|
-
readonly references: {
|
|
868
|
-
readonly table: "dataset_records";
|
|
869
|
-
readonly column: "id";
|
|
870
|
-
};
|
|
871
|
-
};
|
|
872
|
-
readonly inputVariables: {
|
|
873
|
-
readonly type: "jsonb";
|
|
874
|
-
readonly default: "{}";
|
|
875
|
-
};
|
|
876
|
-
readonly outputContent: {
|
|
877
|
-
readonly type: "text";
|
|
878
|
-
readonly nullable: true;
|
|
879
|
-
};
|
|
880
|
-
readonly status: {
|
|
881
|
-
readonly type: "text";
|
|
882
|
-
};
|
|
883
|
-
readonly error: {
|
|
884
|
-
readonly type: "text";
|
|
885
|
-
readonly nullable: true;
|
|
886
|
-
};
|
|
887
|
-
readonly latencyMs: {
|
|
888
|
-
readonly type: "integer";
|
|
889
|
-
readonly nullable: true;
|
|
890
|
-
};
|
|
891
|
-
readonly promptTokens: {
|
|
892
|
-
readonly type: "integer";
|
|
893
|
-
readonly nullable: true;
|
|
894
|
-
};
|
|
895
|
-
readonly completionTokens: {
|
|
896
|
-
readonly type: "integer";
|
|
897
|
-
readonly nullable: true;
|
|
898
|
-
};
|
|
899
|
-
readonly totalTokens: {
|
|
900
|
-
readonly type: "integer";
|
|
901
|
-
readonly nullable: true;
|
|
902
|
-
};
|
|
903
|
-
readonly cost: {
|
|
904
|
-
readonly type: "integer";
|
|
905
|
-
readonly nullable: true;
|
|
906
|
-
};
|
|
907
|
-
readonly createdAt: {
|
|
908
|
-
readonly type: "timestamp";
|
|
909
|
-
readonly default: "now()";
|
|
910
|
-
};
|
|
911
|
-
readonly updatedAt: {
|
|
912
|
-
readonly type: "timestamp";
|
|
913
|
-
readonly default: "now()";
|
|
914
|
-
readonly onUpdate: "now()";
|
|
915
|
-
};
|
|
916
|
-
};
|
|
917
|
-
};
|
|
918
|
-
readonly datasets: {
|
|
919
|
-
readonly order: 10;
|
|
920
|
-
readonly schema: z.ZodObject<{
|
|
921
|
-
name: z.ZodString;
|
|
922
|
-
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
923
|
-
recordCount: z.ZodDefault<z.ZodNumber>;
|
|
924
|
-
latestVersionNumber: z.ZodDefault<z.ZodNumber>;
|
|
925
|
-
id: z.ZodString;
|
|
926
|
-
createdAt: z.ZodDate;
|
|
927
|
-
updatedAt: z.ZodDate;
|
|
928
|
-
}, z.core.$strip>;
|
|
929
|
-
readonly fields: {
|
|
930
|
-
readonly id: {
|
|
931
|
-
readonly type: "uuid";
|
|
932
|
-
readonly primaryKey: true;
|
|
933
|
-
};
|
|
934
|
-
readonly name: {
|
|
935
|
-
readonly type: "text";
|
|
936
|
-
};
|
|
937
|
-
readonly description: {
|
|
938
|
-
readonly type: "text";
|
|
939
|
-
readonly nullable: true;
|
|
940
|
-
};
|
|
941
|
-
readonly recordCount: {
|
|
942
|
-
readonly type: "integer";
|
|
943
|
-
readonly default: 0;
|
|
944
|
-
};
|
|
945
|
-
readonly latestVersionNumber: {
|
|
946
|
-
readonly type: "integer";
|
|
947
|
-
readonly default: 1;
|
|
948
|
-
};
|
|
949
|
-
readonly createdAt: {
|
|
950
|
-
readonly type: "timestamp";
|
|
951
|
-
readonly default: "now()";
|
|
952
|
-
};
|
|
953
|
-
readonly updatedAt: {
|
|
954
|
-
readonly type: "timestamp";
|
|
955
|
-
readonly default: "now()";
|
|
956
|
-
readonly onUpdate: "now()";
|
|
957
|
-
};
|
|
958
|
-
};
|
|
959
|
-
};
|
|
960
|
-
readonly dataset_versions: {
|
|
961
|
-
readonly order: 11;
|
|
962
|
-
readonly schema: z.ZodObject<{
|
|
963
|
-
datasetId: z.ZodString;
|
|
964
|
-
versionNumber: z.ZodNumber;
|
|
965
|
-
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
966
|
-
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
967
|
-
recordCount: z.ZodDefault<z.ZodNumber>;
|
|
968
|
-
snapshotHash: z.ZodString;
|
|
969
|
-
id: z.ZodString;
|
|
970
|
-
createdAt: z.ZodDate;
|
|
971
|
-
updatedAt: z.ZodDate;
|
|
972
|
-
}, z.core.$strip>;
|
|
973
|
-
readonly fields: {
|
|
974
|
-
readonly id: {
|
|
975
|
-
readonly type: "uuid";
|
|
976
|
-
readonly primaryKey: true;
|
|
977
|
-
};
|
|
978
|
-
readonly datasetId: {
|
|
979
|
-
readonly type: "uuid";
|
|
980
|
-
readonly references: {
|
|
981
|
-
readonly table: "datasets";
|
|
982
|
-
readonly column: "id";
|
|
983
|
-
};
|
|
984
|
-
};
|
|
985
|
-
readonly versionNumber: {
|
|
986
|
-
readonly type: "integer";
|
|
987
|
-
};
|
|
988
|
-
readonly name: {
|
|
989
|
-
readonly type: "text";
|
|
990
|
-
readonly nullable: true;
|
|
991
|
-
};
|
|
992
|
-
readonly description: {
|
|
993
|
-
readonly type: "text";
|
|
994
|
-
readonly nullable: true;
|
|
995
|
-
};
|
|
996
|
-
readonly recordCount: {
|
|
997
|
-
readonly type: "integer";
|
|
998
|
-
readonly default: 0;
|
|
999
|
-
};
|
|
1000
|
-
readonly snapshotHash: {
|
|
1001
|
-
readonly type: "text";
|
|
1002
|
-
};
|
|
1003
|
-
readonly createdAt: {
|
|
1004
|
-
readonly type: "timestamp";
|
|
1005
|
-
readonly default: "now()";
|
|
1006
|
-
};
|
|
1007
|
-
readonly updatedAt: {
|
|
1008
|
-
readonly type: "timestamp";
|
|
1009
|
-
readonly default: "now()";
|
|
1010
|
-
readonly onUpdate: "now()";
|
|
1011
|
-
};
|
|
1012
|
-
};
|
|
1013
|
-
readonly uniqueConstraints: readonly [{
|
|
1014
|
-
readonly columns: readonly ["datasetId", "versionNumber"];
|
|
1015
|
-
}];
|
|
1016
|
-
};
|
|
1017
|
-
readonly dataset_records: {
|
|
1018
|
-
readonly order: 12;
|
|
1019
|
-
readonly schema: z.ZodObject<{
|
|
1020
|
-
datasetId: z.ZodString;
|
|
1021
|
-
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1022
|
-
expected: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
1023
|
-
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1024
|
-
id: z.ZodString;
|
|
1025
|
-
createdAt: z.ZodDate;
|
|
1026
|
-
updatedAt: z.ZodDate;
|
|
1027
|
-
}, z.core.$strip>;
|
|
1028
|
-
readonly fields: {
|
|
1029
|
-
readonly id: {
|
|
1030
|
-
readonly type: "uuid";
|
|
1031
|
-
readonly primaryKey: true;
|
|
1032
|
-
};
|
|
1033
|
-
readonly datasetId: {
|
|
1034
|
-
readonly type: "uuid";
|
|
1035
|
-
readonly references: {
|
|
1036
|
-
readonly table: "datasets";
|
|
1037
|
-
readonly column: "id";
|
|
1038
|
-
};
|
|
1039
|
-
};
|
|
1040
|
-
readonly input: {
|
|
1041
|
-
readonly type: "jsonb";
|
|
1042
|
-
};
|
|
1043
|
-
readonly expected: {
|
|
1044
|
-
readonly type: "jsonb";
|
|
1045
|
-
readonly nullable: true;
|
|
1046
|
-
};
|
|
1047
|
-
readonly metadata: {
|
|
1048
|
-
readonly type: "jsonb";
|
|
1049
|
-
readonly default: "{}";
|
|
1050
|
-
};
|
|
1051
|
-
readonly createdAt: {
|
|
1052
|
-
readonly type: "timestamp";
|
|
1053
|
-
readonly default: "now()";
|
|
1054
|
-
};
|
|
1055
|
-
readonly updatedAt: {
|
|
1056
|
-
readonly type: "timestamp";
|
|
1057
|
-
readonly default: "now()";
|
|
1058
|
-
readonly onUpdate: "now()";
|
|
1059
|
-
};
|
|
1060
|
-
};
|
|
1061
|
-
};
|
|
1062
|
-
readonly dataset_version_records: {
|
|
1063
|
-
readonly order: 13;
|
|
1064
|
-
readonly schema: z.ZodObject<{
|
|
1065
|
-
datasetVersionId: z.ZodString;
|
|
1066
|
-
datasetRecordId: z.ZodString;
|
|
1067
|
-
position: z.ZodDefault<z.ZodNumber>;
|
|
1068
|
-
id: z.ZodString;
|
|
1069
|
-
createdAt: z.ZodDate;
|
|
1070
|
-
updatedAt: z.ZodDate;
|
|
1071
|
-
}, z.core.$strip>;
|
|
1072
|
-
readonly fields: {
|
|
1073
|
-
readonly id: {
|
|
1074
|
-
readonly type: "uuid";
|
|
1075
|
-
readonly primaryKey: true;
|
|
1076
|
-
};
|
|
1077
|
-
readonly datasetVersionId: {
|
|
1078
|
-
readonly type: "uuid";
|
|
1079
|
-
readonly references: {
|
|
1080
|
-
readonly table: "dataset_versions";
|
|
1081
|
-
readonly column: "id";
|
|
1082
|
-
};
|
|
1083
|
-
};
|
|
1084
|
-
readonly datasetRecordId: {
|
|
1085
|
-
readonly type: "uuid";
|
|
1086
|
-
readonly references: {
|
|
1087
|
-
readonly table: "dataset_records";
|
|
1088
|
-
readonly column: "id";
|
|
1089
|
-
};
|
|
1090
|
-
};
|
|
1091
|
-
readonly position: {
|
|
1092
|
-
readonly type: "integer";
|
|
1093
|
-
readonly default: 0;
|
|
1094
|
-
};
|
|
1095
|
-
readonly createdAt: {
|
|
1096
|
-
readonly type: "timestamp";
|
|
1097
|
-
readonly default: "now()";
|
|
1098
|
-
};
|
|
1099
|
-
readonly updatedAt: {
|
|
1100
|
-
readonly type: "timestamp";
|
|
1101
|
-
readonly default: "now()";
|
|
1102
|
-
readonly onUpdate: "now()";
|
|
1103
|
-
};
|
|
1104
|
-
};
|
|
1105
|
-
readonly uniqueConstraints: readonly [{
|
|
1106
|
-
readonly columns: readonly ["datasetVersionId", "datasetRecordId"];
|
|
1107
|
-
}];
|
|
1108
|
-
};
|
|
1109
|
-
readonly llm_requests: {
|
|
1110
|
-
readonly order: 17;
|
|
1111
|
-
readonly schema: z.ZodObject<{
|
|
1112
|
-
requestId: z.ZodString;
|
|
1113
|
-
configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1114
|
-
variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1115
|
-
environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1116
|
-
providerConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1117
|
-
provider: z.ZodString;
|
|
1118
|
-
model: z.ZodString;
|
|
1119
|
-
promptTokens: z.ZodDefault<z.ZodNumber>;
|
|
1120
|
-
completionTokens: z.ZodDefault<z.ZodNumber>;
|
|
1121
|
-
totalTokens: z.ZodDefault<z.ZodNumber>;
|
|
1122
|
-
cachedTokens: z.ZodDefault<z.ZodNumber>;
|
|
1123
|
-
cacheCreationTokens: z.ZodDefault<z.ZodNumber>;
|
|
1124
|
-
cost: z.ZodDefault<z.ZodNumber>;
|
|
1125
|
-
cacheSavings: z.ZodDefault<z.ZodNumber>;
|
|
1126
|
-
inputCost: z.ZodDefault<z.ZodNumber>;
|
|
1127
|
-
outputCost: z.ZodDefault<z.ZodNumber>;
|
|
1128
|
-
endpoint: z.ZodString;
|
|
1129
|
-
statusCode: z.ZodNumber;
|
|
1130
|
-
latencyMs: z.ZodDefault<z.ZodNumber>;
|
|
1131
|
-
isStreaming: z.ZodDefault<z.ZodBoolean>;
|
|
1132
|
-
userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1133
|
-
tags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1134
|
-
guardrailResults: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1135
|
-
results: z.ZodArray<z.ZodObject<{
|
|
1136
|
-
checkId: z.ZodString;
|
|
1137
|
-
functionId: z.ZodString;
|
|
1138
|
-
hookType: z.ZodEnum<{
|
|
1139
|
-
beforeRequestHook: "beforeRequestHook";
|
|
1140
|
-
afterRequestHook: "afterRequestHook";
|
|
1141
|
-
}>;
|
|
1142
|
-
verdict: z.ZodBoolean;
|
|
1143
|
-
latencyMs: z.ZodNumber;
|
|
1144
|
-
}, z.core.$strip>>;
|
|
1145
|
-
action: z.ZodEnum<{
|
|
1146
|
-
allowed: "allowed";
|
|
1147
|
-
blocked: "blocked";
|
|
1148
|
-
logged: "logged";
|
|
1149
|
-
}>;
|
|
1150
|
-
totalLatencyMs: z.ZodNumber;
|
|
1151
|
-
}, z.core.$strip>>>;
|
|
1152
|
-
traceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1153
|
-
spanId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1154
|
-
parentSpanId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1155
|
-
sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1156
|
-
id: z.ZodString;
|
|
1157
|
-
createdAt: z.ZodDate;
|
|
1158
|
-
updatedAt: z.ZodDate;
|
|
1159
|
-
}, z.core.$strip>;
|
|
1160
|
-
readonly fields: {
|
|
1161
|
-
readonly id: {
|
|
1162
|
-
readonly type: "uuid";
|
|
1163
|
-
readonly primaryKey: true;
|
|
1164
|
-
};
|
|
1165
|
-
readonly requestId: {
|
|
1166
|
-
readonly type: "uuid";
|
|
1167
|
-
};
|
|
1168
|
-
readonly configId: {
|
|
1169
|
-
readonly type: "uuid";
|
|
1170
|
-
readonly nullable: true;
|
|
1171
|
-
readonly references: {
|
|
1172
|
-
readonly table: "configs";
|
|
1173
|
-
readonly column: "id";
|
|
1174
|
-
};
|
|
1175
|
-
};
|
|
1176
|
-
readonly variantId: {
|
|
1177
|
-
readonly type: "uuid";
|
|
1178
|
-
readonly nullable: true;
|
|
1179
|
-
readonly references: {
|
|
1180
|
-
readonly table: "variants";
|
|
1181
|
-
readonly column: "id";
|
|
1182
|
-
};
|
|
1183
|
-
};
|
|
1184
|
-
readonly environmentId: {
|
|
1185
|
-
readonly type: "uuid";
|
|
1186
|
-
readonly nullable: true;
|
|
1187
|
-
readonly references: {
|
|
1188
|
-
readonly table: "environments";
|
|
1189
|
-
readonly column: "id";
|
|
1190
|
-
};
|
|
1191
|
-
};
|
|
1192
|
-
readonly providerConfigId: {
|
|
1193
|
-
readonly type: "uuid";
|
|
1194
|
-
readonly nullable: true;
|
|
1195
|
-
readonly references: {
|
|
1196
|
-
readonly table: "provider_configs";
|
|
1197
|
-
readonly column: "id";
|
|
1198
|
-
};
|
|
1199
|
-
};
|
|
1200
|
-
readonly provider: {
|
|
1201
|
-
readonly type: "text";
|
|
1202
|
-
};
|
|
1203
|
-
readonly model: {
|
|
1204
|
-
readonly type: "text";
|
|
1205
|
-
};
|
|
1206
|
-
readonly promptTokens: {
|
|
1207
|
-
readonly type: "integer";
|
|
1208
|
-
readonly default: 0;
|
|
1209
|
-
};
|
|
1210
|
-
readonly completionTokens: {
|
|
1211
|
-
readonly type: "integer";
|
|
1212
|
-
readonly default: 0;
|
|
1213
|
-
};
|
|
1214
|
-
readonly totalTokens: {
|
|
1215
|
-
readonly type: "integer";
|
|
1216
|
-
readonly default: 0;
|
|
1217
|
-
};
|
|
1218
|
-
readonly cachedTokens: {
|
|
1219
|
-
readonly type: "integer";
|
|
1220
|
-
readonly default: 0;
|
|
1221
|
-
};
|
|
1222
|
-
readonly cacheCreationTokens: {
|
|
1223
|
-
readonly type: "integer";
|
|
1224
|
-
readonly default: 0;
|
|
1225
|
-
};
|
|
1226
|
-
readonly cost: {
|
|
1227
|
-
readonly type: "integer";
|
|
1228
|
-
readonly default: 0;
|
|
1229
|
-
};
|
|
1230
|
-
readonly cacheSavings: {
|
|
1231
|
-
readonly type: "integer";
|
|
1232
|
-
readonly default: 0;
|
|
1233
|
-
};
|
|
1234
|
-
readonly inputCost: {
|
|
1235
|
-
readonly type: "integer";
|
|
1236
|
-
readonly default: 0;
|
|
1237
|
-
};
|
|
1238
|
-
readonly outputCost: {
|
|
1239
|
-
readonly type: "integer";
|
|
1240
|
-
readonly default: 0;
|
|
1241
|
-
};
|
|
1242
|
-
readonly endpoint: {
|
|
1243
|
-
readonly type: "text";
|
|
1244
|
-
};
|
|
1245
|
-
readonly statusCode: {
|
|
1246
|
-
readonly type: "integer";
|
|
1247
|
-
};
|
|
1248
|
-
readonly latencyMs: {
|
|
1249
|
-
readonly type: "integer";
|
|
1250
|
-
readonly default: 0;
|
|
1251
|
-
};
|
|
1252
|
-
readonly isStreaming: {
|
|
1253
|
-
readonly type: "boolean";
|
|
1254
|
-
readonly default: false;
|
|
1255
|
-
};
|
|
1256
|
-
readonly userId: {
|
|
1257
|
-
readonly type: "text";
|
|
1258
|
-
readonly nullable: true;
|
|
1259
|
-
};
|
|
1260
|
-
readonly tags: {
|
|
1261
|
-
readonly type: "jsonb";
|
|
1262
|
-
readonly default: "{}";
|
|
1263
|
-
};
|
|
1264
|
-
readonly guardrailResults: {
|
|
1265
|
-
readonly type: "jsonb";
|
|
1266
|
-
readonly nullable: true;
|
|
1267
|
-
};
|
|
1268
|
-
readonly traceId: {
|
|
1269
|
-
readonly type: "text";
|
|
1270
|
-
readonly nullable: true;
|
|
1271
|
-
};
|
|
1272
|
-
readonly spanId: {
|
|
1273
|
-
readonly type: "text";
|
|
1274
|
-
readonly nullable: true;
|
|
1275
|
-
};
|
|
1276
|
-
readonly parentSpanId: {
|
|
1277
|
-
readonly type: "text";
|
|
1278
|
-
readonly nullable: true;
|
|
1279
|
-
};
|
|
1280
|
-
readonly sessionId: {
|
|
1281
|
-
readonly type: "text";
|
|
1282
|
-
readonly nullable: true;
|
|
1283
|
-
};
|
|
1284
|
-
readonly createdAt: {
|
|
1285
|
-
readonly type: "timestamp";
|
|
1286
|
-
readonly default: "now()";
|
|
1287
|
-
};
|
|
1288
|
-
readonly updatedAt: {
|
|
1289
|
-
readonly type: "timestamp";
|
|
1290
|
-
readonly default: "now()";
|
|
1291
|
-
readonly onUpdate: "now()";
|
|
1292
|
-
};
|
|
1293
|
-
};
|
|
1294
|
-
};
|
|
1295
|
-
readonly traces: {
|
|
1296
|
-
readonly order: 30;
|
|
1297
|
-
readonly schema: z.ZodObject<{
|
|
1298
|
-
traceId: z.ZodString;
|
|
1299
|
-
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1300
|
-
sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1301
|
-
userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1302
|
-
status: z.ZodDefault<z.ZodString>;
|
|
1303
|
-
startTime: z.ZodDate;
|
|
1304
|
-
endTime: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1305
|
-
durationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1306
|
-
spanCount: z.ZodDefault<z.ZodNumber>;
|
|
1307
|
-
totalInputTokens: z.ZodDefault<z.ZodNumber>;
|
|
1308
|
-
totalOutputTokens: z.ZodDefault<z.ZodNumber>;
|
|
1309
|
-
totalTokens: z.ZodDefault<z.ZodNumber>;
|
|
1310
|
-
totalCost: z.ZodDefault<z.ZodNumber>;
|
|
1311
|
-
tags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1312
|
-
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1313
|
-
id: z.ZodString;
|
|
1314
|
-
createdAt: z.ZodDate;
|
|
1315
|
-
updatedAt: z.ZodDate;
|
|
1316
|
-
}, z.core.$strip>;
|
|
1317
|
-
readonly fields: {
|
|
1318
|
-
readonly id: {
|
|
1319
|
-
readonly type: "uuid";
|
|
1320
|
-
readonly primaryKey: true;
|
|
1321
|
-
};
|
|
1322
|
-
readonly traceId: {
|
|
1323
|
-
readonly type: "text";
|
|
1324
|
-
readonly unique: true;
|
|
1325
|
-
};
|
|
1326
|
-
readonly name: {
|
|
1327
|
-
readonly type: "text";
|
|
1328
|
-
readonly nullable: true;
|
|
1329
|
-
};
|
|
1330
|
-
readonly sessionId: {
|
|
1331
|
-
readonly type: "text";
|
|
1332
|
-
readonly nullable: true;
|
|
1333
|
-
};
|
|
1334
|
-
readonly userId: {
|
|
1335
|
-
readonly type: "text";
|
|
1336
|
-
readonly nullable: true;
|
|
1337
|
-
};
|
|
1338
|
-
readonly status: {
|
|
1339
|
-
readonly type: "text";
|
|
1340
|
-
readonly default: "unset";
|
|
1341
|
-
};
|
|
1342
|
-
readonly startTime: {
|
|
1343
|
-
readonly type: "timestamp";
|
|
1344
|
-
};
|
|
1345
|
-
readonly endTime: {
|
|
1346
|
-
readonly type: "timestamp";
|
|
1347
|
-
readonly nullable: true;
|
|
1348
|
-
};
|
|
1349
|
-
readonly durationMs: {
|
|
1350
|
-
readonly type: "integer";
|
|
1351
|
-
readonly nullable: true;
|
|
1352
|
-
};
|
|
1353
|
-
readonly spanCount: {
|
|
1354
|
-
readonly type: "integer";
|
|
1355
|
-
readonly default: 0;
|
|
1356
|
-
};
|
|
1357
|
-
readonly totalInputTokens: {
|
|
1358
|
-
readonly type: "integer";
|
|
1359
|
-
readonly default: 0;
|
|
1360
|
-
};
|
|
1361
|
-
readonly totalOutputTokens: {
|
|
1362
|
-
readonly type: "integer";
|
|
1363
|
-
readonly default: 0;
|
|
1364
|
-
};
|
|
1365
|
-
readonly totalTokens: {
|
|
1366
|
-
readonly type: "integer";
|
|
1367
|
-
readonly default: 0;
|
|
1368
|
-
};
|
|
1369
|
-
readonly totalCost: {
|
|
1370
|
-
readonly type: "integer";
|
|
1371
|
-
readonly default: 0;
|
|
1372
|
-
};
|
|
1373
|
-
readonly tags: {
|
|
1374
|
-
readonly type: "jsonb";
|
|
1375
|
-
readonly default: "{}";
|
|
1376
|
-
};
|
|
1377
|
-
readonly metadata: {
|
|
1378
|
-
readonly type: "jsonb";
|
|
1379
|
-
readonly default: "{}";
|
|
1380
|
-
};
|
|
1381
|
-
readonly createdAt: {
|
|
1382
|
-
readonly type: "timestamp";
|
|
1383
|
-
readonly default: "now()";
|
|
1384
|
-
};
|
|
1385
|
-
readonly updatedAt: {
|
|
1386
|
-
readonly type: "timestamp";
|
|
1387
|
-
readonly default: "now()";
|
|
1388
|
-
readonly onUpdate: "now()";
|
|
1389
|
-
};
|
|
1390
|
-
};
|
|
1391
|
-
};
|
|
1392
|
-
readonly spans: {
|
|
1393
|
-
readonly order: 31;
|
|
1394
|
-
readonly schema: z.ZodObject<{
|
|
1395
|
-
traceId: z.ZodString;
|
|
1396
|
-
spanId: z.ZodString;
|
|
1397
|
-
parentSpanId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1398
|
-
name: z.ZodString;
|
|
1399
|
-
kind: z.ZodDefault<z.ZodNumber>;
|
|
1400
|
-
status: z.ZodDefault<z.ZodNumber>;
|
|
1401
|
-
statusMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1402
|
-
startTime: z.ZodDate;
|
|
1403
|
-
endTime: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1404
|
-
durationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1405
|
-
provider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1406
|
-
model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1407
|
-
promptTokens: z.ZodDefault<z.ZodNumber>;
|
|
1408
|
-
completionTokens: z.ZodDefault<z.ZodNumber>;
|
|
1409
|
-
totalTokens: z.ZodDefault<z.ZodNumber>;
|
|
1410
|
-
cost: z.ZodDefault<z.ZodNumber>;
|
|
1411
|
-
configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1412
|
-
variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1413
|
-
environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1414
|
-
providerConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1415
|
-
requestId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1416
|
-
source: z.ZodDefault<z.ZodString>;
|
|
1417
|
-
input: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
1418
|
-
output: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
1419
|
-
attributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1420
|
-
id: z.ZodString;
|
|
1421
|
-
createdAt: z.ZodDate;
|
|
1422
|
-
updatedAt: z.ZodDate;
|
|
1423
|
-
}, z.core.$strip>;
|
|
1424
|
-
readonly fields: {
|
|
1425
|
-
readonly id: {
|
|
1426
|
-
readonly type: "uuid";
|
|
1427
|
-
readonly primaryKey: true;
|
|
1428
|
-
};
|
|
1429
|
-
readonly traceId: {
|
|
1430
|
-
readonly type: "text";
|
|
1431
|
-
};
|
|
1432
|
-
readonly spanId: {
|
|
1433
|
-
readonly type: "text";
|
|
1434
|
-
readonly unique: true;
|
|
1435
|
-
};
|
|
1436
|
-
readonly parentSpanId: {
|
|
1437
|
-
readonly type: "text";
|
|
1438
|
-
readonly nullable: true;
|
|
1439
|
-
};
|
|
1440
|
-
readonly name: {
|
|
1441
|
-
readonly type: "text";
|
|
1442
|
-
};
|
|
1443
|
-
readonly kind: {
|
|
1444
|
-
readonly type: "integer";
|
|
1445
|
-
readonly default: 1;
|
|
1446
|
-
};
|
|
1447
|
-
readonly status: {
|
|
1448
|
-
readonly type: "integer";
|
|
1449
|
-
readonly default: 0;
|
|
1450
|
-
};
|
|
1451
|
-
readonly statusMessage: {
|
|
1452
|
-
readonly type: "text";
|
|
1453
|
-
readonly nullable: true;
|
|
1454
|
-
};
|
|
1455
|
-
readonly startTime: {
|
|
1456
|
-
readonly type: "timestamp";
|
|
1457
|
-
};
|
|
1458
|
-
readonly endTime: {
|
|
1459
|
-
readonly type: "timestamp";
|
|
1460
|
-
readonly nullable: true;
|
|
1461
|
-
};
|
|
1462
|
-
readonly durationMs: {
|
|
1463
|
-
readonly type: "integer";
|
|
1464
|
-
readonly nullable: true;
|
|
1465
|
-
};
|
|
1466
|
-
readonly provider: {
|
|
1467
|
-
readonly type: "text";
|
|
1468
|
-
readonly nullable: true;
|
|
1469
|
-
};
|
|
1470
|
-
readonly model: {
|
|
1471
|
-
readonly type: "text";
|
|
1472
|
-
readonly nullable: true;
|
|
1473
|
-
};
|
|
1474
|
-
readonly promptTokens: {
|
|
1475
|
-
readonly type: "integer";
|
|
1476
|
-
readonly default: 0;
|
|
1477
|
-
};
|
|
1478
|
-
readonly completionTokens: {
|
|
1479
|
-
readonly type: "integer";
|
|
1480
|
-
readonly default: 0;
|
|
1481
|
-
};
|
|
1482
|
-
readonly totalTokens: {
|
|
1483
|
-
readonly type: "integer";
|
|
1484
|
-
readonly default: 0;
|
|
1485
|
-
};
|
|
1486
|
-
readonly cost: {
|
|
1487
|
-
readonly type: "integer";
|
|
1488
|
-
readonly default: 0;
|
|
1489
|
-
};
|
|
1490
|
-
readonly configId: {
|
|
1491
|
-
readonly type: "uuid";
|
|
1492
|
-
readonly nullable: true;
|
|
1493
|
-
};
|
|
1494
|
-
readonly variantId: {
|
|
1495
|
-
readonly type: "uuid";
|
|
1496
|
-
readonly nullable: true;
|
|
1497
|
-
};
|
|
1498
|
-
readonly environmentId: {
|
|
1499
|
-
readonly type: "uuid";
|
|
1500
|
-
readonly nullable: true;
|
|
1501
|
-
};
|
|
1502
|
-
readonly providerConfigId: {
|
|
1503
|
-
readonly type: "uuid";
|
|
1504
|
-
readonly nullable: true;
|
|
1505
|
-
};
|
|
1506
|
-
readonly requestId: {
|
|
1507
|
-
readonly type: "uuid";
|
|
1508
|
-
readonly nullable: true;
|
|
1509
|
-
};
|
|
1510
|
-
readonly source: {
|
|
1511
|
-
readonly type: "text";
|
|
1512
|
-
readonly default: "gateway";
|
|
1513
|
-
};
|
|
1514
|
-
readonly input: {
|
|
1515
|
-
readonly type: "jsonb";
|
|
1516
|
-
readonly nullable: true;
|
|
1517
|
-
};
|
|
1518
|
-
readonly output: {
|
|
1519
|
-
readonly type: "jsonb";
|
|
1520
|
-
readonly nullable: true;
|
|
1521
|
-
};
|
|
1522
|
-
readonly attributes: {
|
|
1523
|
-
readonly type: "jsonb";
|
|
1524
|
-
readonly default: "{}";
|
|
1525
|
-
};
|
|
1526
|
-
readonly createdAt: {
|
|
1527
|
-
readonly type: "timestamp";
|
|
1528
|
-
readonly default: "now()";
|
|
1529
|
-
};
|
|
1530
|
-
readonly updatedAt: {
|
|
1531
|
-
readonly type: "timestamp";
|
|
1532
|
-
readonly default: "now()";
|
|
1533
|
-
readonly onUpdate: "now()";
|
|
1534
|
-
};
|
|
1535
|
-
};
|
|
1536
|
-
};
|
|
1537
|
-
readonly span_events: {
|
|
1538
|
-
readonly order: 32;
|
|
1539
|
-
readonly schema: z.ZodObject<{
|
|
1540
|
-
id: z.ZodString;
|
|
1541
|
-
traceId: z.ZodString;
|
|
1542
|
-
spanId: z.ZodString;
|
|
1543
|
-
name: z.ZodString;
|
|
1544
|
-
timestamp: z.ZodDate;
|
|
1545
|
-
attributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1546
|
-
createdAt: z.ZodDate;
|
|
1547
|
-
}, z.core.$strip>;
|
|
1548
|
-
readonly fields: {
|
|
1549
|
-
readonly id: {
|
|
1550
|
-
readonly type: "uuid";
|
|
1551
|
-
readonly primaryKey: true;
|
|
1552
|
-
};
|
|
1553
|
-
readonly traceId: {
|
|
1554
|
-
readonly type: "text";
|
|
1555
|
-
};
|
|
1556
|
-
readonly spanId: {
|
|
1557
|
-
readonly type: "text";
|
|
1558
|
-
};
|
|
1559
|
-
readonly name: {
|
|
1560
|
-
readonly type: "text";
|
|
1561
|
-
};
|
|
1562
|
-
readonly timestamp: {
|
|
1563
|
-
readonly type: "timestamp";
|
|
1564
|
-
};
|
|
1565
|
-
readonly attributes: {
|
|
1566
|
-
readonly type: "jsonb";
|
|
1567
|
-
readonly default: "{}";
|
|
1568
|
-
};
|
|
1569
|
-
readonly createdAt: {
|
|
1570
|
-
readonly type: "timestamp";
|
|
1571
|
-
readonly default: "now()";
|
|
1572
|
-
};
|
|
1573
|
-
};
|
|
1574
|
-
};
|
|
1575
|
-
};
|
|
1576
|
-
};
|
|
1577
|
-
/**
|
|
1578
|
-
* Export all Zod schemas for runtime validation
|
|
1579
|
-
*/
|
|
1580
|
-
declare const schemas: {
|
|
1581
|
-
readonly workspace_settings: z.ZodObject<{
|
|
1582
|
-
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1583
|
-
setupComplete: z.ZodDefault<z.ZodBoolean>;
|
|
1584
|
-
superAdminId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1585
|
-
id: z.ZodString;
|
|
1586
|
-
createdAt: z.ZodDate;
|
|
1587
|
-
updatedAt: z.ZodDate;
|
|
1588
|
-
}, z.core.$strip>;
|
|
1589
|
-
readonly playgrounds: z.ZodObject<{
|
|
1590
|
-
name: z.ZodString;
|
|
1591
|
-
datasetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1592
|
-
columns: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1593
|
-
id: z.ZodString;
|
|
1594
|
-
name: z.ZodString;
|
|
1595
|
-
position: z.ZodNumber;
|
|
1596
|
-
providerConfigId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
1597
|
-
providerSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1598
|
-
modelName: z.ZodString;
|
|
1599
|
-
messages: z.ZodArray<z.ZodObject<{
|
|
1600
|
-
role: z.ZodEnum<{
|
|
1601
|
-
system: "system";
|
|
1602
|
-
user: "user";
|
|
1603
|
-
assistant: "assistant";
|
|
1604
|
-
}>;
|
|
1605
|
-
content: z.ZodString;
|
|
1606
|
-
}, z.core.$strip>>;
|
|
1607
|
-
temperature: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1608
|
-
maxTokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1609
|
-
topP: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1610
|
-
frequencyPenalty: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1611
|
-
presencePenalty: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1612
|
-
}, z.core.$strip>>>;
|
|
1613
|
-
id: z.ZodString;
|
|
1614
|
-
createdAt: z.ZodDate;
|
|
1615
|
-
updatedAt: z.ZodDate;
|
|
1616
|
-
}, z.core.$strip>;
|
|
1617
|
-
readonly playground_columns: z.ZodObject<{
|
|
1618
|
-
id: z.ZodString;
|
|
1619
|
-
name: z.ZodString;
|
|
1620
|
-
position: z.ZodNumber;
|
|
1621
|
-
providerConfigId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
1622
|
-
providerSlug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1623
|
-
modelName: z.ZodString;
|
|
1624
|
-
messages: z.ZodArray<z.ZodObject<{
|
|
1625
|
-
role: z.ZodEnum<{
|
|
1626
|
-
system: "system";
|
|
1627
|
-
user: "user";
|
|
1628
|
-
assistant: "assistant";
|
|
1629
|
-
}>;
|
|
1630
|
-
content: z.ZodString;
|
|
1631
|
-
}, z.core.$strip>>;
|
|
1632
|
-
temperature: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1633
|
-
maxTokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1634
|
-
topP: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1635
|
-
frequencyPenalty: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1636
|
-
presencePenalty: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1637
|
-
}, z.core.$strip>;
|
|
1638
|
-
readonly playground_runs: z.ZodObject<{
|
|
1639
|
-
playgroundId: z.ZodString;
|
|
1640
|
-
datasetId: z.ZodNullable<z.ZodString>;
|
|
1641
|
-
datasetVersionId: z.ZodNullable<z.ZodString>;
|
|
1642
|
-
status: z.ZodEnum<{
|
|
1643
|
-
pending: "pending";
|
|
1644
|
-
running: "running";
|
|
1645
|
-
completed: "completed";
|
|
1646
|
-
failed: "failed";
|
|
1647
|
-
cancelled: "cancelled";
|
|
1648
|
-
}>;
|
|
1649
|
-
startedAt: z.ZodNullable<z.ZodDate>;
|
|
1650
|
-
completedAt: z.ZodNullable<z.ZodDate>;
|
|
1651
|
-
totalRecords: z.ZodDefault<z.ZodNumber>;
|
|
1652
|
-
completedRecords: z.ZodDefault<z.ZodNumber>;
|
|
1653
|
-
id: z.ZodString;
|
|
1654
|
-
createdAt: z.ZodDate;
|
|
1655
|
-
updatedAt: z.ZodDate;
|
|
1656
|
-
}, z.core.$strip>;
|
|
1657
|
-
readonly playground_results: z.ZodObject<{
|
|
1658
|
-
runId: z.ZodString;
|
|
1659
|
-
columnId: z.ZodString;
|
|
1660
|
-
datasetRecordId: z.ZodNullable<z.ZodString>;
|
|
1661
|
-
inputVariables: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1662
|
-
outputContent: z.ZodNullable<z.ZodString>;
|
|
1663
|
-
status: z.ZodEnum<{
|
|
1664
|
-
pending: "pending";
|
|
1665
|
-
running: "running";
|
|
1666
|
-
completed: "completed";
|
|
1667
|
-
failed: "failed";
|
|
1668
|
-
}>;
|
|
1669
|
-
error: z.ZodNullable<z.ZodString>;
|
|
1670
|
-
latencyMs: z.ZodNullable<z.ZodNumber>;
|
|
1671
|
-
promptTokens: z.ZodNullable<z.ZodNumber>;
|
|
1672
|
-
completionTokens: z.ZodNullable<z.ZodNumber>;
|
|
1673
|
-
totalTokens: z.ZodNullable<z.ZodNumber>;
|
|
1674
|
-
cost: z.ZodNullable<z.ZodNumber>;
|
|
1675
|
-
id: z.ZodString;
|
|
1676
|
-
createdAt: z.ZodDate;
|
|
1677
|
-
updatedAt: z.ZodDate;
|
|
1678
|
-
}, z.core.$strip>;
|
|
1679
|
-
readonly datasets: z.ZodObject<{
|
|
1680
|
-
name: z.ZodString;
|
|
1681
|
-
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1682
|
-
recordCount: z.ZodDefault<z.ZodNumber>;
|
|
1683
|
-
latestVersionNumber: z.ZodDefault<z.ZodNumber>;
|
|
1684
|
-
id: z.ZodString;
|
|
1685
|
-
createdAt: z.ZodDate;
|
|
1686
|
-
updatedAt: z.ZodDate;
|
|
1687
|
-
}, z.core.$strip>;
|
|
1688
|
-
readonly dataset_versions: z.ZodObject<{
|
|
1689
|
-
datasetId: z.ZodString;
|
|
1690
|
-
versionNumber: z.ZodNumber;
|
|
1691
|
-
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1692
|
-
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1693
|
-
recordCount: z.ZodDefault<z.ZodNumber>;
|
|
1694
|
-
snapshotHash: z.ZodString;
|
|
1695
|
-
id: z.ZodString;
|
|
1696
|
-
createdAt: z.ZodDate;
|
|
1697
|
-
updatedAt: z.ZodDate;
|
|
1698
|
-
}, z.core.$strip>;
|
|
1699
|
-
readonly dataset_records: z.ZodObject<{
|
|
1700
|
-
datasetId: z.ZodString;
|
|
1701
|
-
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1702
|
-
expected: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
1703
|
-
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1704
|
-
id: z.ZodString;
|
|
1705
|
-
createdAt: z.ZodDate;
|
|
1706
|
-
updatedAt: z.ZodDate;
|
|
1707
|
-
}, z.core.$strip>;
|
|
1708
|
-
readonly dataset_version_records: z.ZodObject<{
|
|
1709
|
-
datasetVersionId: z.ZodString;
|
|
1710
|
-
datasetRecordId: z.ZodString;
|
|
1711
|
-
position: z.ZodDefault<z.ZodNumber>;
|
|
1712
|
-
id: z.ZodString;
|
|
1713
|
-
createdAt: z.ZodDate;
|
|
1714
|
-
updatedAt: z.ZodDate;
|
|
1715
|
-
}, z.core.$strip>;
|
|
1716
|
-
readonly llm_requests: z.ZodObject<{
|
|
1717
|
-
requestId: z.ZodString;
|
|
1718
|
-
configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1719
|
-
variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1720
|
-
environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1721
|
-
providerConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1722
|
-
provider: z.ZodString;
|
|
1723
|
-
model: z.ZodString;
|
|
1724
|
-
promptTokens: z.ZodDefault<z.ZodNumber>;
|
|
1725
|
-
completionTokens: z.ZodDefault<z.ZodNumber>;
|
|
1726
|
-
totalTokens: z.ZodDefault<z.ZodNumber>;
|
|
1727
|
-
cachedTokens: z.ZodDefault<z.ZodNumber>;
|
|
1728
|
-
cacheCreationTokens: z.ZodDefault<z.ZodNumber>;
|
|
1729
|
-
cost: z.ZodDefault<z.ZodNumber>;
|
|
1730
|
-
cacheSavings: z.ZodDefault<z.ZodNumber>;
|
|
1731
|
-
inputCost: z.ZodDefault<z.ZodNumber>;
|
|
1732
|
-
outputCost: z.ZodDefault<z.ZodNumber>;
|
|
1733
|
-
endpoint: z.ZodString;
|
|
1734
|
-
statusCode: z.ZodNumber;
|
|
1735
|
-
latencyMs: z.ZodDefault<z.ZodNumber>;
|
|
1736
|
-
isStreaming: z.ZodDefault<z.ZodBoolean>;
|
|
1737
|
-
userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1738
|
-
tags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1739
|
-
guardrailResults: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1740
|
-
results: z.ZodArray<z.ZodObject<{
|
|
1741
|
-
checkId: z.ZodString;
|
|
1742
|
-
functionId: z.ZodString;
|
|
1743
|
-
hookType: z.ZodEnum<{
|
|
1744
|
-
beforeRequestHook: "beforeRequestHook";
|
|
1745
|
-
afterRequestHook: "afterRequestHook";
|
|
1746
|
-
}>;
|
|
1747
|
-
verdict: z.ZodBoolean;
|
|
1748
|
-
latencyMs: z.ZodNumber;
|
|
1749
|
-
}, z.core.$strip>>;
|
|
1750
|
-
action: z.ZodEnum<{
|
|
1751
|
-
allowed: "allowed";
|
|
1752
|
-
blocked: "blocked";
|
|
1753
|
-
logged: "logged";
|
|
1754
|
-
}>;
|
|
1755
|
-
totalLatencyMs: z.ZodNumber;
|
|
1756
|
-
}, z.core.$strip>>>;
|
|
1757
|
-
traceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1758
|
-
spanId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1759
|
-
parentSpanId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1760
|
-
sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1761
|
-
id: z.ZodString;
|
|
1762
|
-
createdAt: z.ZodDate;
|
|
1763
|
-
updatedAt: z.ZodDate;
|
|
1764
|
-
}, z.core.$strip>;
|
|
1765
|
-
readonly traces: z.ZodObject<{
|
|
1766
|
-
traceId: z.ZodString;
|
|
1767
|
-
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1768
|
-
sessionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1769
|
-
userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1770
|
-
status: z.ZodDefault<z.ZodString>;
|
|
1771
|
-
startTime: z.ZodDate;
|
|
1772
|
-
endTime: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1773
|
-
durationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1774
|
-
spanCount: z.ZodDefault<z.ZodNumber>;
|
|
1775
|
-
totalInputTokens: z.ZodDefault<z.ZodNumber>;
|
|
1776
|
-
totalOutputTokens: z.ZodDefault<z.ZodNumber>;
|
|
1777
|
-
totalTokens: z.ZodDefault<z.ZodNumber>;
|
|
1778
|
-
totalCost: z.ZodDefault<z.ZodNumber>;
|
|
1779
|
-
tags: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1780
|
-
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1781
|
-
id: z.ZodString;
|
|
1782
|
-
createdAt: z.ZodDate;
|
|
1783
|
-
updatedAt: z.ZodDate;
|
|
1784
|
-
}, z.core.$strip>;
|
|
1785
|
-
readonly spans: z.ZodObject<{
|
|
1786
|
-
traceId: z.ZodString;
|
|
1787
|
-
spanId: z.ZodString;
|
|
1788
|
-
parentSpanId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1789
|
-
name: z.ZodString;
|
|
1790
|
-
kind: z.ZodDefault<z.ZodNumber>;
|
|
1791
|
-
status: z.ZodDefault<z.ZodNumber>;
|
|
1792
|
-
statusMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1793
|
-
startTime: z.ZodDate;
|
|
1794
|
-
endTime: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1795
|
-
durationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1796
|
-
provider: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1797
|
-
model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1798
|
-
promptTokens: z.ZodDefault<z.ZodNumber>;
|
|
1799
|
-
completionTokens: z.ZodDefault<z.ZodNumber>;
|
|
1800
|
-
totalTokens: z.ZodDefault<z.ZodNumber>;
|
|
1801
|
-
cost: z.ZodDefault<z.ZodNumber>;
|
|
1802
|
-
configId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1803
|
-
variantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1804
|
-
environmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1805
|
-
providerConfigId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1806
|
-
requestId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1807
|
-
source: z.ZodDefault<z.ZodString>;
|
|
1808
|
-
input: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
1809
|
-
output: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
1810
|
-
attributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1811
|
-
id: z.ZodString;
|
|
1812
|
-
createdAt: z.ZodDate;
|
|
1813
|
-
updatedAt: z.ZodDate;
|
|
1814
|
-
}, z.core.$strip>;
|
|
1815
|
-
readonly span_events: z.ZodObject<{
|
|
1816
|
-
id: z.ZodString;
|
|
1817
|
-
traceId: z.ZodString;
|
|
1818
|
-
spanId: z.ZodString;
|
|
1819
|
-
name: z.ZodString;
|
|
1820
|
-
timestamp: z.ZodDate;
|
|
1821
|
-
attributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1822
|
-
createdAt: z.ZodDate;
|
|
1823
|
-
}, z.core.$strip>;
|
|
1824
|
-
};
|
|
1825
|
-
//#endregion
|
|
1826
|
-
//#region src/db/validation.d.ts
|
|
1827
|
-
/**
|
|
1828
|
-
* Validate data against table schema
|
|
1829
|
-
* Useful for runtime validation before inserting/updating
|
|
1830
|
-
*/
|
|
1831
|
-
declare function validateTableData<T extends TableName>(table: T, data: unknown): zod0.ZodSafeParseResult<{
|
|
1832
|
-
setupComplete: boolean;
|
|
1833
|
-
id: string;
|
|
1834
|
-
createdAt: Date;
|
|
1835
|
-
updatedAt: Date;
|
|
1836
|
-
name?: string | null | undefined;
|
|
1837
|
-
superAdminId?: string | null | undefined;
|
|
1838
|
-
}> | zod0.ZodSafeParseResult<{
|
|
1839
|
-
name: string;
|
|
1840
|
-
columns: {
|
|
1841
|
-
id: string;
|
|
1842
|
-
name: string;
|
|
1843
|
-
position: number;
|
|
1844
|
-
modelName: string;
|
|
1845
|
-
messages: {
|
|
1846
|
-
role: "system" | "user" | "assistant";
|
|
1847
|
-
content: string;
|
|
1848
|
-
}[];
|
|
1849
|
-
providerConfigId?: string | null | undefined;
|
|
1850
|
-
providerSlug?: string | null | undefined;
|
|
1851
|
-
temperature?: number | null | undefined;
|
|
1852
|
-
maxTokens?: number | null | undefined;
|
|
1853
|
-
topP?: number | null | undefined;
|
|
1854
|
-
frequencyPenalty?: number | null | undefined;
|
|
1855
|
-
presencePenalty?: number | null | undefined;
|
|
1856
|
-
}[] | null;
|
|
1857
|
-
id: string;
|
|
1858
|
-
createdAt: Date;
|
|
1859
|
-
updatedAt: Date;
|
|
1860
|
-
datasetId?: string | null | undefined;
|
|
1861
|
-
}> | zod0.ZodSafeParseResult<{
|
|
1862
|
-
playgroundId: string;
|
|
1863
|
-
datasetId: string | null;
|
|
1864
|
-
datasetVersionId: string | null;
|
|
1865
|
-
status: "pending" | "running" | "completed" | "failed" | "cancelled";
|
|
1866
|
-
startedAt: Date | null;
|
|
1867
|
-
completedAt: Date | null;
|
|
1868
|
-
totalRecords: number;
|
|
1869
|
-
completedRecords: number;
|
|
1870
|
-
id: string;
|
|
1871
|
-
createdAt: Date;
|
|
1872
|
-
updatedAt: Date;
|
|
1873
|
-
}> | zod0.ZodSafeParseResult<{
|
|
1874
|
-
runId: string;
|
|
1875
|
-
columnId: string;
|
|
1876
|
-
datasetRecordId: string | null;
|
|
1877
|
-
inputVariables: Record<string, unknown>;
|
|
1878
|
-
outputContent: string | null;
|
|
1879
|
-
status: "pending" | "running" | "completed" | "failed";
|
|
1880
|
-
error: string | null;
|
|
1881
|
-
latencyMs: number | null;
|
|
1882
|
-
promptTokens: number | null;
|
|
1883
|
-
completionTokens: number | null;
|
|
1884
|
-
totalTokens: number | null;
|
|
1885
|
-
cost: number | null;
|
|
1886
|
-
id: string;
|
|
1887
|
-
createdAt: Date;
|
|
1888
|
-
updatedAt: Date;
|
|
1889
|
-
}> | zod0.ZodSafeParseResult<{
|
|
1890
|
-
name: string;
|
|
1891
|
-
recordCount: number;
|
|
1892
|
-
latestVersionNumber: number;
|
|
1893
|
-
id: string;
|
|
1894
|
-
createdAt: Date;
|
|
1895
|
-
updatedAt: Date;
|
|
1896
|
-
description?: string | null | undefined;
|
|
1897
|
-
}> | zod0.ZodSafeParseResult<{
|
|
1898
|
-
datasetId: string;
|
|
1899
|
-
versionNumber: number;
|
|
1900
|
-
recordCount: number;
|
|
1901
|
-
snapshotHash: string;
|
|
1902
|
-
id: string;
|
|
1903
|
-
createdAt: Date;
|
|
1904
|
-
updatedAt: Date;
|
|
1905
|
-
name?: string | null | undefined;
|
|
1906
|
-
description?: string | null | undefined;
|
|
1907
|
-
}> | zod0.ZodSafeParseResult<{
|
|
1908
|
-
datasetId: string;
|
|
1909
|
-
input: Record<string, unknown>;
|
|
1910
|
-
metadata: Record<string, unknown>;
|
|
1911
|
-
id: string;
|
|
1912
|
-
createdAt: Date;
|
|
1913
|
-
updatedAt: Date;
|
|
1914
|
-
expected?: Record<string, unknown> | null | undefined;
|
|
1915
|
-
}> | zod0.ZodSafeParseResult<{
|
|
1916
|
-
datasetVersionId: string;
|
|
1917
|
-
datasetRecordId: string;
|
|
1918
|
-
position: number;
|
|
1919
|
-
id: string;
|
|
1920
|
-
createdAt: Date;
|
|
1921
|
-
updatedAt: Date;
|
|
1922
|
-
}> | zod0.ZodSafeParseResult<{
|
|
1923
|
-
requestId: string;
|
|
1924
|
-
provider: string;
|
|
1925
|
-
model: string;
|
|
1926
|
-
promptTokens: number;
|
|
1927
|
-
completionTokens: number;
|
|
1928
|
-
totalTokens: number;
|
|
1929
|
-
cachedTokens: number;
|
|
1930
|
-
cacheCreationTokens: number;
|
|
1931
|
-
cost: number;
|
|
1932
|
-
cacheSavings: number;
|
|
1933
|
-
inputCost: number;
|
|
1934
|
-
outputCost: number;
|
|
1935
|
-
endpoint: string;
|
|
1936
|
-
statusCode: number;
|
|
1937
|
-
latencyMs: number;
|
|
1938
|
-
isStreaming: boolean;
|
|
1939
|
-
tags: Record<string, string>;
|
|
1940
|
-
id: string;
|
|
1941
|
-
createdAt: Date;
|
|
1942
|
-
updatedAt: Date;
|
|
1943
|
-
configId?: string | null | undefined;
|
|
1944
|
-
variantId?: string | null | undefined;
|
|
1945
|
-
environmentId?: string | null | undefined;
|
|
1946
|
-
providerConfigId?: string | null | undefined;
|
|
1947
|
-
userId?: string | null | undefined;
|
|
1948
|
-
guardrailResults?: {
|
|
1949
|
-
results: {
|
|
1950
|
-
checkId: string;
|
|
1951
|
-
functionId: string;
|
|
1952
|
-
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
1953
|
-
verdict: boolean;
|
|
1954
|
-
latencyMs: number;
|
|
1955
|
-
}[];
|
|
1956
|
-
action: "allowed" | "blocked" | "logged";
|
|
1957
|
-
totalLatencyMs: number;
|
|
1958
|
-
} | null | undefined;
|
|
1959
|
-
traceId?: string | null | undefined;
|
|
1960
|
-
spanId?: string | null | undefined;
|
|
1961
|
-
parentSpanId?: string | null | undefined;
|
|
1962
|
-
sessionId?: string | null | undefined;
|
|
1963
|
-
}> | zod0.ZodSafeParseResult<{
|
|
1964
|
-
traceId: string;
|
|
1965
|
-
status: string;
|
|
1966
|
-
startTime: Date;
|
|
1967
|
-
spanCount: number;
|
|
1968
|
-
totalInputTokens: number;
|
|
1969
|
-
totalOutputTokens: number;
|
|
1970
|
-
totalTokens: number;
|
|
1971
|
-
totalCost: number;
|
|
1972
|
-
tags: Record<string, string>;
|
|
1973
|
-
metadata: Record<string, unknown>;
|
|
1974
|
-
id: string;
|
|
1975
|
-
createdAt: Date;
|
|
1976
|
-
updatedAt: Date;
|
|
1977
|
-
name?: string | null | undefined;
|
|
1978
|
-
sessionId?: string | null | undefined;
|
|
1979
|
-
userId?: string | null | undefined;
|
|
1980
|
-
endTime?: Date | null | undefined;
|
|
1981
|
-
durationMs?: number | null | undefined;
|
|
1982
|
-
}> | zod0.ZodSafeParseResult<{
|
|
1983
|
-
traceId: string;
|
|
1984
|
-
spanId: string;
|
|
1985
|
-
name: string;
|
|
1986
|
-
kind: number;
|
|
1987
|
-
status: number;
|
|
1988
|
-
startTime: Date;
|
|
1989
|
-
promptTokens: number;
|
|
1990
|
-
completionTokens: number;
|
|
1991
|
-
totalTokens: number;
|
|
1992
|
-
cost: number;
|
|
1993
|
-
source: string;
|
|
1994
|
-
attributes: Record<string, unknown>;
|
|
1995
|
-
id: string;
|
|
1996
|
-
createdAt: Date;
|
|
1997
|
-
updatedAt: Date;
|
|
1998
|
-
parentSpanId?: string | null | undefined;
|
|
1999
|
-
statusMessage?: string | null | undefined;
|
|
2000
|
-
endTime?: Date | null | undefined;
|
|
2001
|
-
durationMs?: number | null | undefined;
|
|
2002
|
-
provider?: string | null | undefined;
|
|
2003
|
-
model?: string | null | undefined;
|
|
2004
|
-
configId?: string | null | undefined;
|
|
2005
|
-
variantId?: string | null | undefined;
|
|
2006
|
-
environmentId?: string | null | undefined;
|
|
2007
|
-
providerConfigId?: string | null | undefined;
|
|
2008
|
-
requestId?: string | null | undefined;
|
|
2009
|
-
input?: unknown;
|
|
2010
|
-
output?: unknown;
|
|
2011
|
-
}> | zod0.ZodSafeParseResult<{
|
|
2012
|
-
id: string;
|
|
2013
|
-
traceId: string;
|
|
2014
|
-
spanId: string;
|
|
2015
|
-
name: string;
|
|
2016
|
-
timestamp: Date;
|
|
2017
|
-
attributes: Record<string, unknown>;
|
|
2018
|
-
createdAt: Date;
|
|
2019
|
-
}>;
|
|
2020
|
-
/**
|
|
2021
|
-
* Validate partial data (for updates)
|
|
2022
|
-
*/
|
|
2023
|
-
declare function validatePartialTableData<T extends TableName>(table: T, data: unknown): zod0.ZodSafeParseResult<{
|
|
2024
|
-
name?: string | null | undefined;
|
|
2025
|
-
setupComplete?: boolean | undefined;
|
|
2026
|
-
superAdminId?: string | null | undefined;
|
|
2027
|
-
id?: string | undefined;
|
|
2028
|
-
createdAt?: Date | undefined;
|
|
2029
|
-
updatedAt?: Date | undefined;
|
|
2030
|
-
}> | zod0.ZodSafeParseResult<{
|
|
2031
|
-
name?: string | undefined;
|
|
2032
|
-
datasetId?: string | null | undefined;
|
|
2033
|
-
columns?: {
|
|
2034
|
-
id: string;
|
|
2035
|
-
name: string;
|
|
2036
|
-
position: number;
|
|
2037
|
-
modelName: string;
|
|
2038
|
-
messages: {
|
|
2039
|
-
role: "system" | "user" | "assistant";
|
|
2040
|
-
content: string;
|
|
2041
|
-
}[];
|
|
2042
|
-
providerConfigId?: string | null | undefined;
|
|
2043
|
-
providerSlug?: string | null | undefined;
|
|
2044
|
-
temperature?: number | null | undefined;
|
|
2045
|
-
maxTokens?: number | null | undefined;
|
|
2046
|
-
topP?: number | null | undefined;
|
|
2047
|
-
frequencyPenalty?: number | null | undefined;
|
|
2048
|
-
presencePenalty?: number | null | undefined;
|
|
2049
|
-
}[] | null | undefined;
|
|
2050
|
-
id?: string | undefined;
|
|
2051
|
-
createdAt?: Date | undefined;
|
|
2052
|
-
updatedAt?: Date | undefined;
|
|
2053
|
-
}> | zod0.ZodSafeParseResult<{
|
|
2054
|
-
playgroundId?: string | undefined;
|
|
2055
|
-
datasetId?: string | null | undefined;
|
|
2056
|
-
datasetVersionId?: string | null | undefined;
|
|
2057
|
-
status?: "pending" | "running" | "completed" | "failed" | "cancelled" | undefined;
|
|
2058
|
-
startedAt?: Date | null | undefined;
|
|
2059
|
-
completedAt?: Date | null | undefined;
|
|
2060
|
-
totalRecords?: number | undefined;
|
|
2061
|
-
completedRecords?: number | undefined;
|
|
2062
|
-
id?: string | undefined;
|
|
2063
|
-
createdAt?: Date | undefined;
|
|
2064
|
-
updatedAt?: Date | undefined;
|
|
2065
|
-
}> | zod0.ZodSafeParseResult<{
|
|
2066
|
-
runId?: string | undefined;
|
|
2067
|
-
columnId?: string | undefined;
|
|
2068
|
-
datasetRecordId?: string | null | undefined;
|
|
2069
|
-
inputVariables?: Record<string, unknown> | undefined;
|
|
2070
|
-
outputContent?: string | null | undefined;
|
|
2071
|
-
status?: "pending" | "running" | "completed" | "failed" | undefined;
|
|
2072
|
-
error?: string | null | undefined;
|
|
2073
|
-
latencyMs?: number | null | undefined;
|
|
2074
|
-
promptTokens?: number | null | undefined;
|
|
2075
|
-
completionTokens?: number | null | undefined;
|
|
2076
|
-
totalTokens?: number | null | undefined;
|
|
2077
|
-
cost?: number | null | undefined;
|
|
2078
|
-
id?: string | undefined;
|
|
2079
|
-
createdAt?: Date | undefined;
|
|
2080
|
-
updatedAt?: Date | undefined;
|
|
2081
|
-
}> | zod0.ZodSafeParseResult<{
|
|
2082
|
-
name?: string | undefined;
|
|
2083
|
-
description?: string | null | undefined;
|
|
2084
|
-
recordCount?: number | undefined;
|
|
2085
|
-
latestVersionNumber?: number | undefined;
|
|
2086
|
-
id?: string | undefined;
|
|
2087
|
-
createdAt?: Date | undefined;
|
|
2088
|
-
updatedAt?: Date | undefined;
|
|
2089
|
-
}> | zod0.ZodSafeParseResult<{
|
|
2090
|
-
datasetId?: string | undefined;
|
|
2091
|
-
versionNumber?: number | undefined;
|
|
2092
|
-
name?: string | null | undefined;
|
|
2093
|
-
description?: string | null | undefined;
|
|
2094
|
-
recordCount?: number | undefined;
|
|
2095
|
-
snapshotHash?: string | undefined;
|
|
2096
|
-
id?: string | undefined;
|
|
2097
|
-
createdAt?: Date | undefined;
|
|
2098
|
-
updatedAt?: Date | undefined;
|
|
2099
|
-
}> | zod0.ZodSafeParseResult<{
|
|
2100
|
-
datasetId?: string | undefined;
|
|
2101
|
-
input?: Record<string, unknown> | undefined;
|
|
2102
|
-
expected?: Record<string, unknown> | null | undefined;
|
|
2103
|
-
metadata?: Record<string, unknown> | undefined;
|
|
2104
|
-
id?: string | undefined;
|
|
2105
|
-
createdAt?: Date | undefined;
|
|
2106
|
-
updatedAt?: Date | undefined;
|
|
2107
|
-
}> | zod0.ZodSafeParseResult<{
|
|
2108
|
-
datasetVersionId?: string | undefined;
|
|
2109
|
-
datasetRecordId?: string | undefined;
|
|
2110
|
-
position?: number | undefined;
|
|
2111
|
-
id?: string | undefined;
|
|
2112
|
-
createdAt?: Date | undefined;
|
|
2113
|
-
updatedAt?: Date | undefined;
|
|
2114
|
-
}> | zod0.ZodSafeParseResult<{
|
|
2115
|
-
requestId?: string | undefined;
|
|
2116
|
-
configId?: string | null | undefined;
|
|
2117
|
-
variantId?: string | null | undefined;
|
|
2118
|
-
environmentId?: string | null | undefined;
|
|
2119
|
-
providerConfigId?: string | null | undefined;
|
|
2120
|
-
provider?: string | undefined;
|
|
2121
|
-
model?: string | undefined;
|
|
2122
|
-
promptTokens?: number | undefined;
|
|
2123
|
-
completionTokens?: number | undefined;
|
|
2124
|
-
totalTokens?: number | undefined;
|
|
2125
|
-
cachedTokens?: number | undefined;
|
|
2126
|
-
cacheCreationTokens?: number | undefined;
|
|
2127
|
-
cost?: number | undefined;
|
|
2128
|
-
cacheSavings?: number | undefined;
|
|
2129
|
-
inputCost?: number | undefined;
|
|
2130
|
-
outputCost?: number | undefined;
|
|
2131
|
-
endpoint?: string | undefined;
|
|
2132
|
-
statusCode?: number | undefined;
|
|
2133
|
-
latencyMs?: number | undefined;
|
|
2134
|
-
isStreaming?: boolean | undefined;
|
|
2135
|
-
userId?: string | null | undefined;
|
|
2136
|
-
tags?: Record<string, string> | undefined;
|
|
2137
|
-
guardrailResults?: {
|
|
2138
|
-
results: {
|
|
2139
|
-
checkId: string;
|
|
2140
|
-
functionId: string;
|
|
2141
|
-
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
2142
|
-
verdict: boolean;
|
|
2143
|
-
latencyMs: number;
|
|
2144
|
-
}[];
|
|
2145
|
-
action: "allowed" | "blocked" | "logged";
|
|
2146
|
-
totalLatencyMs: number;
|
|
2147
|
-
} | null | undefined;
|
|
2148
|
-
traceId?: string | null | undefined;
|
|
2149
|
-
spanId?: string | null | undefined;
|
|
2150
|
-
parentSpanId?: string | null | undefined;
|
|
2151
|
-
sessionId?: string | null | undefined;
|
|
2152
|
-
id?: string | undefined;
|
|
2153
|
-
createdAt?: Date | undefined;
|
|
2154
|
-
updatedAt?: Date | undefined;
|
|
2155
|
-
}> | zod0.ZodSafeParseResult<{
|
|
2156
|
-
traceId?: string | undefined;
|
|
2157
|
-
name?: string | null | undefined;
|
|
2158
|
-
sessionId?: string | null | undefined;
|
|
2159
|
-
userId?: string | null | undefined;
|
|
2160
|
-
status?: string | undefined;
|
|
2161
|
-
startTime?: Date | undefined;
|
|
2162
|
-
endTime?: Date | null | undefined;
|
|
2163
|
-
durationMs?: number | null | undefined;
|
|
2164
|
-
spanCount?: number | undefined;
|
|
2165
|
-
totalInputTokens?: number | undefined;
|
|
2166
|
-
totalOutputTokens?: number | undefined;
|
|
2167
|
-
totalTokens?: number | undefined;
|
|
2168
|
-
totalCost?: number | undefined;
|
|
2169
|
-
tags?: Record<string, string> | undefined;
|
|
2170
|
-
metadata?: Record<string, unknown> | undefined;
|
|
2171
|
-
id?: string | undefined;
|
|
2172
|
-
createdAt?: Date | undefined;
|
|
2173
|
-
updatedAt?: Date | undefined;
|
|
2174
|
-
}> | zod0.ZodSafeParseResult<{
|
|
2175
|
-
traceId?: string | undefined;
|
|
2176
|
-
spanId?: string | undefined;
|
|
2177
|
-
parentSpanId?: string | null | undefined;
|
|
2178
|
-
name?: string | undefined;
|
|
2179
|
-
kind?: number | undefined;
|
|
2180
|
-
status?: number | undefined;
|
|
2181
|
-
statusMessage?: string | null | undefined;
|
|
2182
|
-
startTime?: Date | undefined;
|
|
2183
|
-
endTime?: Date | null | undefined;
|
|
2184
|
-
durationMs?: number | null | undefined;
|
|
2185
|
-
provider?: string | null | undefined;
|
|
2186
|
-
model?: string | null | undefined;
|
|
2187
|
-
promptTokens?: number | undefined;
|
|
2188
|
-
completionTokens?: number | undefined;
|
|
2189
|
-
totalTokens?: number | undefined;
|
|
2190
|
-
cost?: number | undefined;
|
|
2191
|
-
configId?: string | null | undefined;
|
|
2192
|
-
variantId?: string | null | undefined;
|
|
2193
|
-
environmentId?: string | null | undefined;
|
|
2194
|
-
providerConfigId?: string | null | undefined;
|
|
2195
|
-
requestId?: string | null | undefined;
|
|
2196
|
-
source?: string | undefined;
|
|
2197
|
-
input?: unknown;
|
|
2198
|
-
output?: unknown;
|
|
2199
|
-
attributes?: Record<string, unknown> | undefined;
|
|
2200
|
-
id?: string | undefined;
|
|
2201
|
-
createdAt?: Date | undefined;
|
|
2202
|
-
updatedAt?: Date | undefined;
|
|
2203
|
-
}> | zod0.ZodSafeParseResult<{
|
|
2204
|
-
id?: string | undefined;
|
|
2205
|
-
traceId?: string | undefined;
|
|
2206
|
-
spanId?: string | undefined;
|
|
2207
|
-
name?: string | undefined;
|
|
2208
|
-
timestamp?: Date | undefined;
|
|
2209
|
-
attributes?: Record<string, unknown> | undefined;
|
|
2210
|
-
createdAt?: Date | undefined;
|
|
2211
|
-
}>;
|
|
2212
|
-
/**
|
|
2213
|
-
* Parse and validate data, throws on error
|
|
2214
|
-
*/
|
|
2215
|
-
declare function parseTableData<T extends TableName>(table: T, data: unknown): {
|
|
2216
|
-
setupComplete: boolean;
|
|
2217
|
-
id: string;
|
|
2218
|
-
createdAt: Date;
|
|
2219
|
-
updatedAt: Date;
|
|
2220
|
-
name?: string | null | undefined;
|
|
2221
|
-
superAdminId?: string | null | undefined;
|
|
2222
|
-
} | {
|
|
2223
|
-
name: string;
|
|
2224
|
-
columns: {
|
|
2225
|
-
id: string;
|
|
2226
|
-
name: string;
|
|
2227
|
-
position: number;
|
|
2228
|
-
modelName: string;
|
|
2229
|
-
messages: {
|
|
2230
|
-
role: "system" | "user" | "assistant";
|
|
2231
|
-
content: string;
|
|
2232
|
-
}[];
|
|
2233
|
-
providerConfigId?: string | null | undefined;
|
|
2234
|
-
providerSlug?: string | null | undefined;
|
|
2235
|
-
temperature?: number | null | undefined;
|
|
2236
|
-
maxTokens?: number | null | undefined;
|
|
2237
|
-
topP?: number | null | undefined;
|
|
2238
|
-
frequencyPenalty?: number | null | undefined;
|
|
2239
|
-
presencePenalty?: number | null | undefined;
|
|
2240
|
-
}[] | null;
|
|
2241
|
-
id: string;
|
|
2242
|
-
createdAt: Date;
|
|
2243
|
-
updatedAt: Date;
|
|
2244
|
-
datasetId?: string | null | undefined;
|
|
2245
|
-
} | {
|
|
2246
|
-
playgroundId: string;
|
|
2247
|
-
datasetId: string | null;
|
|
2248
|
-
datasetVersionId: string | null;
|
|
2249
|
-
status: "pending" | "running" | "completed" | "failed" | "cancelled";
|
|
2250
|
-
startedAt: Date | null;
|
|
2251
|
-
completedAt: Date | null;
|
|
2252
|
-
totalRecords: number;
|
|
2253
|
-
completedRecords: number;
|
|
2254
|
-
id: string;
|
|
2255
|
-
createdAt: Date;
|
|
2256
|
-
updatedAt: Date;
|
|
2257
|
-
} | {
|
|
2258
|
-
runId: string;
|
|
2259
|
-
columnId: string;
|
|
2260
|
-
datasetRecordId: string | null;
|
|
2261
|
-
inputVariables: Record<string, unknown>;
|
|
2262
|
-
outputContent: string | null;
|
|
2263
|
-
status: "pending" | "running" | "completed" | "failed";
|
|
2264
|
-
error: string | null;
|
|
2265
|
-
latencyMs: number | null;
|
|
2266
|
-
promptTokens: number | null;
|
|
2267
|
-
completionTokens: number | null;
|
|
2268
|
-
totalTokens: number | null;
|
|
2269
|
-
cost: number | null;
|
|
2270
|
-
id: string;
|
|
2271
|
-
createdAt: Date;
|
|
2272
|
-
updatedAt: Date;
|
|
2273
|
-
} | {
|
|
2274
|
-
name: string;
|
|
2275
|
-
recordCount: number;
|
|
2276
|
-
latestVersionNumber: number;
|
|
2277
|
-
id: string;
|
|
2278
|
-
createdAt: Date;
|
|
2279
|
-
updatedAt: Date;
|
|
2280
|
-
description?: string | null | undefined;
|
|
2281
|
-
} | {
|
|
2282
|
-
datasetId: string;
|
|
2283
|
-
versionNumber: number;
|
|
2284
|
-
recordCount: number;
|
|
2285
|
-
snapshotHash: string;
|
|
2286
|
-
id: string;
|
|
2287
|
-
createdAt: Date;
|
|
2288
|
-
updatedAt: Date;
|
|
2289
|
-
name?: string | null | undefined;
|
|
2290
|
-
description?: string | null | undefined;
|
|
2291
|
-
} | {
|
|
2292
|
-
datasetId: string;
|
|
2293
|
-
input: Record<string, unknown>;
|
|
2294
|
-
metadata: Record<string, unknown>;
|
|
2295
|
-
id: string;
|
|
2296
|
-
createdAt: Date;
|
|
2297
|
-
updatedAt: Date;
|
|
2298
|
-
expected?: Record<string, unknown> | null | undefined;
|
|
2299
|
-
} | {
|
|
2300
|
-
datasetVersionId: string;
|
|
2301
|
-
datasetRecordId: string;
|
|
2302
|
-
position: number;
|
|
2303
|
-
id: string;
|
|
2304
|
-
createdAt: Date;
|
|
2305
|
-
updatedAt: Date;
|
|
2306
|
-
} | {
|
|
2307
|
-
requestId: string;
|
|
2308
|
-
provider: string;
|
|
2309
|
-
model: string;
|
|
2310
|
-
promptTokens: number;
|
|
2311
|
-
completionTokens: number;
|
|
2312
|
-
totalTokens: number;
|
|
2313
|
-
cachedTokens: number;
|
|
2314
|
-
cacheCreationTokens: number;
|
|
2315
|
-
cost: number;
|
|
2316
|
-
cacheSavings: number;
|
|
2317
|
-
inputCost: number;
|
|
2318
|
-
outputCost: number;
|
|
2319
|
-
endpoint: string;
|
|
2320
|
-
statusCode: number;
|
|
2321
|
-
latencyMs: number;
|
|
2322
|
-
isStreaming: boolean;
|
|
2323
|
-
tags: Record<string, string>;
|
|
2324
|
-
id: string;
|
|
2325
|
-
createdAt: Date;
|
|
2326
|
-
updatedAt: Date;
|
|
2327
|
-
configId?: string | null | undefined;
|
|
2328
|
-
variantId?: string | null | undefined;
|
|
2329
|
-
environmentId?: string | null | undefined;
|
|
2330
|
-
providerConfigId?: string | null | undefined;
|
|
2331
|
-
userId?: string | null | undefined;
|
|
2332
|
-
guardrailResults?: {
|
|
2333
|
-
results: {
|
|
2334
|
-
checkId: string;
|
|
2335
|
-
functionId: string;
|
|
2336
|
-
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
2337
|
-
verdict: boolean;
|
|
2338
|
-
latencyMs: number;
|
|
2339
|
-
}[];
|
|
2340
|
-
action: "allowed" | "blocked" | "logged";
|
|
2341
|
-
totalLatencyMs: number;
|
|
2342
|
-
} | null | undefined;
|
|
2343
|
-
traceId?: string | null | undefined;
|
|
2344
|
-
spanId?: string | null | undefined;
|
|
2345
|
-
parentSpanId?: string | null | undefined;
|
|
2346
|
-
sessionId?: string | null | undefined;
|
|
2347
|
-
} | {
|
|
2348
|
-
traceId: string;
|
|
2349
|
-
status: string;
|
|
2350
|
-
startTime: Date;
|
|
2351
|
-
spanCount: number;
|
|
2352
|
-
totalInputTokens: number;
|
|
2353
|
-
totalOutputTokens: number;
|
|
2354
|
-
totalTokens: number;
|
|
2355
|
-
totalCost: number;
|
|
2356
|
-
tags: Record<string, string>;
|
|
2357
|
-
metadata: Record<string, unknown>;
|
|
2358
|
-
id: string;
|
|
2359
|
-
createdAt: Date;
|
|
2360
|
-
updatedAt: Date;
|
|
2361
|
-
name?: string | null | undefined;
|
|
2362
|
-
sessionId?: string | null | undefined;
|
|
2363
|
-
userId?: string | null | undefined;
|
|
2364
|
-
endTime?: Date | null | undefined;
|
|
2365
|
-
durationMs?: number | null | undefined;
|
|
2366
|
-
} | {
|
|
2367
|
-
traceId: string;
|
|
2368
|
-
spanId: string;
|
|
2369
|
-
name: string;
|
|
2370
|
-
kind: number;
|
|
2371
|
-
status: number;
|
|
2372
|
-
startTime: Date;
|
|
2373
|
-
promptTokens: number;
|
|
2374
|
-
completionTokens: number;
|
|
2375
|
-
totalTokens: number;
|
|
2376
|
-
cost: number;
|
|
2377
|
-
source: string;
|
|
2378
|
-
attributes: Record<string, unknown>;
|
|
2379
|
-
id: string;
|
|
2380
|
-
createdAt: Date;
|
|
2381
|
-
updatedAt: Date;
|
|
2382
|
-
parentSpanId?: string | null | undefined;
|
|
2383
|
-
statusMessage?: string | null | undefined;
|
|
2384
|
-
endTime?: Date | null | undefined;
|
|
2385
|
-
durationMs?: number | null | undefined;
|
|
2386
|
-
provider?: string | null | undefined;
|
|
2387
|
-
model?: string | null | undefined;
|
|
2388
|
-
configId?: string | null | undefined;
|
|
2389
|
-
variantId?: string | null | undefined;
|
|
2390
|
-
environmentId?: string | null | undefined;
|
|
2391
|
-
providerConfigId?: string | null | undefined;
|
|
2392
|
-
requestId?: string | null | undefined;
|
|
2393
|
-
input?: unknown;
|
|
2394
|
-
output?: unknown;
|
|
2395
|
-
} | {
|
|
2396
|
-
id: string;
|
|
2397
|
-
traceId: string;
|
|
2398
|
-
spanId: string;
|
|
2399
|
-
name: string;
|
|
2400
|
-
timestamp: Date;
|
|
2401
|
-
attributes: Record<string, unknown>;
|
|
2402
|
-
createdAt: Date;
|
|
2403
|
-
};
|
|
2404
|
-
/**
|
|
2405
|
-
* Parse partial data, throws on error
|
|
2406
|
-
*/
|
|
2407
|
-
declare function parsePartialTableData<T extends TableName>(table: T, data: unknown): {
|
|
2408
|
-
name?: string | null | undefined;
|
|
2409
|
-
setupComplete?: boolean | undefined;
|
|
2410
|
-
superAdminId?: string | null | undefined;
|
|
2411
|
-
id?: string | undefined;
|
|
2412
|
-
createdAt?: Date | undefined;
|
|
2413
|
-
updatedAt?: Date | undefined;
|
|
2414
|
-
} | {
|
|
2415
|
-
name?: string | undefined;
|
|
2416
|
-
datasetId?: string | null | undefined;
|
|
2417
|
-
columns?: {
|
|
2418
|
-
id: string;
|
|
2419
|
-
name: string;
|
|
2420
|
-
position: number;
|
|
2421
|
-
modelName: string;
|
|
2422
|
-
messages: {
|
|
2423
|
-
role: "system" | "user" | "assistant";
|
|
2424
|
-
content: string;
|
|
2425
|
-
}[];
|
|
2426
|
-
providerConfigId?: string | null | undefined;
|
|
2427
|
-
providerSlug?: string | null | undefined;
|
|
2428
|
-
temperature?: number | null | undefined;
|
|
2429
|
-
maxTokens?: number | null | undefined;
|
|
2430
|
-
topP?: number | null | undefined;
|
|
2431
|
-
frequencyPenalty?: number | null | undefined;
|
|
2432
|
-
presencePenalty?: number | null | undefined;
|
|
2433
|
-
}[] | null | undefined;
|
|
2434
|
-
id?: string | undefined;
|
|
2435
|
-
createdAt?: Date | undefined;
|
|
2436
|
-
updatedAt?: Date | undefined;
|
|
2437
|
-
} | {
|
|
2438
|
-
playgroundId?: string | undefined;
|
|
2439
|
-
datasetId?: string | null | undefined;
|
|
2440
|
-
datasetVersionId?: string | null | undefined;
|
|
2441
|
-
status?: "pending" | "running" | "completed" | "failed" | "cancelled" | undefined;
|
|
2442
|
-
startedAt?: Date | null | undefined;
|
|
2443
|
-
completedAt?: Date | null | undefined;
|
|
2444
|
-
totalRecords?: number | undefined;
|
|
2445
|
-
completedRecords?: number | undefined;
|
|
2446
|
-
id?: string | undefined;
|
|
2447
|
-
createdAt?: Date | undefined;
|
|
2448
|
-
updatedAt?: Date | undefined;
|
|
2449
|
-
} | {
|
|
2450
|
-
runId?: string | undefined;
|
|
2451
|
-
columnId?: string | undefined;
|
|
2452
|
-
datasetRecordId?: string | null | undefined;
|
|
2453
|
-
inputVariables?: Record<string, unknown> | undefined;
|
|
2454
|
-
outputContent?: string | null | undefined;
|
|
2455
|
-
status?: "pending" | "running" | "completed" | "failed" | undefined;
|
|
2456
|
-
error?: string | null | undefined;
|
|
2457
|
-
latencyMs?: number | null | undefined;
|
|
2458
|
-
promptTokens?: number | null | undefined;
|
|
2459
|
-
completionTokens?: number | null | undefined;
|
|
2460
|
-
totalTokens?: number | null | undefined;
|
|
2461
|
-
cost?: number | null | undefined;
|
|
2462
|
-
id?: string | undefined;
|
|
2463
|
-
createdAt?: Date | undefined;
|
|
2464
|
-
updatedAt?: Date | undefined;
|
|
2465
|
-
} | {
|
|
2466
|
-
name?: string | undefined;
|
|
2467
|
-
description?: string | null | undefined;
|
|
2468
|
-
recordCount?: number | undefined;
|
|
2469
|
-
latestVersionNumber?: number | undefined;
|
|
2470
|
-
id?: string | undefined;
|
|
2471
|
-
createdAt?: Date | undefined;
|
|
2472
|
-
updatedAt?: Date | undefined;
|
|
2473
|
-
} | {
|
|
2474
|
-
datasetId?: string | undefined;
|
|
2475
|
-
versionNumber?: number | undefined;
|
|
2476
|
-
name?: string | null | undefined;
|
|
2477
|
-
description?: string | null | undefined;
|
|
2478
|
-
recordCount?: number | undefined;
|
|
2479
|
-
snapshotHash?: string | undefined;
|
|
2480
|
-
id?: string | undefined;
|
|
2481
|
-
createdAt?: Date | undefined;
|
|
2482
|
-
updatedAt?: Date | undefined;
|
|
2483
|
-
} | {
|
|
2484
|
-
datasetId?: string | undefined;
|
|
2485
|
-
input?: Record<string, unknown> | undefined;
|
|
2486
|
-
expected?: Record<string, unknown> | null | undefined;
|
|
2487
|
-
metadata?: Record<string, unknown> | undefined;
|
|
2488
|
-
id?: string | undefined;
|
|
2489
|
-
createdAt?: Date | undefined;
|
|
2490
|
-
updatedAt?: Date | undefined;
|
|
2491
|
-
} | {
|
|
2492
|
-
datasetVersionId?: string | undefined;
|
|
2493
|
-
datasetRecordId?: string | undefined;
|
|
2494
|
-
position?: number | undefined;
|
|
2495
|
-
id?: string | undefined;
|
|
2496
|
-
createdAt?: Date | undefined;
|
|
2497
|
-
updatedAt?: Date | undefined;
|
|
2498
|
-
} | {
|
|
2499
|
-
requestId?: string | undefined;
|
|
2500
|
-
configId?: string | null | undefined;
|
|
2501
|
-
variantId?: string | null | undefined;
|
|
2502
|
-
environmentId?: string | null | undefined;
|
|
2503
|
-
providerConfigId?: string | null | undefined;
|
|
2504
|
-
provider?: string | undefined;
|
|
2505
|
-
model?: string | undefined;
|
|
2506
|
-
promptTokens?: number | undefined;
|
|
2507
|
-
completionTokens?: number | undefined;
|
|
2508
|
-
totalTokens?: number | undefined;
|
|
2509
|
-
cachedTokens?: number | undefined;
|
|
2510
|
-
cacheCreationTokens?: number | undefined;
|
|
2511
|
-
cost?: number | undefined;
|
|
2512
|
-
cacheSavings?: number | undefined;
|
|
2513
|
-
inputCost?: number | undefined;
|
|
2514
|
-
outputCost?: number | undefined;
|
|
2515
|
-
endpoint?: string | undefined;
|
|
2516
|
-
statusCode?: number | undefined;
|
|
2517
|
-
latencyMs?: number | undefined;
|
|
2518
|
-
isStreaming?: boolean | undefined;
|
|
2519
|
-
userId?: string | null | undefined;
|
|
2520
|
-
tags?: Record<string, string> | undefined;
|
|
2521
|
-
guardrailResults?: {
|
|
2522
|
-
results: {
|
|
2523
|
-
checkId: string;
|
|
2524
|
-
functionId: string;
|
|
2525
|
-
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
2526
|
-
verdict: boolean;
|
|
2527
|
-
latencyMs: number;
|
|
2528
|
-
}[];
|
|
2529
|
-
action: "allowed" | "blocked" | "logged";
|
|
2530
|
-
totalLatencyMs: number;
|
|
2531
|
-
} | null | undefined;
|
|
2532
|
-
traceId?: string | null | undefined;
|
|
2533
|
-
spanId?: string | null | undefined;
|
|
2534
|
-
parentSpanId?: string | null | undefined;
|
|
2535
|
-
sessionId?: string | null | undefined;
|
|
2536
|
-
id?: string | undefined;
|
|
2537
|
-
createdAt?: Date | undefined;
|
|
2538
|
-
updatedAt?: Date | undefined;
|
|
2539
|
-
} | {
|
|
2540
|
-
traceId?: string | undefined;
|
|
2541
|
-
name?: string | null | undefined;
|
|
2542
|
-
sessionId?: string | null | undefined;
|
|
2543
|
-
userId?: string | null | undefined;
|
|
2544
|
-
status?: string | undefined;
|
|
2545
|
-
startTime?: Date | undefined;
|
|
2546
|
-
endTime?: Date | null | undefined;
|
|
2547
|
-
durationMs?: number | null | undefined;
|
|
2548
|
-
spanCount?: number | undefined;
|
|
2549
|
-
totalInputTokens?: number | undefined;
|
|
2550
|
-
totalOutputTokens?: number | undefined;
|
|
2551
|
-
totalTokens?: number | undefined;
|
|
2552
|
-
totalCost?: number | undefined;
|
|
2553
|
-
tags?: Record<string, string> | undefined;
|
|
2554
|
-
metadata?: Record<string, unknown> | undefined;
|
|
2555
|
-
id?: string | undefined;
|
|
2556
|
-
createdAt?: Date | undefined;
|
|
2557
|
-
updatedAt?: Date | undefined;
|
|
2558
|
-
} | {
|
|
2559
|
-
traceId?: string | undefined;
|
|
2560
|
-
spanId?: string | undefined;
|
|
2561
|
-
parentSpanId?: string | null | undefined;
|
|
2562
|
-
name?: string | undefined;
|
|
2563
|
-
kind?: number | undefined;
|
|
2564
|
-
status?: number | undefined;
|
|
2565
|
-
statusMessage?: string | null | undefined;
|
|
2566
|
-
startTime?: Date | undefined;
|
|
2567
|
-
endTime?: Date | null | undefined;
|
|
2568
|
-
durationMs?: number | null | undefined;
|
|
2569
|
-
provider?: string | null | undefined;
|
|
2570
|
-
model?: string | null | undefined;
|
|
2571
|
-
promptTokens?: number | undefined;
|
|
2572
|
-
completionTokens?: number | undefined;
|
|
2573
|
-
totalTokens?: number | undefined;
|
|
2574
|
-
cost?: number | undefined;
|
|
2575
|
-
configId?: string | null | undefined;
|
|
2576
|
-
variantId?: string | null | undefined;
|
|
2577
|
-
environmentId?: string | null | undefined;
|
|
2578
|
-
providerConfigId?: string | null | undefined;
|
|
2579
|
-
requestId?: string | null | undefined;
|
|
2580
|
-
source?: string | undefined;
|
|
2581
|
-
input?: unknown;
|
|
2582
|
-
output?: unknown;
|
|
2583
|
-
attributes?: Record<string, unknown> | undefined;
|
|
2584
|
-
id?: string | undefined;
|
|
2585
|
-
createdAt?: Date | undefined;
|
|
2586
|
-
updatedAt?: Date | undefined;
|
|
2587
|
-
} | {
|
|
2588
|
-
id?: string | undefined;
|
|
2589
|
-
traceId?: string | undefined;
|
|
2590
|
-
spanId?: string | undefined;
|
|
2591
|
-
name?: string | undefined;
|
|
2592
|
-
timestamp?: Date | undefined;
|
|
2593
|
-
attributes?: Record<string, unknown> | undefined;
|
|
2594
|
-
createdAt?: Date | undefined;
|
|
2595
|
-
};
|
|
2596
|
-
//#endregion
|
|
2597
|
-
//#region src/db/migrations.d.ts
|
|
2598
|
-
/**
|
|
2599
|
-
* Options for migration operations
|
|
2600
|
-
*/
|
|
2601
|
-
interface MigrationOptions {
|
|
2602
|
-
/**
|
|
2603
|
-
* PostgreSQL schema name to use.
|
|
2604
|
-
* If provided, the schema will be created if it doesn't exist.
|
|
2605
|
-
*/
|
|
2606
|
-
schema?: string;
|
|
2607
|
-
rawConnection?: unknown;
|
|
2608
|
-
}
|
|
2609
|
-
declare function matchType(columnDataType: string, fieldType: string, dbType: DatabaseType): boolean;
|
|
2610
|
-
interface MigrationResult {
|
|
2611
|
-
toBeCreated: Array<{
|
|
2612
|
-
table: string;
|
|
2613
|
-
fields: Record<string, any>;
|
|
2614
|
-
order: number;
|
|
2615
|
-
}>;
|
|
2616
|
-
toBeAdded: Array<{
|
|
2617
|
-
table: string;
|
|
2618
|
-
fields: Record<string, any>;
|
|
2619
|
-
order: number;
|
|
2620
|
-
}>;
|
|
2621
|
-
runMigrations: () => Promise<void>;
|
|
2622
|
-
compileMigrations: () => Promise<string>;
|
|
2623
|
-
migrations: any[];
|
|
2624
|
-
needsMigration: boolean;
|
|
2625
|
-
}
|
|
2626
|
-
declare function getMigrations(db: Kysely<Database>, dbType: DatabaseType, options?: MigrationOptions): Promise<MigrationResult>;
|
|
2627
|
-
/**
|
|
2628
|
-
* Run migrations if needed
|
|
2629
|
-
* @param db - Kysely database instance
|
|
2630
|
-
* @param dbType - Database type
|
|
2631
|
-
* @param options - Migration options (schema, etc.)
|
|
2632
|
-
* @returns true if migrations were run, false otherwise
|
|
2633
|
-
*/
|
|
2634
|
-
declare function runAutoMigrations(db: Kysely<Database>, dbType: DatabaseType, options?: MigrationOptions): Promise<{
|
|
2635
|
-
ran: boolean;
|
|
2636
|
-
tables: string[];
|
|
2637
|
-
fields: string[];
|
|
2638
|
-
}>;
|
|
2639
|
-
//#endregion
|
|
2640
|
-
//#region src/db/neon-dialect.d.ts
|
|
2641
|
-
/**
|
|
2642
|
-
* Create a Neon serverless dialect for Kysely
|
|
2643
|
-
*
|
|
2644
|
-
* @param neonInstance - Neon database query function
|
|
2645
|
-
* @returns Kysely dialect configured for Neon serverless
|
|
2646
|
-
*/
|
|
2647
|
-
declare function createNeonDialect(neonInstance: NeonQueryFunction<false, false>): any;
|
|
2648
|
-
/**
|
|
2649
|
-
* Execute a query with search_path set for Neon serverless
|
|
2650
|
-
*
|
|
2651
|
-
* @param neonInstance - Neon database query function
|
|
2652
|
-
* @param query - SQL query to execute
|
|
2653
|
-
* @param schema - Schema to set (optional)
|
|
2654
|
-
* @returns Query result
|
|
2655
|
-
*/
|
|
2656
|
-
declare function executeWithSchema(neonInstance: NeonQueryFunction<false, false>, query: string, schema?: string): Promise<any>;
|
|
2657
|
-
//#endregion
|
|
2658
|
-
//#region src/db/index.d.ts
|
|
2659
|
-
/**
|
|
2660
|
-
* Supported database types
|
|
2661
|
-
*/
|
|
2662
|
-
type DatabaseType = 'postgres' | 'mysql' | 'sqlite' | 'mssql' | 'neon';
|
|
2663
|
-
/**
|
|
2664
|
-
* Options for creating a database connection
|
|
2665
|
-
*/
|
|
2666
|
-
interface DatabaseOptions {
|
|
2667
|
-
/**
|
|
2668
|
-
* PostgreSQL schema name (sets search_path).
|
|
2669
|
-
* Defaults to 'llmops'.
|
|
2670
|
-
*/
|
|
2671
|
-
schema?: string;
|
|
2672
|
-
}
|
|
2673
|
-
/**
|
|
2674
|
-
* Database connection options
|
|
2675
|
-
*/
|
|
2676
|
-
type DatabaseConnection = {
|
|
2677
|
-
type: 'postgres';
|
|
2678
|
-
dialect: PostgresDialect;
|
|
2679
|
-
} | {
|
|
2680
|
-
type: 'mysql';
|
|
2681
|
-
dialect: MysqlDialect;
|
|
2682
|
-
} | {
|
|
2683
|
-
type: 'sqlite';
|
|
2684
|
-
dialect: SqliteDialect;
|
|
2685
|
-
} | {
|
|
2686
|
-
type: 'mssql';
|
|
2687
|
-
dialect: MssqlDialect;
|
|
2688
|
-
} | {
|
|
2689
|
-
type: 'neon';
|
|
2690
|
-
dialect: Dialect;
|
|
2691
|
-
} | {
|
|
2692
|
-
type: DatabaseType;
|
|
2693
|
-
kysely: Kysely<Database>;
|
|
2694
|
-
};
|
|
2695
|
-
/**
|
|
2696
|
-
* Create a Kysely database instance with type safety
|
|
2697
|
-
*/
|
|
2698
|
-
declare function createDatabase(connection: DatabaseConnection): Kysely<Database>;
|
|
2699
|
-
/**
|
|
2700
|
-
* Auto-detect database type from connection object or string
|
|
2701
|
-
*/
|
|
2702
|
-
declare function detectDatabaseType(db: unknown): DatabaseType | null;
|
|
2703
|
-
/**
|
|
2704
|
-
* Create database from raw connection
|
|
2705
|
-
*
|
|
2706
|
-
* @param rawConnection - The raw database connection (pg Pool, sqlite Database, etc.)
|
|
2707
|
-
* @param options - Optional configuration (schema for PostgreSQL)
|
|
2708
|
-
*/
|
|
2709
|
-
declare function createDatabaseFromConnection(rawConnection: any, options?: DatabaseOptions): Promise<Kysely<Database> | null>;
|
|
2710
|
-
//#endregion
|
|
2711
|
-
export { SCHEMA_METADATA as $, DatasetsTable as A, playgroundsSchema as At, LLMRequest as B, workspaceSettingsSchema as Bt, Dataset as C, environmentSecretsSchema as Ct, DatasetVersionRecord as D, playgroundColumnSchema as Dt, DatasetVersion as E, llmRequestsSchema as Et, GuardrailConfig as F, spansSchema as Ft, PlaygroundResultsTable as G, Playground as H, GuardrailConfigsTable as I, targetingRulesSchema as It, PlaygroundsTable as J, PlaygroundRun as K, GuardrailResult as L, tracesSchema as Lt, EnvironmentSecret as M, providerGuardrailOverridesSchema as Mt, EnvironmentSecretsTable as N, schemas as Nt, DatasetVersionRecordsTable as O, playgroundResultsSchema as Ot, EnvironmentsTable as P, spanEventsSchema as Pt, ProviderGuardrailOverridesTable as Q, GuardrailResults as R, variantVersionsSchema as Rt, Database as S, datasetsSchema as St, DatasetRecordsTable as T, guardrailConfigsSchema as Tt, PlaygroundColumn as U, LLMRequestsTable as V, PlaygroundResult as W, ProviderConfigsTable as X, ProviderConfig as Y, ProviderGuardrailOverride as Z, validateTableData as _, configVariantsSchema as _t, createDatabaseFromConnection as a, TableName as at, ConfigVariantsTable as b, datasetVersionRecordsSchema as bt, executeWithSchema as c, Trace as ct, getMigrations as d, Variant as dt, Selectable as et, matchType as f, VariantVersion as ft, validatePartialTableData as g, WorkspaceSettingsTable as gt, parseTableData as h, WorkspaceSettings as ht, createDatabase as i, SpansTable as it, Environment as j, providerConfigsSchema as jt, DatasetVersionsTable as k, playgroundRunsSchema as kt, MigrationOptions as l, TracesTable as lt, parsePartialTableData as m, VariantsTable as mt, DatabaseOptions as n, SpanEvent as nt, detectDatabaseType as o, TargetingRule as ot, runAutoMigrations as p, VariantVersionsTable as pt, PlaygroundRunsTable as q, DatabaseType as r, SpanEventsTable as rt, createNeonDialect as s, TargetingRulesTable as st, DatabaseConnection as t, Span as tt, MigrationResult as u, Updateable as ut, Config as v, configsSchema as vt, DatasetRecord as w, environmentsSchema as wt, ConfigsTable as x, datasetVersionsSchema as xt, ConfigVariant as y, datasetRecordsSchema as yt, Insertable as z, variantsSchema as zt };
|