@llmops/core 1.0.0-beta.1 → 1.0.0-beta.10
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 +4771 -2645
- package/dist/index.d.cts +4 -1772
- package/dist/index.d.mts +4 -1772
- package/dist/index.mjs +4314 -2164
- package/package.json +2 -17
- package/dist/bun-sqlite-dialect-C3HVUfYl.cjs +0 -156
- package/dist/bun-sqlite-dialect-CHpTFgAo.mjs +0 -155
- 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-CjwRQB4N.mjs +0 -14454
- package/dist/db-D3WDjcvd.cjs +0 -14769
- package/dist/index-BmGf4wCW.d.cts +0 -3109
- package/dist/index-BoDvuqku.d.mts +0 -3109
- package/dist/neon-dialect-BSJpZ9YH.cjs +0 -3
- package/dist/neon-dialect-DMClTHvw.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-BZGXfDHS.cjs +0 -156
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as kysely0 from "kysely";
|
|
3
|
-
import { Kysely } from "kysely";
|
|
4
|
-
import z$1, { z } from "zod";
|
|
1
|
+
import { z } from "zod";
|
|
5
2
|
import gateway from "@llmops/gateway";
|
|
6
3
|
import pino from "pino";
|
|
7
4
|
|
|
@@ -717,10 +714,10 @@ declare const chatCompletionCreateParamsBaseSchema: z.ZodObject<{
|
|
|
717
714
|
seed: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
718
715
|
service_tier: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
|
|
719
716
|
default: "default";
|
|
720
|
-
priority: "priority";
|
|
721
717
|
auto: "auto";
|
|
722
718
|
flex: "flex";
|
|
723
719
|
scale: "scale";
|
|
720
|
+
priority: "priority";
|
|
724
721
|
}>>>;
|
|
725
722
|
stop: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
726
723
|
store: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -906,10 +903,10 @@ declare const variantJsonDataSchema: z.ZodObject<{
|
|
|
906
903
|
seed: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
907
904
|
service_tier: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
|
|
908
905
|
default: "default";
|
|
909
|
-
priority: "priority";
|
|
910
906
|
auto: "auto";
|
|
911
907
|
flex: "flex";
|
|
912
908
|
scale: "scale";
|
|
909
|
+
priority: "priority";
|
|
913
910
|
}>>>;
|
|
914
911
|
stop: z.ZodNullable<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
915
912
|
store: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -1188,1660 +1185,6 @@ declare const logger: pino.Logger<never, boolean>;
|
|
|
1188
1185
|
//#region src/utils/id.d.ts
|
|
1189
1186
|
declare const generateId: (size?: number) => string;
|
|
1190
1187
|
//#endregion
|
|
1191
|
-
//#region src/datalayer/datasets.d.ts
|
|
1192
|
-
declare const createDataset: z$1.ZodObject<{
|
|
1193
|
-
name: z$1.ZodString;
|
|
1194
|
-
description: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1195
|
-
}, z$1.core.$strip>;
|
|
1196
|
-
declare const updateDataset: z$1.ZodObject<{
|
|
1197
|
-
datasetId: z$1.ZodString;
|
|
1198
|
-
name: z$1.ZodOptional<z$1.ZodString>;
|
|
1199
|
-
description: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1200
|
-
}, z$1.core.$strip>;
|
|
1201
|
-
declare const getDatasetById: z$1.ZodObject<{
|
|
1202
|
-
datasetId: z$1.ZodString;
|
|
1203
|
-
}, z$1.core.$strip>;
|
|
1204
|
-
declare const deleteDataset: z$1.ZodObject<{
|
|
1205
|
-
datasetId: z$1.ZodString;
|
|
1206
|
-
}, z$1.core.$strip>;
|
|
1207
|
-
declare const listDatasets: z$1.ZodObject<{
|
|
1208
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1209
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1210
|
-
}, z$1.core.$strip>;
|
|
1211
|
-
declare const createRecord: z$1.ZodObject<{
|
|
1212
|
-
datasetId: z$1.ZodString;
|
|
1213
|
-
input: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
|
|
1214
|
-
expected: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
1215
|
-
metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1216
|
-
}, z$1.core.$strip>;
|
|
1217
|
-
declare const updateRecord: z$1.ZodObject<{
|
|
1218
|
-
recordId: z$1.ZodString;
|
|
1219
|
-
input: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1220
|
-
expected: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
1221
|
-
metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1222
|
-
}, z$1.core.$strip>;
|
|
1223
|
-
declare const deleteRecord: z$1.ZodObject<{
|
|
1224
|
-
recordId: z$1.ZodString;
|
|
1225
|
-
}, z$1.core.$strip>;
|
|
1226
|
-
declare const listRecords: z$1.ZodObject<{
|
|
1227
|
-
datasetId: z$1.ZodString;
|
|
1228
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1229
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1230
|
-
}, z$1.core.$strip>;
|
|
1231
|
-
declare const createVersion: z$1.ZodObject<{
|
|
1232
|
-
datasetId: z$1.ZodString;
|
|
1233
|
-
name: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1234
|
-
description: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1235
|
-
}, z$1.core.$strip>;
|
|
1236
|
-
declare const getVersionById: z$1.ZodObject<{
|
|
1237
|
-
versionId: z$1.ZodString;
|
|
1238
|
-
}, z$1.core.$strip>;
|
|
1239
|
-
declare const listVersions: z$1.ZodObject<{
|
|
1240
|
-
datasetId: z$1.ZodString;
|
|
1241
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1242
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1243
|
-
}, z$1.core.$strip>;
|
|
1244
|
-
declare const getVersionRecords: z$1.ZodObject<{
|
|
1245
|
-
versionId: z$1.ZodString;
|
|
1246
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1247
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1248
|
-
}, z$1.core.$strip>;
|
|
1249
|
-
declare const createDatasetsDataLayer: (db: Kysely<Database>) => {
|
|
1250
|
-
createDataset: (params: z$1.infer<typeof createDataset>) => Promise<{
|
|
1251
|
-
name: string;
|
|
1252
|
-
id: string;
|
|
1253
|
-
createdAt: Date;
|
|
1254
|
-
updatedAt: Date;
|
|
1255
|
-
description: string | null;
|
|
1256
|
-
recordCount: number;
|
|
1257
|
-
latestVersionNumber: number;
|
|
1258
|
-
} | undefined>;
|
|
1259
|
-
updateDataset: (params: z$1.infer<typeof updateDataset>) => Promise<{
|
|
1260
|
-
name: string;
|
|
1261
|
-
id: string;
|
|
1262
|
-
createdAt: Date;
|
|
1263
|
-
updatedAt: Date;
|
|
1264
|
-
description: string | null;
|
|
1265
|
-
recordCount: number;
|
|
1266
|
-
latestVersionNumber: number;
|
|
1267
|
-
} | undefined>;
|
|
1268
|
-
getDatasetById: (params: z$1.infer<typeof getDatasetById>) => Promise<{
|
|
1269
|
-
name: string;
|
|
1270
|
-
id: string;
|
|
1271
|
-
createdAt: Date;
|
|
1272
|
-
updatedAt: Date;
|
|
1273
|
-
description: string | null;
|
|
1274
|
-
recordCount: number;
|
|
1275
|
-
latestVersionNumber: number;
|
|
1276
|
-
} | undefined>;
|
|
1277
|
-
deleteDataset: (params: z$1.infer<typeof deleteDataset>) => Promise<{
|
|
1278
|
-
name: string;
|
|
1279
|
-
id: string;
|
|
1280
|
-
createdAt: Date;
|
|
1281
|
-
updatedAt: Date;
|
|
1282
|
-
description: string | null;
|
|
1283
|
-
recordCount: number;
|
|
1284
|
-
latestVersionNumber: number;
|
|
1285
|
-
} | undefined>;
|
|
1286
|
-
listDatasets: (params?: z$1.infer<typeof listDatasets>) => Promise<{
|
|
1287
|
-
name: string;
|
|
1288
|
-
id: string;
|
|
1289
|
-
createdAt: Date;
|
|
1290
|
-
updatedAt: Date;
|
|
1291
|
-
description: string | null;
|
|
1292
|
-
recordCount: number;
|
|
1293
|
-
latestVersionNumber: number;
|
|
1294
|
-
}[]>;
|
|
1295
|
-
countDatasets: () => Promise<number>;
|
|
1296
|
-
createRecord: (params: z$1.infer<typeof createRecord>) => Promise<{
|
|
1297
|
-
id: string;
|
|
1298
|
-
createdAt: Date;
|
|
1299
|
-
updatedAt: Date;
|
|
1300
|
-
input: Record<string, unknown>;
|
|
1301
|
-
datasetId: string;
|
|
1302
|
-
expected: Record<string, unknown> | null;
|
|
1303
|
-
metadata: Record<string, unknown>;
|
|
1304
|
-
} | undefined>;
|
|
1305
|
-
updateRecord: (params: z$1.infer<typeof updateRecord>) => Promise<{
|
|
1306
|
-
id: string;
|
|
1307
|
-
createdAt: Date;
|
|
1308
|
-
updatedAt: Date;
|
|
1309
|
-
input: Record<string, unknown>;
|
|
1310
|
-
datasetId: string;
|
|
1311
|
-
expected: Record<string, unknown> | null;
|
|
1312
|
-
metadata: Record<string, unknown>;
|
|
1313
|
-
} | undefined>;
|
|
1314
|
-
deleteRecord: (params: z$1.infer<typeof deleteRecord>) => Promise<{
|
|
1315
|
-
id: string;
|
|
1316
|
-
createdAt: Date;
|
|
1317
|
-
updatedAt: Date;
|
|
1318
|
-
input: Record<string, unknown>;
|
|
1319
|
-
datasetId: string;
|
|
1320
|
-
expected: Record<string, unknown> | null;
|
|
1321
|
-
metadata: Record<string, unknown>;
|
|
1322
|
-
} | undefined>;
|
|
1323
|
-
listRecords: (params: z$1.infer<typeof listRecords>) => Promise<{
|
|
1324
|
-
id: string;
|
|
1325
|
-
createdAt: Date;
|
|
1326
|
-
updatedAt: Date;
|
|
1327
|
-
input: Record<string, unknown>;
|
|
1328
|
-
datasetId: string;
|
|
1329
|
-
expected: Record<string, unknown> | null;
|
|
1330
|
-
metadata: Record<string, unknown>;
|
|
1331
|
-
}[]>;
|
|
1332
|
-
getRecordById: (recordId: string) => Promise<{
|
|
1333
|
-
id: string;
|
|
1334
|
-
createdAt: Date;
|
|
1335
|
-
updatedAt: Date;
|
|
1336
|
-
input: Record<string, unknown>;
|
|
1337
|
-
datasetId: string;
|
|
1338
|
-
expected: Record<string, unknown> | null;
|
|
1339
|
-
metadata: Record<string, unknown>;
|
|
1340
|
-
} | undefined>;
|
|
1341
|
-
createVersion: (params: z$1.infer<typeof createVersion>) => Promise<{
|
|
1342
|
-
name: string | null;
|
|
1343
|
-
id: string;
|
|
1344
|
-
createdAt: Date;
|
|
1345
|
-
updatedAt: Date;
|
|
1346
|
-
datasetId: string;
|
|
1347
|
-
description: string | null;
|
|
1348
|
-
recordCount: number;
|
|
1349
|
-
versionNumber: number;
|
|
1350
|
-
snapshotHash: string;
|
|
1351
|
-
} | undefined>;
|
|
1352
|
-
getVersionById: (params: z$1.infer<typeof getVersionById>) => Promise<{
|
|
1353
|
-
name: string | null;
|
|
1354
|
-
id: string;
|
|
1355
|
-
createdAt: Date;
|
|
1356
|
-
updatedAt: Date;
|
|
1357
|
-
datasetId: string;
|
|
1358
|
-
description: string | null;
|
|
1359
|
-
recordCount: number;
|
|
1360
|
-
versionNumber: number;
|
|
1361
|
-
snapshotHash: string;
|
|
1362
|
-
} | undefined>;
|
|
1363
|
-
listVersions: (params: z$1.infer<typeof listVersions>) => Promise<{
|
|
1364
|
-
name: string | null;
|
|
1365
|
-
id: string;
|
|
1366
|
-
createdAt: Date;
|
|
1367
|
-
updatedAt: Date;
|
|
1368
|
-
datasetId: string;
|
|
1369
|
-
description: string | null;
|
|
1370
|
-
recordCount: number;
|
|
1371
|
-
versionNumber: number;
|
|
1372
|
-
snapshotHash: string;
|
|
1373
|
-
}[]>;
|
|
1374
|
-
getVersionRecords: (params: z$1.infer<typeof getVersionRecords>) => Promise<{
|
|
1375
|
-
id: string;
|
|
1376
|
-
createdAt: Date;
|
|
1377
|
-
updatedAt: Date;
|
|
1378
|
-
input: Record<string, unknown>;
|
|
1379
|
-
datasetId: string;
|
|
1380
|
-
expected: Record<string, unknown> | null;
|
|
1381
|
-
metadata: Record<string, unknown>;
|
|
1382
|
-
position: number;
|
|
1383
|
-
}[]>;
|
|
1384
|
-
};
|
|
1385
|
-
//#endregion
|
|
1386
|
-
//#region src/datalayer/guardrailConfigs.d.ts
|
|
1387
|
-
declare const createGuardrailConfig: z$1.ZodObject<{
|
|
1388
|
-
name: z$1.ZodString;
|
|
1389
|
-
pluginId: z$1.ZodString;
|
|
1390
|
-
functionId: z$1.ZodString;
|
|
1391
|
-
hookType: z$1.ZodEnum<{
|
|
1392
|
-
beforeRequestHook: "beforeRequestHook";
|
|
1393
|
-
afterRequestHook: "afterRequestHook";
|
|
1394
|
-
}>;
|
|
1395
|
-
parameters: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
1396
|
-
enabled: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
1397
|
-
priority: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
|
|
1398
|
-
onFail: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodEnum<{
|
|
1399
|
-
block: "block";
|
|
1400
|
-
log: "log";
|
|
1401
|
-
}>>>;
|
|
1402
|
-
}, z$1.core.$strip>;
|
|
1403
|
-
declare const updateGuardrailConfig: z$1.ZodObject<{
|
|
1404
|
-
id: z$1.ZodString;
|
|
1405
|
-
name: z$1.ZodOptional<z$1.ZodString>;
|
|
1406
|
-
hookType: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1407
|
-
beforeRequestHook: "beforeRequestHook";
|
|
1408
|
-
afterRequestHook: "afterRequestHook";
|
|
1409
|
-
}>>;
|
|
1410
|
-
parameters: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
1411
|
-
enabled: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1412
|
-
priority: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1413
|
-
onFail: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1414
|
-
block: "block";
|
|
1415
|
-
log: "log";
|
|
1416
|
-
}>>;
|
|
1417
|
-
}, z$1.core.$strip>;
|
|
1418
|
-
declare const getGuardrailConfigById: z$1.ZodObject<{
|
|
1419
|
-
id: z$1.ZodString;
|
|
1420
|
-
}, z$1.core.$strip>;
|
|
1421
|
-
declare const deleteGuardrailConfig: z$1.ZodObject<{
|
|
1422
|
-
id: z$1.ZodString;
|
|
1423
|
-
}, z$1.core.$strip>;
|
|
1424
|
-
declare const listGuardrailConfigs: z$1.ZodObject<{
|
|
1425
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1426
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1427
|
-
hookType: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1428
|
-
beforeRequestHook: "beforeRequestHook";
|
|
1429
|
-
afterRequestHook: "afterRequestHook";
|
|
1430
|
-
}>>;
|
|
1431
|
-
enabled: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
1432
|
-
}, z$1.core.$strip>;
|
|
1433
|
-
declare const createGuardrailConfigsDataLayer: (db: Kysely<Database>) => {
|
|
1434
|
-
createGuardrailConfig: (params: z$1.infer<typeof createGuardrailConfig>) => Promise<{
|
|
1435
|
-
name: string;
|
|
1436
|
-
id: string;
|
|
1437
|
-
createdAt: Date;
|
|
1438
|
-
updatedAt: Date;
|
|
1439
|
-
priority: number;
|
|
1440
|
-
enabled: boolean;
|
|
1441
|
-
pluginId: string;
|
|
1442
|
-
functionId: string;
|
|
1443
|
-
hookType: string;
|
|
1444
|
-
parameters: Record<string, unknown>;
|
|
1445
|
-
onFail: string;
|
|
1446
|
-
} | undefined>;
|
|
1447
|
-
updateGuardrailConfig: (params: z$1.infer<typeof updateGuardrailConfig>) => Promise<{
|
|
1448
|
-
name: string;
|
|
1449
|
-
id: string;
|
|
1450
|
-
createdAt: Date;
|
|
1451
|
-
updatedAt: Date;
|
|
1452
|
-
priority: number;
|
|
1453
|
-
enabled: boolean;
|
|
1454
|
-
pluginId: string;
|
|
1455
|
-
functionId: string;
|
|
1456
|
-
hookType: string;
|
|
1457
|
-
parameters: Record<string, unknown>;
|
|
1458
|
-
onFail: string;
|
|
1459
|
-
} | undefined>;
|
|
1460
|
-
getGuardrailConfigById: (params: z$1.infer<typeof getGuardrailConfigById>) => Promise<{
|
|
1461
|
-
name: string;
|
|
1462
|
-
id: string;
|
|
1463
|
-
createdAt: Date;
|
|
1464
|
-
updatedAt: Date;
|
|
1465
|
-
priority: number;
|
|
1466
|
-
enabled: boolean;
|
|
1467
|
-
pluginId: string;
|
|
1468
|
-
functionId: string;
|
|
1469
|
-
hookType: string;
|
|
1470
|
-
parameters: Record<string, unknown>;
|
|
1471
|
-
onFail: string;
|
|
1472
|
-
} | undefined>;
|
|
1473
|
-
deleteGuardrailConfig: (params: z$1.infer<typeof deleteGuardrailConfig>) => Promise<{
|
|
1474
|
-
name: string;
|
|
1475
|
-
id: string;
|
|
1476
|
-
createdAt: Date;
|
|
1477
|
-
updatedAt: Date;
|
|
1478
|
-
priority: number;
|
|
1479
|
-
enabled: boolean;
|
|
1480
|
-
pluginId: string;
|
|
1481
|
-
functionId: string;
|
|
1482
|
-
hookType: string;
|
|
1483
|
-
parameters: Record<string, unknown>;
|
|
1484
|
-
onFail: string;
|
|
1485
|
-
} | undefined>;
|
|
1486
|
-
listGuardrailConfigs: (params?: z$1.infer<typeof listGuardrailConfigs>) => Promise<{
|
|
1487
|
-
name: string;
|
|
1488
|
-
id: string;
|
|
1489
|
-
createdAt: Date;
|
|
1490
|
-
updatedAt: Date;
|
|
1491
|
-
priority: number;
|
|
1492
|
-
enabled: boolean;
|
|
1493
|
-
pluginId: string;
|
|
1494
|
-
functionId: string;
|
|
1495
|
-
hookType: string;
|
|
1496
|
-
parameters: Record<string, unknown>;
|
|
1497
|
-
onFail: string;
|
|
1498
|
-
}[]>;
|
|
1499
|
-
countGuardrailConfigs: () => Promise<number>;
|
|
1500
|
-
/**
|
|
1501
|
-
* Get all enabled guardrails for a specific hook type
|
|
1502
|
-
* Ordered by priority (highest first)
|
|
1503
|
-
*/
|
|
1504
|
-
getEnabledGuardrailsByHookType: (hookType: "beforeRequestHook" | "afterRequestHook") => Promise<{
|
|
1505
|
-
name: string;
|
|
1506
|
-
id: string;
|
|
1507
|
-
createdAt: Date;
|
|
1508
|
-
updatedAt: Date;
|
|
1509
|
-
priority: number;
|
|
1510
|
-
enabled: boolean;
|
|
1511
|
-
pluginId: string;
|
|
1512
|
-
functionId: string;
|
|
1513
|
-
hookType: string;
|
|
1514
|
-
parameters: Record<string, unknown>;
|
|
1515
|
-
onFail: string;
|
|
1516
|
-
}[]>;
|
|
1517
|
-
};
|
|
1518
|
-
//#endregion
|
|
1519
|
-
//#region src/datalayer/llmRequests.d.ts
|
|
1520
|
-
/**
|
|
1521
|
-
* Schema for inserting a new LLM request log
|
|
1522
|
-
*/
|
|
1523
|
-
declare const insertLLMRequestSchema: z$1.ZodObject<{
|
|
1524
|
-
requestId: z$1.ZodString;
|
|
1525
|
-
configId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1526
|
-
variantId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1527
|
-
environmentId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1528
|
-
providerConfigId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1529
|
-
provider: z$1.ZodString;
|
|
1530
|
-
model: z$1.ZodString;
|
|
1531
|
-
promptTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1532
|
-
completionTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1533
|
-
totalTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1534
|
-
cachedTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1535
|
-
cacheCreationTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1536
|
-
cost: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1537
|
-
cacheSavings: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1538
|
-
inputCost: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1539
|
-
outputCost: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1540
|
-
endpoint: z$1.ZodString;
|
|
1541
|
-
statusCode: z$1.ZodNumber;
|
|
1542
|
-
latencyMs: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1543
|
-
isStreaming: z$1.ZodDefault<z$1.ZodBoolean>;
|
|
1544
|
-
userId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1545
|
-
tags: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
1546
|
-
guardrailResults: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodObject<{
|
|
1547
|
-
results: z$1.ZodArray<z$1.ZodObject<{
|
|
1548
|
-
checkId: z$1.ZodString;
|
|
1549
|
-
functionId: z$1.ZodString;
|
|
1550
|
-
hookType: z$1.ZodEnum<{
|
|
1551
|
-
beforeRequestHook: "beforeRequestHook";
|
|
1552
|
-
afterRequestHook: "afterRequestHook";
|
|
1553
|
-
}>;
|
|
1554
|
-
verdict: z$1.ZodBoolean;
|
|
1555
|
-
latencyMs: z$1.ZodNumber;
|
|
1556
|
-
}, z$1.core.$strip>>;
|
|
1557
|
-
action: z$1.ZodEnum<{
|
|
1558
|
-
allowed: "allowed";
|
|
1559
|
-
blocked: "blocked";
|
|
1560
|
-
logged: "logged";
|
|
1561
|
-
}>;
|
|
1562
|
-
totalLatencyMs: z$1.ZodNumber;
|
|
1563
|
-
}, z$1.core.$strip>>>;
|
|
1564
|
-
traceId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1565
|
-
spanId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1566
|
-
parentSpanId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1567
|
-
sessionId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1568
|
-
}, z$1.core.$strip>;
|
|
1569
|
-
type LLMRequestInsert = z$1.infer<typeof insertLLMRequestSchema>;
|
|
1570
|
-
/**
|
|
1571
|
-
* Schema for listing LLM requests
|
|
1572
|
-
*/
|
|
1573
|
-
declare const listRequestsSchema: z$1.ZodObject<{
|
|
1574
|
-
limit: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1575
|
-
offset: z$1.ZodDefault<z$1.ZodNumber>;
|
|
1576
|
-
configId: z$1.ZodOptional<z$1.ZodString>;
|
|
1577
|
-
variantId: z$1.ZodOptional<z$1.ZodString>;
|
|
1578
|
-
environmentId: z$1.ZodOptional<z$1.ZodString>;
|
|
1579
|
-
providerConfigId: z$1.ZodOptional<z$1.ZodString>;
|
|
1580
|
-
provider: z$1.ZodOptional<z$1.ZodString>;
|
|
1581
|
-
model: z$1.ZodOptional<z$1.ZodString>;
|
|
1582
|
-
startDate: z$1.ZodOptional<z$1.ZodDate>;
|
|
1583
|
-
endDate: z$1.ZodOptional<z$1.ZodDate>;
|
|
1584
|
-
tags: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.ZodString>>>;
|
|
1585
|
-
}, z$1.core.$strip>;
|
|
1586
|
-
/**
|
|
1587
|
-
* Schema for date range queries with optional filters
|
|
1588
|
-
*/
|
|
1589
|
-
declare const dateRangeSchema: z$1.ZodObject<{
|
|
1590
|
-
startDate: z$1.ZodDate;
|
|
1591
|
-
endDate: z$1.ZodDate;
|
|
1592
|
-
configId: z$1.ZodOptional<z$1.ZodString>;
|
|
1593
|
-
variantId: z$1.ZodOptional<z$1.ZodString>;
|
|
1594
|
-
environmentId: z$1.ZodOptional<z$1.ZodString>;
|
|
1595
|
-
tags: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.ZodString>>>;
|
|
1596
|
-
}, z$1.core.$strip>;
|
|
1597
|
-
/**
|
|
1598
|
-
* Valid groupBy values for cost summary queries
|
|
1599
|
-
*/
|
|
1600
|
-
declare const COST_SUMMARY_GROUP_BY: readonly ["day", "hour", "model", "provider", "endpoint", "tags"];
|
|
1601
|
-
type CostSummaryGroupBy = (typeof COST_SUMMARY_GROUP_BY)[number];
|
|
1602
|
-
/**
|
|
1603
|
-
* Schema for cost summary with grouping
|
|
1604
|
-
*/
|
|
1605
|
-
declare const costSummarySchema: z$1.ZodObject<{
|
|
1606
|
-
startDate: z$1.ZodDate;
|
|
1607
|
-
endDate: z$1.ZodDate;
|
|
1608
|
-
configId: z$1.ZodOptional<z$1.ZodString>;
|
|
1609
|
-
variantId: z$1.ZodOptional<z$1.ZodString>;
|
|
1610
|
-
environmentId: z$1.ZodOptional<z$1.ZodString>;
|
|
1611
|
-
tags: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.ZodString>>>;
|
|
1612
|
-
groupBy: z$1.ZodOptional<z$1.ZodEnum<{
|
|
1613
|
-
provider: "provider";
|
|
1614
|
-
model: "model";
|
|
1615
|
-
endpoint: "endpoint";
|
|
1616
|
-
tags: "tags";
|
|
1617
|
-
day: "day";
|
|
1618
|
-
hour: "hour";
|
|
1619
|
-
}>>;
|
|
1620
|
-
tagKeys: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
|
|
1621
|
-
}, z$1.core.$strip>;
|
|
1622
|
-
declare const createLLMRequestsDataLayer: (db: Kysely<Database>) => {
|
|
1623
|
-
/**
|
|
1624
|
-
* Batch insert LLM request logs
|
|
1625
|
-
* Used by the BatchWriter service for efficient writes
|
|
1626
|
-
*/
|
|
1627
|
-
batchInsertRequests: (requests: LLMRequestInsert[]) => Promise<{
|
|
1628
|
-
count: number;
|
|
1629
|
-
}>;
|
|
1630
|
-
/**
|
|
1631
|
-
* Insert a single LLM request log
|
|
1632
|
-
*/
|
|
1633
|
-
insertRequest: (request: LLMRequestInsert) => Promise<{
|
|
1634
|
-
id: string;
|
|
1635
|
-
createdAt: Date;
|
|
1636
|
-
updatedAt: Date;
|
|
1637
|
-
variantId: string | null;
|
|
1638
|
-
provider: string;
|
|
1639
|
-
environmentId: string | null;
|
|
1640
|
-
configId: string | null;
|
|
1641
|
-
providerConfigId: string | null;
|
|
1642
|
-
latencyMs: number;
|
|
1643
|
-
promptTokens: number;
|
|
1644
|
-
completionTokens: number;
|
|
1645
|
-
totalTokens: number;
|
|
1646
|
-
cost: number;
|
|
1647
|
-
requestId: string;
|
|
1648
|
-
model: string;
|
|
1649
|
-
cachedTokens: number;
|
|
1650
|
-
cacheCreationTokens: number;
|
|
1651
|
-
cacheSavings: number;
|
|
1652
|
-
inputCost: number;
|
|
1653
|
-
outputCost: number;
|
|
1654
|
-
endpoint: string;
|
|
1655
|
-
statusCode: number;
|
|
1656
|
-
isStreaming: boolean;
|
|
1657
|
-
userId: string | null;
|
|
1658
|
-
tags: Record<string, string>;
|
|
1659
|
-
guardrailResults: {
|
|
1660
|
-
results: {
|
|
1661
|
-
checkId: string;
|
|
1662
|
-
functionId: string;
|
|
1663
|
-
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
1664
|
-
verdict: boolean;
|
|
1665
|
-
latencyMs: number;
|
|
1666
|
-
}[];
|
|
1667
|
-
action: "allowed" | "blocked" | "logged";
|
|
1668
|
-
totalLatencyMs: number;
|
|
1669
|
-
} | null;
|
|
1670
|
-
traceId: string | null;
|
|
1671
|
-
spanId: string | null;
|
|
1672
|
-
parentSpanId: string | null;
|
|
1673
|
-
sessionId: string | null;
|
|
1674
|
-
} | undefined>;
|
|
1675
|
-
/**
|
|
1676
|
-
* List LLM requests with filtering and pagination
|
|
1677
|
-
* Returns data and total count for pagination
|
|
1678
|
-
*/
|
|
1679
|
-
listRequests: (params?: z$1.infer<typeof listRequestsSchema>) => Promise<{
|
|
1680
|
-
data: {
|
|
1681
|
-
id: string;
|
|
1682
|
-
createdAt: Date;
|
|
1683
|
-
updatedAt: Date;
|
|
1684
|
-
variantId: string | null;
|
|
1685
|
-
provider: string;
|
|
1686
|
-
environmentId: string | null;
|
|
1687
|
-
configId: string | null;
|
|
1688
|
-
providerConfigId: string | null;
|
|
1689
|
-
latencyMs: number;
|
|
1690
|
-
promptTokens: number;
|
|
1691
|
-
completionTokens: number;
|
|
1692
|
-
totalTokens: number;
|
|
1693
|
-
cost: number;
|
|
1694
|
-
requestId: string;
|
|
1695
|
-
model: string;
|
|
1696
|
-
cachedTokens: number;
|
|
1697
|
-
cacheCreationTokens: number;
|
|
1698
|
-
cacheSavings: number;
|
|
1699
|
-
inputCost: number;
|
|
1700
|
-
outputCost: number;
|
|
1701
|
-
endpoint: string;
|
|
1702
|
-
statusCode: number;
|
|
1703
|
-
isStreaming: boolean;
|
|
1704
|
-
userId: string | null;
|
|
1705
|
-
tags: Record<string, string>;
|
|
1706
|
-
guardrailResults: {
|
|
1707
|
-
results: {
|
|
1708
|
-
checkId: string;
|
|
1709
|
-
functionId: string;
|
|
1710
|
-
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
1711
|
-
verdict: boolean;
|
|
1712
|
-
latencyMs: number;
|
|
1713
|
-
}[];
|
|
1714
|
-
action: "allowed" | "blocked" | "logged";
|
|
1715
|
-
totalLatencyMs: number;
|
|
1716
|
-
} | null;
|
|
1717
|
-
traceId: string | null;
|
|
1718
|
-
spanId: string | null;
|
|
1719
|
-
parentSpanId: string | null;
|
|
1720
|
-
sessionId: string | null;
|
|
1721
|
-
}[];
|
|
1722
|
-
total: number;
|
|
1723
|
-
limit: number;
|
|
1724
|
-
offset: number;
|
|
1725
|
-
}>;
|
|
1726
|
-
/**
|
|
1727
|
-
* Get a single request by requestId
|
|
1728
|
-
*/
|
|
1729
|
-
getRequestByRequestId: (requestId: string) => Promise<{
|
|
1730
|
-
id: string;
|
|
1731
|
-
createdAt: Date;
|
|
1732
|
-
updatedAt: Date;
|
|
1733
|
-
variantId: string | null;
|
|
1734
|
-
provider: string;
|
|
1735
|
-
environmentId: string | null;
|
|
1736
|
-
configId: string | null;
|
|
1737
|
-
providerConfigId: string | null;
|
|
1738
|
-
latencyMs: number;
|
|
1739
|
-
promptTokens: number;
|
|
1740
|
-
completionTokens: number;
|
|
1741
|
-
totalTokens: number;
|
|
1742
|
-
cost: number;
|
|
1743
|
-
requestId: string;
|
|
1744
|
-
model: string;
|
|
1745
|
-
cachedTokens: number;
|
|
1746
|
-
cacheCreationTokens: number;
|
|
1747
|
-
cacheSavings: number;
|
|
1748
|
-
inputCost: number;
|
|
1749
|
-
outputCost: number;
|
|
1750
|
-
endpoint: string;
|
|
1751
|
-
statusCode: number;
|
|
1752
|
-
isStreaming: boolean;
|
|
1753
|
-
userId: string | null;
|
|
1754
|
-
tags: Record<string, string>;
|
|
1755
|
-
guardrailResults: {
|
|
1756
|
-
results: {
|
|
1757
|
-
checkId: string;
|
|
1758
|
-
functionId: string;
|
|
1759
|
-
hookType: "beforeRequestHook" | "afterRequestHook";
|
|
1760
|
-
verdict: boolean;
|
|
1761
|
-
latencyMs: number;
|
|
1762
|
-
}[];
|
|
1763
|
-
action: "allowed" | "blocked" | "logged";
|
|
1764
|
-
totalLatencyMs: number;
|
|
1765
|
-
} | null;
|
|
1766
|
-
traceId: string | null;
|
|
1767
|
-
spanId: string | null;
|
|
1768
|
-
parentSpanId: string | null;
|
|
1769
|
-
sessionId: string | null;
|
|
1770
|
-
} | undefined>;
|
|
1771
|
-
/**
|
|
1772
|
-
* Get total cost for a date range with optional filters
|
|
1773
|
-
*/
|
|
1774
|
-
getTotalCost: (params: z$1.infer<typeof dateRangeSchema>) => Promise<{
|
|
1775
|
-
totalCost: number;
|
|
1776
|
-
totalInputCost: number;
|
|
1777
|
-
totalOutputCost: number;
|
|
1778
|
-
totalPromptTokens: number;
|
|
1779
|
-
totalCompletionTokens: number;
|
|
1780
|
-
totalTokens: number;
|
|
1781
|
-
totalCachedTokens: number;
|
|
1782
|
-
totalCacheSavings: number;
|
|
1783
|
-
requestCount: number;
|
|
1784
|
-
} | undefined>;
|
|
1785
|
-
/**
|
|
1786
|
-
* Get cost breakdown by model
|
|
1787
|
-
*/
|
|
1788
|
-
getCostByModel: (params: z$1.infer<typeof dateRangeSchema>) => Promise<{
|
|
1789
|
-
provider: string;
|
|
1790
|
-
model: string;
|
|
1791
|
-
totalCost: number;
|
|
1792
|
-
totalInputCost: number;
|
|
1793
|
-
totalOutputCost: number;
|
|
1794
|
-
totalTokens: number;
|
|
1795
|
-
requestCount: number;
|
|
1796
|
-
avgLatencyMs: number;
|
|
1797
|
-
}[]>;
|
|
1798
|
-
/**
|
|
1799
|
-
* Get cost breakdown by provider
|
|
1800
|
-
*/
|
|
1801
|
-
getCostByProvider: (params: z$1.infer<typeof dateRangeSchema>) => Promise<{
|
|
1802
|
-
provider: string;
|
|
1803
|
-
totalCost: number;
|
|
1804
|
-
totalInputCost: number;
|
|
1805
|
-
totalOutputCost: number;
|
|
1806
|
-
totalTokens: number;
|
|
1807
|
-
requestCount: number;
|
|
1808
|
-
avgLatencyMs: number;
|
|
1809
|
-
}[]>;
|
|
1810
|
-
/**
|
|
1811
|
-
* Get daily cost summary
|
|
1812
|
-
*/
|
|
1813
|
-
getDailyCosts: (params: z$1.infer<typeof dateRangeSchema>) => Promise<{
|
|
1814
|
-
totalCost: number;
|
|
1815
|
-
totalInputCost: number;
|
|
1816
|
-
totalOutputCost: number;
|
|
1817
|
-
totalTokens: number;
|
|
1818
|
-
requestCount: number;
|
|
1819
|
-
date: string;
|
|
1820
|
-
}[]>;
|
|
1821
|
-
/**
|
|
1822
|
-
* Get cost summary with flexible grouping and optional filters
|
|
1823
|
-
*/
|
|
1824
|
-
getCostSummary: (params: z$1.infer<typeof costSummarySchema>) => Promise<{
|
|
1825
|
-
totalCost: number;
|
|
1826
|
-
requestCount: number;
|
|
1827
|
-
groupKey: string;
|
|
1828
|
-
}[]>;
|
|
1829
|
-
/**
|
|
1830
|
-
* Get request count and stats for a time range with optional filters
|
|
1831
|
-
*/
|
|
1832
|
-
getRequestStats: (params: z$1.infer<typeof dateRangeSchema>) => Promise<{
|
|
1833
|
-
avgLatencyMs: number;
|
|
1834
|
-
totalRequests: number;
|
|
1835
|
-
successfulRequests: number;
|
|
1836
|
-
failedRequests: number;
|
|
1837
|
-
streamingRequests: number;
|
|
1838
|
-
maxLatencyMs: number;
|
|
1839
|
-
minLatencyMs: number;
|
|
1840
|
-
} | undefined>;
|
|
1841
|
-
/**
|
|
1842
|
-
* Get all distinct tag key-value pairs from llm_requests
|
|
1843
|
-
* Used for populating tag filter dropdowns in the UI
|
|
1844
|
-
*/
|
|
1845
|
-
getDistinctTags: () => Promise<{
|
|
1846
|
-
key: string;
|
|
1847
|
-
value: string;
|
|
1848
|
-
}[]>;
|
|
1849
|
-
};
|
|
1850
|
-
//#endregion
|
|
1851
|
-
//#region src/datalayer/playgrounds.d.ts
|
|
1852
|
-
declare const createNewPlayground: z$1.ZodObject<{
|
|
1853
|
-
name: z$1.ZodString;
|
|
1854
|
-
datasetId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1855
|
-
columns: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodArray<z$1.ZodObject<{
|
|
1856
|
-
id: z$1.ZodString;
|
|
1857
|
-
name: z$1.ZodString;
|
|
1858
|
-
position: z$1.ZodNumber;
|
|
1859
|
-
providerConfigId: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodNull]>;
|
|
1860
|
-
modelName: z$1.ZodString;
|
|
1861
|
-
messages: z$1.ZodArray<z$1.ZodObject<{
|
|
1862
|
-
role: z$1.ZodEnum<{
|
|
1863
|
-
system: "system";
|
|
1864
|
-
user: "user";
|
|
1865
|
-
assistant: "assistant";
|
|
1866
|
-
}>;
|
|
1867
|
-
content: z$1.ZodString;
|
|
1868
|
-
}, z$1.core.$strip>>;
|
|
1869
|
-
temperature: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
1870
|
-
maxTokens: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
1871
|
-
topP: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
1872
|
-
frequencyPenalty: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
1873
|
-
presencePenalty: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
1874
|
-
configId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1875
|
-
variantId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1876
|
-
variantVersionId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1877
|
-
}, z$1.core.$strip>>>>;
|
|
1878
|
-
}, z$1.core.$strip>;
|
|
1879
|
-
declare const updatePlayground: z$1.ZodObject<{
|
|
1880
|
-
playgroundId: z$1.ZodUUID;
|
|
1881
|
-
name: z$1.ZodOptional<z$1.ZodString>;
|
|
1882
|
-
datasetId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1883
|
-
columns: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodArray<z$1.ZodObject<{
|
|
1884
|
-
id: z$1.ZodString;
|
|
1885
|
-
name: z$1.ZodString;
|
|
1886
|
-
position: z$1.ZodNumber;
|
|
1887
|
-
providerConfigId: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodNull]>;
|
|
1888
|
-
modelName: z$1.ZodString;
|
|
1889
|
-
messages: z$1.ZodArray<z$1.ZodObject<{
|
|
1890
|
-
role: z$1.ZodEnum<{
|
|
1891
|
-
system: "system";
|
|
1892
|
-
user: "user";
|
|
1893
|
-
assistant: "assistant";
|
|
1894
|
-
}>;
|
|
1895
|
-
content: z$1.ZodString;
|
|
1896
|
-
}, z$1.core.$strip>>;
|
|
1897
|
-
temperature: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
1898
|
-
maxTokens: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
1899
|
-
topP: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
1900
|
-
frequencyPenalty: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
1901
|
-
presencePenalty: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
1902
|
-
configId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1903
|
-
variantId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1904
|
-
variantVersionId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
1905
|
-
}, z$1.core.$strip>>>>;
|
|
1906
|
-
}, z$1.core.$strip>;
|
|
1907
|
-
declare const getPlaygroundById: z$1.ZodObject<{
|
|
1908
|
-
playgroundId: z$1.ZodUUID;
|
|
1909
|
-
}, z$1.core.$strip>;
|
|
1910
|
-
declare const deletePlayground: z$1.ZodObject<{
|
|
1911
|
-
playgroundId: z$1.ZodUUID;
|
|
1912
|
-
}, z$1.core.$strip>;
|
|
1913
|
-
declare const listPlaygrounds: z$1.ZodObject<{
|
|
1914
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1915
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1916
|
-
}, z$1.core.$strip>;
|
|
1917
|
-
declare const createPlaygroundDataLayer: (db: Kysely<Database>) => {
|
|
1918
|
-
createNewPlayground: (params: z$1.infer<typeof createNewPlayground>) => Promise<{
|
|
1919
|
-
name: string;
|
|
1920
|
-
id: string;
|
|
1921
|
-
createdAt: Date;
|
|
1922
|
-
updatedAt: Date;
|
|
1923
|
-
datasetId: string | null;
|
|
1924
|
-
columns: {
|
|
1925
|
-
id: string;
|
|
1926
|
-
name: string;
|
|
1927
|
-
position: number;
|
|
1928
|
-
providerConfigId: string | null;
|
|
1929
|
-
modelName: string;
|
|
1930
|
-
messages: {
|
|
1931
|
-
role: "system" | "user" | "assistant";
|
|
1932
|
-
content: string;
|
|
1933
|
-
}[];
|
|
1934
|
-
temperature?: number | null | undefined;
|
|
1935
|
-
maxTokens?: number | null | undefined;
|
|
1936
|
-
topP?: number | null | undefined;
|
|
1937
|
-
frequencyPenalty?: number | null | undefined;
|
|
1938
|
-
presencePenalty?: number | null | undefined;
|
|
1939
|
-
configId?: string | null | undefined;
|
|
1940
|
-
variantId?: string | null | undefined;
|
|
1941
|
-
variantVersionId?: string | null | undefined;
|
|
1942
|
-
}[] | null;
|
|
1943
|
-
} | undefined>;
|
|
1944
|
-
updatePlayground: (params: z$1.infer<typeof updatePlayground>) => Promise<{
|
|
1945
|
-
name: string;
|
|
1946
|
-
id: string;
|
|
1947
|
-
createdAt: Date;
|
|
1948
|
-
updatedAt: Date;
|
|
1949
|
-
datasetId: string | null;
|
|
1950
|
-
columns: {
|
|
1951
|
-
id: string;
|
|
1952
|
-
name: string;
|
|
1953
|
-
position: number;
|
|
1954
|
-
providerConfigId: string | null;
|
|
1955
|
-
modelName: string;
|
|
1956
|
-
messages: {
|
|
1957
|
-
role: "system" | "user" | "assistant";
|
|
1958
|
-
content: string;
|
|
1959
|
-
}[];
|
|
1960
|
-
temperature?: number | null | undefined;
|
|
1961
|
-
maxTokens?: number | null | undefined;
|
|
1962
|
-
topP?: number | null | undefined;
|
|
1963
|
-
frequencyPenalty?: number | null | undefined;
|
|
1964
|
-
presencePenalty?: number | null | undefined;
|
|
1965
|
-
configId?: string | null | undefined;
|
|
1966
|
-
variantId?: string | null | undefined;
|
|
1967
|
-
variantVersionId?: string | null | undefined;
|
|
1968
|
-
}[] | null;
|
|
1969
|
-
} | undefined>;
|
|
1970
|
-
getPlaygroundById: (params: z$1.infer<typeof getPlaygroundById>) => Promise<{
|
|
1971
|
-
name: string;
|
|
1972
|
-
id: string;
|
|
1973
|
-
createdAt: Date;
|
|
1974
|
-
updatedAt: Date;
|
|
1975
|
-
datasetId: string | null;
|
|
1976
|
-
columns: {
|
|
1977
|
-
id: string;
|
|
1978
|
-
name: string;
|
|
1979
|
-
position: number;
|
|
1980
|
-
providerConfigId: string | null;
|
|
1981
|
-
modelName: string;
|
|
1982
|
-
messages: {
|
|
1983
|
-
role: "system" | "user" | "assistant";
|
|
1984
|
-
content: string;
|
|
1985
|
-
}[];
|
|
1986
|
-
temperature?: number | null | undefined;
|
|
1987
|
-
maxTokens?: number | null | undefined;
|
|
1988
|
-
topP?: number | null | undefined;
|
|
1989
|
-
frequencyPenalty?: number | null | undefined;
|
|
1990
|
-
presencePenalty?: number | null | undefined;
|
|
1991
|
-
configId?: string | null | undefined;
|
|
1992
|
-
variantId?: string | null | undefined;
|
|
1993
|
-
variantVersionId?: string | null | undefined;
|
|
1994
|
-
}[] | null;
|
|
1995
|
-
} | undefined>;
|
|
1996
|
-
deletePlayground: (params: z$1.infer<typeof deletePlayground>) => Promise<{
|
|
1997
|
-
name: string;
|
|
1998
|
-
id: string;
|
|
1999
|
-
createdAt: Date;
|
|
2000
|
-
updatedAt: Date;
|
|
2001
|
-
datasetId: string | null;
|
|
2002
|
-
columns: {
|
|
2003
|
-
id: string;
|
|
2004
|
-
name: string;
|
|
2005
|
-
position: number;
|
|
2006
|
-
providerConfigId: string | null;
|
|
2007
|
-
modelName: string;
|
|
2008
|
-
messages: {
|
|
2009
|
-
role: "system" | "user" | "assistant";
|
|
2010
|
-
content: string;
|
|
2011
|
-
}[];
|
|
2012
|
-
temperature?: number | null | undefined;
|
|
2013
|
-
maxTokens?: number | null | undefined;
|
|
2014
|
-
topP?: number | null | undefined;
|
|
2015
|
-
frequencyPenalty?: number | null | undefined;
|
|
2016
|
-
presencePenalty?: number | null | undefined;
|
|
2017
|
-
configId?: string | null | undefined;
|
|
2018
|
-
variantId?: string | null | undefined;
|
|
2019
|
-
variantVersionId?: string | null | undefined;
|
|
2020
|
-
}[] | null;
|
|
2021
|
-
} | undefined>;
|
|
2022
|
-
listPlaygrounds: (params?: z$1.infer<typeof listPlaygrounds>) => Promise<{
|
|
2023
|
-
name: string;
|
|
2024
|
-
id: string;
|
|
2025
|
-
createdAt: Date;
|
|
2026
|
-
updatedAt: Date;
|
|
2027
|
-
datasetId: string | null;
|
|
2028
|
-
columns: {
|
|
2029
|
-
id: string;
|
|
2030
|
-
name: string;
|
|
2031
|
-
position: number;
|
|
2032
|
-
providerConfigId: string | null;
|
|
2033
|
-
modelName: string;
|
|
2034
|
-
messages: {
|
|
2035
|
-
role: "system" | "user" | "assistant";
|
|
2036
|
-
content: string;
|
|
2037
|
-
}[];
|
|
2038
|
-
temperature?: number | null | undefined;
|
|
2039
|
-
maxTokens?: number | null | undefined;
|
|
2040
|
-
topP?: number | null | undefined;
|
|
2041
|
-
frequencyPenalty?: number | null | undefined;
|
|
2042
|
-
presencePenalty?: number | null | undefined;
|
|
2043
|
-
configId?: string | null | undefined;
|
|
2044
|
-
variantId?: string | null | undefined;
|
|
2045
|
-
variantVersionId?: string | null | undefined;
|
|
2046
|
-
}[] | null;
|
|
2047
|
-
}[]>;
|
|
2048
|
-
countPlaygrounds: () => Promise<number>;
|
|
2049
|
-
};
|
|
2050
|
-
//#endregion
|
|
2051
|
-
//#region src/datalayer/playgroundResults.d.ts
|
|
2052
|
-
declare const createPlaygroundResult: z$1.ZodObject<{
|
|
2053
|
-
runId: z$1.ZodString;
|
|
2054
|
-
columnId: z$1.ZodString;
|
|
2055
|
-
datasetRecordId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2056
|
-
inputVariables: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
2057
|
-
status: z$1.ZodDefault<z$1.ZodEnum<{
|
|
2058
|
-
pending: "pending";
|
|
2059
|
-
running: "running";
|
|
2060
|
-
completed: "completed";
|
|
2061
|
-
failed: "failed";
|
|
2062
|
-
}>>;
|
|
2063
|
-
}, z$1.core.$strip>;
|
|
2064
|
-
declare const createPlaygroundResultsBatch: z$1.ZodObject<{
|
|
2065
|
-
results: z$1.ZodArray<z$1.ZodObject<{
|
|
2066
|
-
runId: z$1.ZodString;
|
|
2067
|
-
columnId: z$1.ZodString;
|
|
2068
|
-
datasetRecordId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2069
|
-
inputVariables: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
2070
|
-
status: z$1.ZodDefault<z$1.ZodEnum<{
|
|
2071
|
-
pending: "pending";
|
|
2072
|
-
running: "running";
|
|
2073
|
-
completed: "completed";
|
|
2074
|
-
failed: "failed";
|
|
2075
|
-
}>>;
|
|
2076
|
-
}, z$1.core.$strip>>;
|
|
2077
|
-
}, z$1.core.$strip>;
|
|
2078
|
-
declare const updatePlaygroundResult: z$1.ZodObject<{
|
|
2079
|
-
resultId: z$1.ZodString;
|
|
2080
|
-
outputContent: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2081
|
-
status: z$1.ZodOptional<z$1.ZodEnum<{
|
|
2082
|
-
pending: "pending";
|
|
2083
|
-
running: "running";
|
|
2084
|
-
completed: "completed";
|
|
2085
|
-
failed: "failed";
|
|
2086
|
-
}>>;
|
|
2087
|
-
error: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2088
|
-
latencyMs: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2089
|
-
promptTokens: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2090
|
-
completionTokens: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2091
|
-
totalTokens: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2092
|
-
cost: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2093
|
-
}, z$1.core.$strip>;
|
|
2094
|
-
declare const getPlaygroundResultById: z$1.ZodObject<{
|
|
2095
|
-
resultId: z$1.ZodString;
|
|
2096
|
-
}, z$1.core.$strip>;
|
|
2097
|
-
declare const listPlaygroundResults: z$1.ZodObject<{
|
|
2098
|
-
runId: z$1.ZodString;
|
|
2099
|
-
columnId: z$1.ZodOptional<z$1.ZodString>;
|
|
2100
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2101
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2102
|
-
}, z$1.core.$strip>;
|
|
2103
|
-
declare const deletePlaygroundResultsByRunId: z$1.ZodObject<{
|
|
2104
|
-
runId: z$1.ZodString;
|
|
2105
|
-
}, z$1.core.$strip>;
|
|
2106
|
-
declare const createPlaygroundResultsDataLayer: (db: Kysely<Database>) => {
|
|
2107
|
-
createPlaygroundResult: (params: z$1.infer<typeof createPlaygroundResult>) => Promise<{
|
|
2108
|
-
error: string | null;
|
|
2109
|
-
id: string;
|
|
2110
|
-
createdAt: Date;
|
|
2111
|
-
updatedAt: Date;
|
|
2112
|
-
status: string;
|
|
2113
|
-
runId: string;
|
|
2114
|
-
columnId: string;
|
|
2115
|
-
datasetRecordId: string | null;
|
|
2116
|
-
inputVariables: Record<string, unknown>;
|
|
2117
|
-
outputContent: string | null;
|
|
2118
|
-
latencyMs: number | null;
|
|
2119
|
-
promptTokens: number | null;
|
|
2120
|
-
completionTokens: number | null;
|
|
2121
|
-
totalTokens: number | null;
|
|
2122
|
-
cost: number | null;
|
|
2123
|
-
} | undefined>;
|
|
2124
|
-
createPlaygroundResultsBatch: (params: z$1.infer<typeof createPlaygroundResultsBatch>) => Promise<{
|
|
2125
|
-
error: string | null;
|
|
2126
|
-
id: string;
|
|
2127
|
-
createdAt: Date;
|
|
2128
|
-
updatedAt: Date;
|
|
2129
|
-
status: string;
|
|
2130
|
-
runId: string;
|
|
2131
|
-
columnId: string;
|
|
2132
|
-
datasetRecordId: string | null;
|
|
2133
|
-
inputVariables: Record<string, unknown>;
|
|
2134
|
-
outputContent: string | null;
|
|
2135
|
-
latencyMs: number | null;
|
|
2136
|
-
promptTokens: number | null;
|
|
2137
|
-
completionTokens: number | null;
|
|
2138
|
-
totalTokens: number | null;
|
|
2139
|
-
cost: number | null;
|
|
2140
|
-
}[]>;
|
|
2141
|
-
updatePlaygroundResult: (params: z$1.infer<typeof updatePlaygroundResult>) => Promise<{
|
|
2142
|
-
error: string | null;
|
|
2143
|
-
id: string;
|
|
2144
|
-
createdAt: Date;
|
|
2145
|
-
updatedAt: Date;
|
|
2146
|
-
status: string;
|
|
2147
|
-
runId: string;
|
|
2148
|
-
columnId: string;
|
|
2149
|
-
datasetRecordId: string | null;
|
|
2150
|
-
inputVariables: Record<string, unknown>;
|
|
2151
|
-
outputContent: string | null;
|
|
2152
|
-
latencyMs: number | null;
|
|
2153
|
-
promptTokens: number | null;
|
|
2154
|
-
completionTokens: number | null;
|
|
2155
|
-
totalTokens: number | null;
|
|
2156
|
-
cost: number | null;
|
|
2157
|
-
} | undefined>;
|
|
2158
|
-
getPlaygroundResultById: (params: z$1.infer<typeof getPlaygroundResultById>) => Promise<{
|
|
2159
|
-
error: string | null;
|
|
2160
|
-
id: string;
|
|
2161
|
-
createdAt: Date;
|
|
2162
|
-
updatedAt: Date;
|
|
2163
|
-
status: string;
|
|
2164
|
-
runId: string;
|
|
2165
|
-
columnId: string;
|
|
2166
|
-
datasetRecordId: string | null;
|
|
2167
|
-
inputVariables: Record<string, unknown>;
|
|
2168
|
-
outputContent: string | null;
|
|
2169
|
-
latencyMs: number | null;
|
|
2170
|
-
promptTokens: number | null;
|
|
2171
|
-
completionTokens: number | null;
|
|
2172
|
-
totalTokens: number | null;
|
|
2173
|
-
cost: number | null;
|
|
2174
|
-
} | undefined>;
|
|
2175
|
-
listPlaygroundResults: (params: z$1.infer<typeof listPlaygroundResults>) => Promise<{
|
|
2176
|
-
error: string | null;
|
|
2177
|
-
id: string;
|
|
2178
|
-
createdAt: Date;
|
|
2179
|
-
updatedAt: Date;
|
|
2180
|
-
status: string;
|
|
2181
|
-
runId: string;
|
|
2182
|
-
columnId: string;
|
|
2183
|
-
datasetRecordId: string | null;
|
|
2184
|
-
inputVariables: Record<string, unknown>;
|
|
2185
|
-
outputContent: string | null;
|
|
2186
|
-
latencyMs: number | null;
|
|
2187
|
-
promptTokens: number | null;
|
|
2188
|
-
completionTokens: number | null;
|
|
2189
|
-
totalTokens: number | null;
|
|
2190
|
-
cost: number | null;
|
|
2191
|
-
}[]>;
|
|
2192
|
-
deletePlaygroundResultsByRunId: (params: z$1.infer<typeof deletePlaygroundResultsByRunId>) => Promise<{
|
|
2193
|
-
error: string | null;
|
|
2194
|
-
id: string;
|
|
2195
|
-
createdAt: Date;
|
|
2196
|
-
updatedAt: Date;
|
|
2197
|
-
status: string;
|
|
2198
|
-
runId: string;
|
|
2199
|
-
columnId: string;
|
|
2200
|
-
datasetRecordId: string | null;
|
|
2201
|
-
inputVariables: Record<string, unknown>;
|
|
2202
|
-
outputContent: string | null;
|
|
2203
|
-
latencyMs: number | null;
|
|
2204
|
-
promptTokens: number | null;
|
|
2205
|
-
completionTokens: number | null;
|
|
2206
|
-
totalTokens: number | null;
|
|
2207
|
-
cost: number | null;
|
|
2208
|
-
}[]>;
|
|
2209
|
-
countPlaygroundResults: (runId: string) => Promise<number>;
|
|
2210
|
-
countCompletedPlaygroundResults: (runId: string) => Promise<number>;
|
|
2211
|
-
};
|
|
2212
|
-
//#endregion
|
|
2213
|
-
//#region src/datalayer/playgroundRuns.d.ts
|
|
2214
|
-
declare const createPlaygroundRun: z$1.ZodObject<{
|
|
2215
|
-
playgroundId: z$1.ZodString;
|
|
2216
|
-
datasetId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2217
|
-
datasetVersionId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2218
|
-
status: z$1.ZodDefault<z$1.ZodEnum<{
|
|
2219
|
-
pending: "pending";
|
|
2220
|
-
running: "running";
|
|
2221
|
-
completed: "completed";
|
|
2222
|
-
failed: "failed";
|
|
2223
|
-
cancelled: "cancelled";
|
|
2224
|
-
}>>;
|
|
2225
|
-
totalRecords: z$1.ZodDefault<z$1.ZodNumber>;
|
|
2226
|
-
}, z$1.core.$strip>;
|
|
2227
|
-
declare const updatePlaygroundRun: z$1.ZodObject<{
|
|
2228
|
-
runId: z$1.ZodString;
|
|
2229
|
-
status: z$1.ZodOptional<z$1.ZodEnum<{
|
|
2230
|
-
pending: "pending";
|
|
2231
|
-
running: "running";
|
|
2232
|
-
completed: "completed";
|
|
2233
|
-
failed: "failed";
|
|
2234
|
-
cancelled: "cancelled";
|
|
2235
|
-
}>>;
|
|
2236
|
-
startedAt: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodDate>>;
|
|
2237
|
-
completedAt: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodDate>>;
|
|
2238
|
-
completedRecords: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2239
|
-
}, z$1.core.$strip>;
|
|
2240
|
-
declare const getPlaygroundRunById: z$1.ZodObject<{
|
|
2241
|
-
runId: z$1.ZodString;
|
|
2242
|
-
}, z$1.core.$strip>;
|
|
2243
|
-
declare const listPlaygroundRuns: z$1.ZodObject<{
|
|
2244
|
-
playgroundId: z$1.ZodString;
|
|
2245
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2246
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2247
|
-
}, z$1.core.$strip>;
|
|
2248
|
-
declare const deletePlaygroundRun: z$1.ZodObject<{
|
|
2249
|
-
runId: z$1.ZodString;
|
|
2250
|
-
}, z$1.core.$strip>;
|
|
2251
|
-
declare const createPlaygroundRunsDataLayer: (db: Kysely<Database>) => {
|
|
2252
|
-
createPlaygroundRun: (params: z$1.infer<typeof createPlaygroundRun>) => Promise<{
|
|
2253
|
-
id: string;
|
|
2254
|
-
createdAt: Date;
|
|
2255
|
-
updatedAt: Date;
|
|
2256
|
-
datasetId: string | null;
|
|
2257
|
-
playgroundId: string;
|
|
2258
|
-
datasetVersionId: string | null;
|
|
2259
|
-
status: string;
|
|
2260
|
-
startedAt: Date | null;
|
|
2261
|
-
completedAt: Date | null;
|
|
2262
|
-
totalRecords: number;
|
|
2263
|
-
completedRecords: number;
|
|
2264
|
-
} | undefined>;
|
|
2265
|
-
updatePlaygroundRun: (params: z$1.infer<typeof updatePlaygroundRun>) => Promise<{
|
|
2266
|
-
id: string;
|
|
2267
|
-
createdAt: Date;
|
|
2268
|
-
updatedAt: Date;
|
|
2269
|
-
datasetId: string | null;
|
|
2270
|
-
playgroundId: string;
|
|
2271
|
-
datasetVersionId: string | null;
|
|
2272
|
-
status: string;
|
|
2273
|
-
startedAt: Date | null;
|
|
2274
|
-
completedAt: Date | null;
|
|
2275
|
-
totalRecords: number;
|
|
2276
|
-
completedRecords: number;
|
|
2277
|
-
} | undefined>;
|
|
2278
|
-
getPlaygroundRunById: (params: z$1.infer<typeof getPlaygroundRunById>) => Promise<{
|
|
2279
|
-
id: string;
|
|
2280
|
-
createdAt: Date;
|
|
2281
|
-
updatedAt: Date;
|
|
2282
|
-
datasetId: string | null;
|
|
2283
|
-
playgroundId: string;
|
|
2284
|
-
datasetVersionId: string | null;
|
|
2285
|
-
status: string;
|
|
2286
|
-
startedAt: Date | null;
|
|
2287
|
-
completedAt: Date | null;
|
|
2288
|
-
totalRecords: number;
|
|
2289
|
-
completedRecords: number;
|
|
2290
|
-
} | undefined>;
|
|
2291
|
-
listPlaygroundRuns: (params: z$1.infer<typeof listPlaygroundRuns>) => Promise<{
|
|
2292
|
-
id: string;
|
|
2293
|
-
createdAt: Date;
|
|
2294
|
-
updatedAt: Date;
|
|
2295
|
-
datasetId: string | null;
|
|
2296
|
-
playgroundId: string;
|
|
2297
|
-
datasetVersionId: string | null;
|
|
2298
|
-
status: string;
|
|
2299
|
-
startedAt: Date | null;
|
|
2300
|
-
completedAt: Date | null;
|
|
2301
|
-
totalRecords: number;
|
|
2302
|
-
completedRecords: number;
|
|
2303
|
-
}[]>;
|
|
2304
|
-
deletePlaygroundRun: (params: z$1.infer<typeof deletePlaygroundRun>) => Promise<{
|
|
2305
|
-
id: string;
|
|
2306
|
-
createdAt: Date;
|
|
2307
|
-
updatedAt: Date;
|
|
2308
|
-
datasetId: string | null;
|
|
2309
|
-
playgroundId: string;
|
|
2310
|
-
datasetVersionId: string | null;
|
|
2311
|
-
status: string;
|
|
2312
|
-
startedAt: Date | null;
|
|
2313
|
-
completedAt: Date | null;
|
|
2314
|
-
totalRecords: number;
|
|
2315
|
-
completedRecords: number;
|
|
2316
|
-
} | undefined>;
|
|
2317
|
-
countPlaygroundRuns: (playgroundId: string) => Promise<number>;
|
|
2318
|
-
};
|
|
2319
|
-
//#endregion
|
|
2320
|
-
//#region src/datalayer/providerConfigs.d.ts
|
|
2321
|
-
declare const createProviderConfig: z$1.ZodObject<{
|
|
2322
|
-
providerId: z$1.ZodString;
|
|
2323
|
-
slug: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2324
|
-
name: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2325
|
-
config: z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>;
|
|
2326
|
-
enabled: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
2327
|
-
}, z$1.core.$strip>;
|
|
2328
|
-
declare const updateProviderConfig: z$1.ZodObject<{
|
|
2329
|
-
id: z$1.ZodUUID;
|
|
2330
|
-
slug: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2331
|
-
name: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2332
|
-
config: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
2333
|
-
enabled: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
2334
|
-
}, z$1.core.$strip>;
|
|
2335
|
-
declare const getProviderConfigById: z$1.ZodObject<{
|
|
2336
|
-
id: z$1.ZodUUID;
|
|
2337
|
-
}, z$1.core.$strip>;
|
|
2338
|
-
declare const getProviderConfigByProviderId: z$1.ZodObject<{
|
|
2339
|
-
providerId: z$1.ZodString;
|
|
2340
|
-
}, z$1.core.$strip>;
|
|
2341
|
-
declare const getProviderConfigBySlug: z$1.ZodObject<{
|
|
2342
|
-
slug: z$1.ZodString;
|
|
2343
|
-
}, z$1.core.$strip>;
|
|
2344
|
-
declare const deleteProviderConfig: z$1.ZodObject<{
|
|
2345
|
-
id: z$1.ZodUUID;
|
|
2346
|
-
}, z$1.core.$strip>;
|
|
2347
|
-
declare const listProviderConfigs: z$1.ZodObject<{
|
|
2348
|
-
limit: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2349
|
-
offset: z$1.ZodOptional<z$1.ZodNumber>;
|
|
2350
|
-
}, z$1.core.$strip>;
|
|
2351
|
-
declare const createProviderConfigsDataLayer: (db: Kysely<Database>) => {
|
|
2352
|
-
createProviderConfig: (params: z$1.infer<typeof createProviderConfig>) => Promise<{
|
|
2353
|
-
slug: string | null;
|
|
2354
|
-
name: string | null;
|
|
2355
|
-
id: string;
|
|
2356
|
-
createdAt: Date;
|
|
2357
|
-
updatedAt: Date;
|
|
2358
|
-
enabled: boolean;
|
|
2359
|
-
providerId: string;
|
|
2360
|
-
config: Record<string, unknown>;
|
|
2361
|
-
} | undefined>;
|
|
2362
|
-
updateProviderConfig: (params: z$1.infer<typeof updateProviderConfig>) => Promise<{
|
|
2363
|
-
slug: string | null;
|
|
2364
|
-
name: string | null;
|
|
2365
|
-
id: string;
|
|
2366
|
-
createdAt: Date;
|
|
2367
|
-
updatedAt: Date;
|
|
2368
|
-
enabled: boolean;
|
|
2369
|
-
providerId: string;
|
|
2370
|
-
config: Record<string, unknown>;
|
|
2371
|
-
} | undefined>;
|
|
2372
|
-
getProviderConfigById: (params: z$1.infer<typeof getProviderConfigById>) => Promise<{
|
|
2373
|
-
slug: string | null;
|
|
2374
|
-
name: string | null;
|
|
2375
|
-
id: string;
|
|
2376
|
-
createdAt: Date;
|
|
2377
|
-
updatedAt: Date;
|
|
2378
|
-
enabled: boolean;
|
|
2379
|
-
providerId: string;
|
|
2380
|
-
config: Record<string, unknown>;
|
|
2381
|
-
} | undefined>;
|
|
2382
|
-
getProviderConfigByProviderId: (params: z$1.infer<typeof getProviderConfigByProviderId>) => Promise<{
|
|
2383
|
-
slug: string | null;
|
|
2384
|
-
name: string | null;
|
|
2385
|
-
id: string;
|
|
2386
|
-
createdAt: Date;
|
|
2387
|
-
updatedAt: Date;
|
|
2388
|
-
enabled: boolean;
|
|
2389
|
-
providerId: string;
|
|
2390
|
-
config: Record<string, unknown>;
|
|
2391
|
-
} | undefined>;
|
|
2392
|
-
getProviderConfigBySlug: (params: z$1.infer<typeof getProviderConfigBySlug>) => Promise<{
|
|
2393
|
-
slug: string | null;
|
|
2394
|
-
name: string | null;
|
|
2395
|
-
id: string;
|
|
2396
|
-
createdAt: Date;
|
|
2397
|
-
updatedAt: Date;
|
|
2398
|
-
enabled: boolean;
|
|
2399
|
-
providerId: string;
|
|
2400
|
-
config: Record<string, unknown>;
|
|
2401
|
-
} | undefined>;
|
|
2402
|
-
deleteProviderConfig: (params: z$1.infer<typeof deleteProviderConfig>) => Promise<{
|
|
2403
|
-
slug: string | null;
|
|
2404
|
-
name: string | null;
|
|
2405
|
-
id: string;
|
|
2406
|
-
createdAt: Date;
|
|
2407
|
-
updatedAt: Date;
|
|
2408
|
-
enabled: boolean;
|
|
2409
|
-
providerId: string;
|
|
2410
|
-
config: Record<string, unknown>;
|
|
2411
|
-
} | undefined>;
|
|
2412
|
-
listProviderConfigs: (params?: z$1.infer<typeof listProviderConfigs>) => Promise<{
|
|
2413
|
-
slug: string | null;
|
|
2414
|
-
name: string | null;
|
|
2415
|
-
id: string;
|
|
2416
|
-
createdAt: Date;
|
|
2417
|
-
updatedAt: Date;
|
|
2418
|
-
enabled: boolean;
|
|
2419
|
-
providerId: string;
|
|
2420
|
-
config: Record<string, unknown>;
|
|
2421
|
-
}[]>;
|
|
2422
|
-
countProviderConfigs: () => Promise<number>;
|
|
2423
|
-
/**
|
|
2424
|
-
* Upsert provider config - creates if not exists, updates if exists
|
|
2425
|
-
* Useful for the dashboard UI where you want to set/update a provider config
|
|
2426
|
-
*/
|
|
2427
|
-
upsertProviderConfig: (params: z$1.infer<typeof createProviderConfig>) => Promise<{
|
|
2428
|
-
slug: string | null;
|
|
2429
|
-
name: string | null;
|
|
2430
|
-
id: string;
|
|
2431
|
-
createdAt: Date;
|
|
2432
|
-
updatedAt: Date;
|
|
2433
|
-
enabled: boolean;
|
|
2434
|
-
providerId: string;
|
|
2435
|
-
config: Record<string, unknown>;
|
|
2436
|
-
} | undefined>;
|
|
2437
|
-
};
|
|
2438
|
-
//#endregion
|
|
2439
|
-
//#region src/datalayer/providerGuardrailOverrides.d.ts
|
|
2440
|
-
declare const createProviderGuardrailOverride: z$1.ZodObject<{
|
|
2441
|
-
providerConfigId: z$1.ZodString;
|
|
2442
|
-
guardrailConfigId: z$1.ZodString;
|
|
2443
|
-
enabled: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodBoolean>>;
|
|
2444
|
-
parameters: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
2445
|
-
}, z$1.core.$strip>;
|
|
2446
|
-
declare const updateProviderGuardrailOverride: z$1.ZodObject<{
|
|
2447
|
-
id: z$1.ZodString;
|
|
2448
|
-
enabled: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
2449
|
-
parameters: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>>;
|
|
2450
|
-
}, z$1.core.$strip>;
|
|
2451
|
-
declare const getOverrideById: z$1.ZodObject<{
|
|
2452
|
-
id: z$1.ZodString;
|
|
2453
|
-
}, z$1.core.$strip>;
|
|
2454
|
-
declare const deleteOverride: z$1.ZodObject<{
|
|
2455
|
-
id: z$1.ZodString;
|
|
2456
|
-
}, z$1.core.$strip>;
|
|
2457
|
-
declare const getOverridesByProviderConfigId: z$1.ZodObject<{
|
|
2458
|
-
providerConfigId: z$1.ZodString;
|
|
2459
|
-
}, z$1.core.$strip>;
|
|
2460
|
-
declare const getOverridesByGuardrailConfigId: z$1.ZodObject<{
|
|
2461
|
-
guardrailConfigId: z$1.ZodString;
|
|
2462
|
-
}, z$1.core.$strip>;
|
|
2463
|
-
declare const getOverrideByProviderAndGuardrail: z$1.ZodObject<{
|
|
2464
|
-
providerConfigId: z$1.ZodString;
|
|
2465
|
-
guardrailConfigId: z$1.ZodString;
|
|
2466
|
-
}, z$1.core.$strip>;
|
|
2467
|
-
declare const createProviderGuardrailOverridesDataLayer: (db: Kysely<Database>) => {
|
|
2468
|
-
createProviderGuardrailOverride: (params: z$1.infer<typeof createProviderGuardrailOverride>) => Promise<{
|
|
2469
|
-
id: string;
|
|
2470
|
-
createdAt: Date;
|
|
2471
|
-
updatedAt: Date;
|
|
2472
|
-
enabled: boolean;
|
|
2473
|
-
providerConfigId: string;
|
|
2474
|
-
parameters: Record<string, unknown> | null;
|
|
2475
|
-
guardrailConfigId: string;
|
|
2476
|
-
} | undefined>;
|
|
2477
|
-
updateProviderGuardrailOverride: (params: z$1.infer<typeof updateProviderGuardrailOverride>) => Promise<{
|
|
2478
|
-
id: string;
|
|
2479
|
-
createdAt: Date;
|
|
2480
|
-
updatedAt: Date;
|
|
2481
|
-
enabled: boolean;
|
|
2482
|
-
providerConfigId: string;
|
|
2483
|
-
parameters: Record<string, unknown> | null;
|
|
2484
|
-
guardrailConfigId: string;
|
|
2485
|
-
} | undefined>;
|
|
2486
|
-
getOverrideById: (params: z$1.infer<typeof getOverrideById>) => Promise<{
|
|
2487
|
-
id: string;
|
|
2488
|
-
createdAt: Date;
|
|
2489
|
-
updatedAt: Date;
|
|
2490
|
-
enabled: boolean;
|
|
2491
|
-
providerConfigId: string;
|
|
2492
|
-
parameters: Record<string, unknown> | null;
|
|
2493
|
-
guardrailConfigId: string;
|
|
2494
|
-
} | undefined>;
|
|
2495
|
-
deleteProviderGuardrailOverride: (params: z$1.infer<typeof deleteOverride>) => Promise<{
|
|
2496
|
-
id: string;
|
|
2497
|
-
createdAt: Date;
|
|
2498
|
-
updatedAt: Date;
|
|
2499
|
-
enabled: boolean;
|
|
2500
|
-
providerConfigId: string;
|
|
2501
|
-
parameters: Record<string, unknown> | null;
|
|
2502
|
-
guardrailConfigId: string;
|
|
2503
|
-
} | undefined>;
|
|
2504
|
-
getOverridesByProviderConfigId: (params: z$1.infer<typeof getOverridesByProviderConfigId>) => Promise<{
|
|
2505
|
-
id: string;
|
|
2506
|
-
createdAt: Date;
|
|
2507
|
-
updatedAt: Date;
|
|
2508
|
-
enabled: boolean;
|
|
2509
|
-
providerConfigId: string;
|
|
2510
|
-
parameters: Record<string, unknown> | null;
|
|
2511
|
-
guardrailConfigId: string;
|
|
2512
|
-
}[]>;
|
|
2513
|
-
getOverridesByGuardrailConfigId: (params: z$1.infer<typeof getOverridesByGuardrailConfigId>) => Promise<{
|
|
2514
|
-
id: string;
|
|
2515
|
-
createdAt: Date;
|
|
2516
|
-
updatedAt: Date;
|
|
2517
|
-
enabled: boolean;
|
|
2518
|
-
providerConfigId: string;
|
|
2519
|
-
parameters: Record<string, unknown> | null;
|
|
2520
|
-
guardrailConfigId: string;
|
|
2521
|
-
}[]>;
|
|
2522
|
-
getOverrideByProviderAndGuardrail: (params: z$1.infer<typeof getOverrideByProviderAndGuardrail>) => Promise<{
|
|
2523
|
-
id: string;
|
|
2524
|
-
createdAt: Date;
|
|
2525
|
-
updatedAt: Date;
|
|
2526
|
-
enabled: boolean;
|
|
2527
|
-
providerConfigId: string;
|
|
2528
|
-
parameters: Record<string, unknown> | null;
|
|
2529
|
-
guardrailConfigId: string;
|
|
2530
|
-
} | undefined>;
|
|
2531
|
-
/**
|
|
2532
|
-
* Upsert provider guardrail override - creates if not exists, updates if exists
|
|
2533
|
-
*/
|
|
2534
|
-
upsertProviderGuardrailOverride: (params: z$1.infer<typeof createProviderGuardrailOverride>) => Promise<{
|
|
2535
|
-
id: string;
|
|
2536
|
-
createdAt: Date;
|
|
2537
|
-
updatedAt: Date;
|
|
2538
|
-
enabled: boolean;
|
|
2539
|
-
providerConfigId: string;
|
|
2540
|
-
parameters: Record<string, unknown> | null;
|
|
2541
|
-
guardrailConfigId: string;
|
|
2542
|
-
} | undefined>;
|
|
2543
|
-
/**
|
|
2544
|
-
* Delete all overrides for a guardrail config
|
|
2545
|
-
* Useful when deleting a guardrail config
|
|
2546
|
-
*/
|
|
2547
|
-
deleteOverridesByGuardrailConfigId: (params: z$1.infer<typeof getOverridesByGuardrailConfigId>) => Promise<kysely0.DeleteResult[]>;
|
|
2548
|
-
};
|
|
2549
|
-
//#endregion
|
|
2550
|
-
//#region src/datalayer/traces.d.ts
|
|
2551
|
-
/**
|
|
2552
|
-
* Schema for upserting a trace
|
|
2553
|
-
*/
|
|
2554
|
-
declare const upsertTraceSchema: z$1.ZodObject<{
|
|
2555
|
-
traceId: z$1.ZodString;
|
|
2556
|
-
name: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2557
|
-
sessionId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2558
|
-
userId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2559
|
-
status: z$1.ZodDefault<z$1.ZodEnum<{
|
|
2560
|
-
error: "error";
|
|
2561
|
-
unset: "unset";
|
|
2562
|
-
ok: "ok";
|
|
2563
|
-
}>>;
|
|
2564
|
-
startTime: z$1.ZodDate;
|
|
2565
|
-
endTime: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodDate>>;
|
|
2566
|
-
durationMs: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2567
|
-
spanCount: z$1.ZodDefault<z$1.ZodNumber>;
|
|
2568
|
-
totalInputTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
2569
|
-
totalOutputTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
2570
|
-
totalTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
2571
|
-
totalCost: z$1.ZodDefault<z$1.ZodNumber>;
|
|
2572
|
-
tags: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
|
|
2573
|
-
metadata: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
2574
|
-
}, z$1.core.$strip>;
|
|
2575
|
-
type TraceUpsert = z$1.infer<typeof upsertTraceSchema>;
|
|
2576
|
-
/**
|
|
2577
|
-
* Schema for inserting spans
|
|
2578
|
-
*/
|
|
2579
|
-
declare const insertSpanSchema: z$1.ZodObject<{
|
|
2580
|
-
traceId: z$1.ZodString;
|
|
2581
|
-
spanId: z$1.ZodString;
|
|
2582
|
-
parentSpanId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2583
|
-
name: z$1.ZodString;
|
|
2584
|
-
kind: z$1.ZodDefault<z$1.ZodNumber>;
|
|
2585
|
-
status: z$1.ZodDefault<z$1.ZodNumber>;
|
|
2586
|
-
statusMessage: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2587
|
-
startTime: z$1.ZodDate;
|
|
2588
|
-
endTime: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodDate>>;
|
|
2589
|
-
durationMs: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
|
|
2590
|
-
provider: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2591
|
-
model: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2592
|
-
promptTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
2593
|
-
completionTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
2594
|
-
totalTokens: z$1.ZodDefault<z$1.ZodNumber>;
|
|
2595
|
-
cost: z$1.ZodDefault<z$1.ZodNumber>;
|
|
2596
|
-
configId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2597
|
-
variantId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2598
|
-
environmentId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2599
|
-
providerConfigId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2600
|
-
requestId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2601
|
-
source: z$1.ZodDefault<z$1.ZodEnum<{
|
|
2602
|
-
gateway: "gateway";
|
|
2603
|
-
otlp: "otlp";
|
|
2604
|
-
langsmith: "langsmith";
|
|
2605
|
-
}>>;
|
|
2606
|
-
input: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodUnknown>>;
|
|
2607
|
-
output: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodUnknown>>;
|
|
2608
|
-
attributes: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
2609
|
-
}, z$1.core.$strip>;
|
|
2610
|
-
type SpanInsert = z$1.infer<typeof insertSpanSchema>;
|
|
2611
|
-
/**
|
|
2612
|
-
* Schema for inserting span events
|
|
2613
|
-
*/
|
|
2614
|
-
declare const insertSpanEventSchema: z$1.ZodObject<{
|
|
2615
|
-
traceId: z$1.ZodString;
|
|
2616
|
-
spanId: z$1.ZodString;
|
|
2617
|
-
name: z$1.ZodString;
|
|
2618
|
-
timestamp: z$1.ZodDate;
|
|
2619
|
-
attributes: z$1.ZodDefault<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
|
|
2620
|
-
}, z$1.core.$strip>;
|
|
2621
|
-
type SpanEventInsert = z$1.infer<typeof insertSpanEventSchema>;
|
|
2622
|
-
/**
|
|
2623
|
-
* Schema for listing traces
|
|
2624
|
-
*/
|
|
2625
|
-
declare const listTracesSchema: z$1.ZodObject<{
|
|
2626
|
-
limit: z$1.ZodDefault<z$1.ZodNumber>;
|
|
2627
|
-
offset: z$1.ZodDefault<z$1.ZodNumber>;
|
|
2628
|
-
sessionId: z$1.ZodOptional<z$1.ZodString>;
|
|
2629
|
-
userId: z$1.ZodOptional<z$1.ZodString>;
|
|
2630
|
-
status: z$1.ZodOptional<z$1.ZodEnum<{
|
|
2631
|
-
error: "error";
|
|
2632
|
-
unset: "unset";
|
|
2633
|
-
ok: "ok";
|
|
2634
|
-
}>>;
|
|
2635
|
-
name: z$1.ZodOptional<z$1.ZodString>;
|
|
2636
|
-
startDate: z$1.ZodOptional<z$1.ZodDate>;
|
|
2637
|
-
endDate: z$1.ZodOptional<z$1.ZodDate>;
|
|
2638
|
-
tags: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.ZodString>>>;
|
|
2639
|
-
}, z$1.core.$strip>;
|
|
2640
|
-
/**
|
|
2641
|
-
* Schema for trace stats query
|
|
2642
|
-
*/
|
|
2643
|
-
declare const traceStatsSchema: z$1.ZodObject<{
|
|
2644
|
-
startDate: z$1.ZodDate;
|
|
2645
|
-
endDate: z$1.ZodDate;
|
|
2646
|
-
sessionId: z$1.ZodOptional<z$1.ZodString>;
|
|
2647
|
-
userId: z$1.ZodOptional<z$1.ZodString>;
|
|
2648
|
-
}, z$1.core.$strip>;
|
|
2649
|
-
declare const createTracesDataLayer: (db: Kysely<Database>) => {
|
|
2650
|
-
/**
|
|
2651
|
-
* Upsert a trace — insert or update aggregates on conflict
|
|
2652
|
-
*/
|
|
2653
|
-
upsertTrace: (data: TraceUpsert) => Promise<void>;
|
|
2654
|
-
/**
|
|
2655
|
-
* Batch insert spans
|
|
2656
|
-
*/
|
|
2657
|
-
batchInsertSpans: (spans: SpanInsert[]) => Promise<{
|
|
2658
|
-
count: number;
|
|
2659
|
-
}>;
|
|
2660
|
-
/**
|
|
2661
|
-
* Batch insert span events
|
|
2662
|
-
*/
|
|
2663
|
-
batchInsertSpanEvents: (events: SpanEventInsert[]) => Promise<{
|
|
2664
|
-
count: number;
|
|
2665
|
-
}>;
|
|
2666
|
-
/**
|
|
2667
|
-
* List traces with filtering and pagination
|
|
2668
|
-
*/
|
|
2669
|
-
listTraces: (params?: z$1.infer<typeof listTracesSchema>) => Promise<{
|
|
2670
|
-
data: {
|
|
2671
|
-
name: string | null;
|
|
2672
|
-
id: string;
|
|
2673
|
-
createdAt: Date;
|
|
2674
|
-
updatedAt: Date;
|
|
2675
|
-
status: string;
|
|
2676
|
-
totalTokens: number;
|
|
2677
|
-
metadata: Record<string, unknown>;
|
|
2678
|
-
userId: string | null;
|
|
2679
|
-
tags: Record<string, string>;
|
|
2680
|
-
traceId: string;
|
|
2681
|
-
sessionId: string | null;
|
|
2682
|
-
startTime: Date;
|
|
2683
|
-
endTime: Date | null;
|
|
2684
|
-
durationMs: number | null;
|
|
2685
|
-
spanCount: number;
|
|
2686
|
-
totalInputTokens: number;
|
|
2687
|
-
totalOutputTokens: number;
|
|
2688
|
-
totalCost: number;
|
|
2689
|
-
}[];
|
|
2690
|
-
total: number;
|
|
2691
|
-
limit: number;
|
|
2692
|
-
offset: number;
|
|
2693
|
-
}>;
|
|
2694
|
-
/**
|
|
2695
|
-
* Get a single trace with all its spans and events
|
|
2696
|
-
*/
|
|
2697
|
-
getTraceWithSpans: (traceId: string) => Promise<{
|
|
2698
|
-
trace: {
|
|
2699
|
-
name: string | null;
|
|
2700
|
-
id: string;
|
|
2701
|
-
createdAt: Date;
|
|
2702
|
-
updatedAt: Date;
|
|
2703
|
-
status: string;
|
|
2704
|
-
totalTokens: number;
|
|
2705
|
-
metadata: Record<string, unknown>;
|
|
2706
|
-
userId: string | null;
|
|
2707
|
-
tags: Record<string, string>;
|
|
2708
|
-
traceId: string;
|
|
2709
|
-
sessionId: string | null;
|
|
2710
|
-
startTime: Date;
|
|
2711
|
-
endTime: Date | null;
|
|
2712
|
-
durationMs: number | null;
|
|
2713
|
-
spanCount: number;
|
|
2714
|
-
totalInputTokens: number;
|
|
2715
|
-
totalOutputTokens: number;
|
|
2716
|
-
totalCost: number;
|
|
2717
|
-
};
|
|
2718
|
-
spans: {
|
|
2719
|
-
name: string;
|
|
2720
|
-
id: string;
|
|
2721
|
-
createdAt: Date;
|
|
2722
|
-
updatedAt: Date;
|
|
2723
|
-
variantId: string | null;
|
|
2724
|
-
provider: string | null;
|
|
2725
|
-
input: unknown;
|
|
2726
|
-
output: unknown;
|
|
2727
|
-
environmentId: string | null;
|
|
2728
|
-
configId: string | null;
|
|
2729
|
-
providerConfigId: string | null;
|
|
2730
|
-
status: number;
|
|
2731
|
-
promptTokens: number;
|
|
2732
|
-
completionTokens: number;
|
|
2733
|
-
totalTokens: number;
|
|
2734
|
-
cost: number;
|
|
2735
|
-
requestId: string | null;
|
|
2736
|
-
model: string | null;
|
|
2737
|
-
traceId: string;
|
|
2738
|
-
spanId: string;
|
|
2739
|
-
parentSpanId: string | null;
|
|
2740
|
-
startTime: Date;
|
|
2741
|
-
endTime: Date | null;
|
|
2742
|
-
durationMs: number | null;
|
|
2743
|
-
kind: number;
|
|
2744
|
-
statusMessage: string | null;
|
|
2745
|
-
source: string;
|
|
2746
|
-
attributes: Record<string, unknown>;
|
|
2747
|
-
}[];
|
|
2748
|
-
events: {
|
|
2749
|
-
name: string;
|
|
2750
|
-
id: string;
|
|
2751
|
-
createdAt: Date;
|
|
2752
|
-
traceId: string;
|
|
2753
|
-
spanId: string;
|
|
2754
|
-
attributes: Record<string, unknown>;
|
|
2755
|
-
timestamp: Date;
|
|
2756
|
-
}[];
|
|
2757
|
-
} | undefined>;
|
|
2758
|
-
/**
|
|
2759
|
-
* Get aggregate trace statistics for a date range
|
|
2760
|
-
*/
|
|
2761
|
-
getTraceStats: (params: z$1.infer<typeof traceStatsSchema>) => Promise<{
|
|
2762
|
-
totalCost: number;
|
|
2763
|
-
totalTokens: number;
|
|
2764
|
-
totalTraces: number;
|
|
2765
|
-
avgDurationMs: number;
|
|
2766
|
-
errorCount: number;
|
|
2767
|
-
totalSpans: number;
|
|
2768
|
-
} | undefined>;
|
|
2769
|
-
};
|
|
2770
|
-
//#endregion
|
|
2771
|
-
//#region src/datalayer/workspaceSettings.d.ts
|
|
2772
|
-
declare const updateWorkspaceSettings: z$1.ZodObject<{
|
|
2773
|
-
name: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2774
|
-
setupComplete: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
2775
|
-
superAdminId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
2776
|
-
}, z$1.core.$strip>;
|
|
2777
|
-
declare const createWorkspaceSettingsDataLayer: (db: Kysely<Database>) => {
|
|
2778
|
-
/**
|
|
2779
|
-
* Get workspace settings (creates default if not exists)
|
|
2780
|
-
*/
|
|
2781
|
-
getWorkspaceSettings: () => Promise<{
|
|
2782
|
-
name: string | null;
|
|
2783
|
-
id: string;
|
|
2784
|
-
createdAt: Date;
|
|
2785
|
-
updatedAt: Date;
|
|
2786
|
-
setupComplete: boolean;
|
|
2787
|
-
superAdminId: string | null;
|
|
2788
|
-
} | undefined>;
|
|
2789
|
-
/**
|
|
2790
|
-
* Update workspace settings
|
|
2791
|
-
*/
|
|
2792
|
-
updateWorkspaceSettings: (params: z$1.infer<typeof updateWorkspaceSettings>) => Promise<{
|
|
2793
|
-
name: string | null;
|
|
2794
|
-
id: string;
|
|
2795
|
-
createdAt: Date;
|
|
2796
|
-
updatedAt: Date;
|
|
2797
|
-
setupComplete: boolean;
|
|
2798
|
-
superAdminId: string | null;
|
|
2799
|
-
} | undefined>;
|
|
2800
|
-
/**
|
|
2801
|
-
* Get the super admin user ID
|
|
2802
|
-
*/
|
|
2803
|
-
getSuperAdminId: () => Promise<string | null>;
|
|
2804
|
-
/**
|
|
2805
|
-
* Set the super admin user ID (only if not already set)
|
|
2806
|
-
*/
|
|
2807
|
-
setSuperAdminId: (userId: string) => Promise<boolean>;
|
|
2808
|
-
/**
|
|
2809
|
-
* Check if initial setup has been completed
|
|
2810
|
-
*/
|
|
2811
|
-
isSetupComplete: () => Promise<boolean>;
|
|
2812
|
-
/**
|
|
2813
|
-
* Mark initial setup as complete
|
|
2814
|
-
*/
|
|
2815
|
-
markSetupComplete: () => Promise<{
|
|
2816
|
-
name: string | null;
|
|
2817
|
-
id: string;
|
|
2818
|
-
createdAt: Date;
|
|
2819
|
-
updatedAt: Date;
|
|
2820
|
-
setupComplete: boolean;
|
|
2821
|
-
superAdminId: string | null;
|
|
2822
|
-
} | undefined>;
|
|
2823
|
-
};
|
|
2824
|
-
//#endregion
|
|
2825
|
-
//#region src/datalayer/interface.d.ts
|
|
2826
|
-
type DatasetsDataLayer = ReturnType<typeof createDatasetsDataLayer>;
|
|
2827
|
-
type GuardrailConfigsDataLayer = ReturnType<typeof createGuardrailConfigsDataLayer>;
|
|
2828
|
-
type LLMRequestsDataLayer = ReturnType<typeof createLLMRequestsDataLayer>;
|
|
2829
|
-
type PlaygroundsDataLayer = ReturnType<typeof createPlaygroundDataLayer>;
|
|
2830
|
-
type PlaygroundResultsDataLayer = ReturnType<typeof createPlaygroundResultsDataLayer>;
|
|
2831
|
-
type PlaygroundRunsDataLayer = ReturnType<typeof createPlaygroundRunsDataLayer>;
|
|
2832
|
-
type ProviderConfigsDataLayer = ReturnType<typeof createProviderConfigsDataLayer>;
|
|
2833
|
-
type ProviderGuardrailOverridesDataLayer = ReturnType<typeof createProviderGuardrailOverridesDataLayer>;
|
|
2834
|
-
type TracesDataLayer = ReturnType<typeof createTracesDataLayer>;
|
|
2835
|
-
type WorkspaceSettingsDataLayer = ReturnType<typeof createWorkspaceSettingsDataLayer>;
|
|
2836
|
-
type DataLayer = DatasetsDataLayer & GuardrailConfigsDataLayer & LLMRequestsDataLayer & PlaygroundsDataLayer & PlaygroundResultsDataLayer & PlaygroundRunsDataLayer & ProviderConfigsDataLayer & ProviderGuardrailOverridesDataLayer & TracesDataLayer & WorkspaceSettingsDataLayer;
|
|
2837
|
-
//#endregion
|
|
2838
|
-
//#region src/datalayer/create.d.ts
|
|
2839
|
-
/**
|
|
2840
|
-
* Create all datalayers from a Kysely database instance.
|
|
2841
|
-
* Returns a flat object with all datalayer methods spread together.
|
|
2842
|
-
*/
|
|
2843
|
-
declare function createDataLayer(db: Kysely<Database>): DataLayer;
|
|
2844
|
-
//#endregion
|
|
2845
1188
|
//#region src/pricing/types.d.ts
|
|
2846
1189
|
/**
|
|
2847
1190
|
* Pricing types for cost tracking
|
|
@@ -3047,115 +1390,4 @@ declare class LLMOpsPricingProvider implements PricingProvider {
|
|
|
3047
1390
|
*/
|
|
3048
1391
|
declare function getDefaultPricingProvider(): LLMOpsPricingProvider;
|
|
3049
1392
|
//#endregion
|
|
3050
|
-
|
|
3051
|
-
type LLMRequestsStore = ReturnType<typeof createLLMRequestsDataLayer>;
|
|
3052
|
-
type TracesStore = ReturnType<typeof createTracesDataLayer>;
|
|
3053
|
-
/**
|
|
3054
|
-
* TelemetryStore provides read + write access to telemetry data.
|
|
3055
|
-
* Implemented by pgStore (and future sqliteStore, etc.)
|
|
3056
|
-
*/
|
|
3057
|
-
type TelemetryStore = LLMRequestsStore & TracesStore;
|
|
3058
|
-
//#endregion
|
|
3059
|
-
//#region src/telemetry/postgres.d.ts
|
|
3060
|
-
type PgStore = TelemetryStore & {
|
|
3061
|
-
/** Internal Kysely instance — used by the app to power remaining datalayer queries */
|
|
3062
|
-
_db: Kysely<Database>;
|
|
3063
|
-
};
|
|
3064
|
-
/**
|
|
3065
|
-
* Create a PostgreSQL-backed telemetry store.
|
|
3066
|
-
*
|
|
3067
|
-
* Usage:
|
|
3068
|
-
* ```ts
|
|
3069
|
-
* import { llmops, pgStore } from '@llmops/sdk'
|
|
3070
|
-
*
|
|
3071
|
-
* const ops = llmops({
|
|
3072
|
-
* telemetry: pgStore(process.env.DATABASE_URL),
|
|
3073
|
-
* })
|
|
3074
|
-
* ```
|
|
3075
|
-
*/
|
|
3076
|
-
declare function createPgStore(connectionString: string, options?: {
|
|
3077
|
-
schema?: string;
|
|
3078
|
-
}): PgStore;
|
|
3079
|
-
//#endregion
|
|
3080
|
-
//#region src/manifest/types.d.ts
|
|
3081
|
-
/**
|
|
3082
|
-
* Guardrail configuration in the manifest
|
|
3083
|
-
* Pre-loaded for gateway use without additional DB queries
|
|
3084
|
-
*/
|
|
3085
|
-
interface ManifestGuardrail {
|
|
3086
|
-
id: string;
|
|
3087
|
-
name: string;
|
|
3088
|
-
pluginId: string;
|
|
3089
|
-
functionId: string;
|
|
3090
|
-
hookType: 'beforeRequestHook' | 'afterRequestHook';
|
|
3091
|
-
parameters: Record<string, unknown>;
|
|
3092
|
-
priority: number;
|
|
3093
|
-
onFail: 'block' | 'log';
|
|
3094
|
-
}
|
|
3095
|
-
/**
|
|
3096
|
-
* Provider-specific guardrail override in the manifest
|
|
3097
|
-
*/
|
|
3098
|
-
interface ManifestProviderGuardrailOverride {
|
|
3099
|
-
id: string;
|
|
3100
|
-
providerConfigId: string;
|
|
3101
|
-
guardrailConfigId: string;
|
|
3102
|
-
enabled: boolean;
|
|
3103
|
-
parameters: Record<string, unknown> | null;
|
|
3104
|
-
}
|
|
3105
|
-
/**
|
|
3106
|
-
* The gateway manifest
|
|
3107
|
-
* Stored in cache under key: "gateway:manifest"
|
|
3108
|
-
*/
|
|
3109
|
-
interface GatewayManifest {
|
|
3110
|
-
version: number;
|
|
3111
|
-
builtAt: string;
|
|
3112
|
-
guardrails: {
|
|
3113
|
-
beforeRequestHook: ManifestGuardrail[];
|
|
3114
|
-
afterRequestHook: ManifestGuardrail[];
|
|
3115
|
-
};
|
|
3116
|
-
providerGuardrailOverrides: Record<string, ManifestProviderGuardrailOverride[]>;
|
|
3117
|
-
}
|
|
3118
|
-
//#endregion
|
|
3119
|
-
//#region src/manifest/builder.d.ts
|
|
3120
|
-
/**
|
|
3121
|
-
* Builds the gateway manifest from database
|
|
3122
|
-
*/
|
|
3123
|
-
declare class ManifestBuilder {
|
|
3124
|
-
private db;
|
|
3125
|
-
constructor(db: Kysely<Database>);
|
|
3126
|
-
/**
|
|
3127
|
-
* Build the manifest from database
|
|
3128
|
-
*/
|
|
3129
|
-
build(): Promise<GatewayManifest>;
|
|
3130
|
-
}
|
|
3131
|
-
//#endregion
|
|
3132
|
-
//#region src/manifest/service.d.ts
|
|
3133
|
-
declare class ManifestService {
|
|
3134
|
-
private cache;
|
|
3135
|
-
private ttlMs;
|
|
3136
|
-
private builder;
|
|
3137
|
-
constructor(cache: CacheService, db: Kysely<Database>, ttlMs?: number);
|
|
3138
|
-
/**
|
|
3139
|
-
* Get the current manifest, building if necessary
|
|
3140
|
-
*/
|
|
3141
|
-
getManifest(): Promise<GatewayManifest>;
|
|
3142
|
-
/**
|
|
3143
|
-
* Force invalidate the manifest (called on mutations)
|
|
3144
|
-
*/
|
|
3145
|
-
invalidate(): Promise<void>;
|
|
3146
|
-
/**
|
|
3147
|
-
* Invalidate and immediately rebuild (atomic refresh)
|
|
3148
|
-
*/
|
|
3149
|
-
refresh(): Promise<GatewayManifest>;
|
|
3150
|
-
/**
|
|
3151
|
-
* Get manifest version without fetching full manifest
|
|
3152
|
-
* Useful for checking if manifest is stale
|
|
3153
|
-
*/
|
|
3154
|
-
getVersion(): Promise<number | null>;
|
|
3155
|
-
/**
|
|
3156
|
-
* Check if manifest exists in cache
|
|
3157
|
-
*/
|
|
3158
|
-
hasManifest(): Promise<boolean>;
|
|
3159
|
-
}
|
|
3160
|
-
//#endregion
|
|
3161
|
-
export { type AnthropicProviderConfig, type AnyProviderConfig, type AzureAIProviderConfig, type AzureOpenAIProviderConfig, BaseCacheConfig, type BaseProviderConfig, type BedrockProviderConfig, COST_SUMMARY_GROUP_BY, CacheBackend, CacheBackendType, CacheConfig, CacheEntry, CacheOptions, CacheService, CacheStats, ChatCompletionCreateParamsBase, Config, ConfigVariant, ConfigVariantsTable, ConfigsTable, type CortexProviderConfig, CostResult, CostSummaryGroupBy, DEFAULT_PROVIDER_ENV_VARS, DataLayer, Database, DatabaseConnection, DatabaseOptions, DatabaseType, Dataset, DatasetRecord, DatasetRecordsTable, DatasetVersion, DatasetVersionRecord, DatasetVersionRecordsTable, DatasetVersionsTable, DatasetsDataLayer, DatasetsTable, Environment, EnvironmentSecret, EnvironmentSecretsTable, EnvironmentsTable, FileCacheBackend, FileCacheConfig, type FireworksAIProviderConfig, GatewayManifest, type GoogleProviderConfig, GuardrailConfig, GuardrailConfigsDataLayer, GuardrailConfigsTable, GuardrailResult, GuardrailResults, type HuggingFaceProviderConfig, type InlineProviderConfig, type InlineProvidersConfig, Insertable, LLMOPS_INTERNAL_HEADER, LLMOPS_REQUEST_ID_HEADER, LLMOPS_SESSION_ID_HEADER, LLMOPS_SPAN_ID_HEADER, LLMOPS_SPAN_NAME_HEADER, LLMOPS_TRACE_ID_HEADER, LLMOPS_TRACE_NAME_HEADER, LLMOPS_USER_ID_HEADER, LLMOpsClient, LLMOpsConfig, type LLMOpsConfigInput, LLMOpsPricingProvider, LLMRequest, LLMRequestInsert, LLMRequestsDataLayer, LLMRequestsTable, MS, ManifestBuilder, ManifestGuardrail, ManifestProviderGuardrailOverride, ManifestService, MemoryCacheBackend, MemoryCacheConfig, MigrationOptions, MigrationResult, type MistralAIProviderConfig, ModelPricing, type OpenAIProviderConfig, type OracleProviderConfig, Playground, PlaygroundColumn, PlaygroundResult, PlaygroundResultsDataLayer, PlaygroundResultsTable, PlaygroundRun, PlaygroundRunsDataLayer, PlaygroundRunsTable, PlaygroundsDataLayer, PlaygroundsTable, Prettify, PricingProvider, ProviderConfig, type ProviderConfigMap, ProviderConfigsDataLayer, ProviderConfigsTable, ProviderGuardrailOverride, ProviderGuardrailOverridesDataLayer, ProviderGuardrailOverridesTable, type ProvidersConfig, SCHEMA_METADATA, type SagemakerProviderConfig, Selectable, Span, SpanEvent, SpanEventInsert, SpanEventsTable, SpanInsert, SpansTable, type StabilityAIProviderConfig, SupportedProviders, TableName, TargetingRule, TargetingRulesTable, TelemetryStore, Trace, TraceUpsert, TracesDataLayer, TracesTable, Updateable, UsageData, type ValidatedLLMOpsConfig, Variant, VariantJsonData, VariantVersion, VariantVersionsTable, VariantsTable, type VertexAIProviderConfig, type WorkersAIProviderConfig, WorkspaceSettings, WorkspaceSettingsDataLayer, WorkspaceSettingsTable, calculateCacheAwareCost, calculateCost, chatCompletionCreateParamsBaseSchema, configVariantsSchema, configsSchema, createDataLayer, createDatabase, createDatabaseFromConnection, createDatasetsDataLayer, createGuardrailConfigsDataLayer, createLLMRequestsDataLayer, createNeonDialect, createPgStore, createPlaygroundDataLayer, createPlaygroundResultsDataLayer, createPlaygroundRunsDataLayer, createProviderConfigsDataLayer, createProviderGuardrailOverridesDataLayer, createTracesDataLayer, createWorkspaceSettingsDataLayer, datasetRecordsSchema, datasetVersionRecordsSchema, datasetVersionsSchema, datasetsSchema, detectDatabaseType, dollarsToMicroDollars, environmentSecretsSchema, environmentsSchema, executeWithSchema, formatCost, gateway, generateId, getDefaultPricingProvider, getDefaultProviders, getMigrations, guardrailConfigsSchema, llmRequestsSchema, llmopsConfigSchema, logger, matchType, mergeWithDefaultProviders, microDollarsToDollars, parsePartialTableData, parseTableData, playgroundColumnSchema, playgroundResultsSchema, playgroundRunsSchema, playgroundsSchema, providerConfigsSchema, providerGuardrailOverridesSchema, runAutoMigrations, schemas, spanEventsSchema, spansSchema, targetingRulesSchema, tracesSchema, validateLLMOpsConfig, validatePartialTableData, validateTableData, variantJsonDataSchema, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
|
|
1393
|
+
export { type AnthropicProviderConfig, type AnyProviderConfig, type AzureAIProviderConfig, type AzureOpenAIProviderConfig, BaseCacheConfig, type BaseProviderConfig, type BedrockProviderConfig, CacheBackend, CacheBackendType, CacheConfig, CacheEntry, CacheOptions, CacheService, CacheStats, ChatCompletionCreateParamsBase, type CortexProviderConfig, CostResult, DEFAULT_PROVIDER_ENV_VARS, FileCacheBackend, FileCacheConfig, type FireworksAIProviderConfig, type GoogleProviderConfig, type HuggingFaceProviderConfig, type InlineProviderConfig, type InlineProvidersConfig, LLMOPS_INTERNAL_HEADER, LLMOPS_REQUEST_ID_HEADER, LLMOPS_SESSION_ID_HEADER, LLMOPS_SPAN_ID_HEADER, LLMOPS_SPAN_NAME_HEADER, LLMOPS_TRACE_ID_HEADER, LLMOPS_TRACE_NAME_HEADER, LLMOPS_USER_ID_HEADER, LLMOpsClient, LLMOpsConfig, type LLMOpsConfigInput, LLMOpsPricingProvider, MS, MemoryCacheBackend, MemoryCacheConfig, type MistralAIProviderConfig, ModelPricing, type OpenAIProviderConfig, type OracleProviderConfig, Prettify, PricingProvider, type ProviderConfigMap, type ProvidersConfig, type SagemakerProviderConfig, type StabilityAIProviderConfig, SupportedProviders, UsageData, type ValidatedLLMOpsConfig, VariantJsonData, type VertexAIProviderConfig, type WorkersAIProviderConfig, calculateCacheAwareCost, calculateCost, chatCompletionCreateParamsBaseSchema, dollarsToMicroDollars, formatCost, gateway, generateId, getDefaultPricingProvider, getDefaultProviders, llmopsConfigSchema, logger, mergeWithDefaultProviders, microDollarsToDollars, validateLLMOpsConfig, variantJsonDataSchema };
|