@llmops/core 0.3.3 → 0.4.0-beta.1

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.
@@ -12966,6 +12966,101 @@ const providerConfigsSchema = object({
12966
12966
  config: record(string$1(), unknown()),
12967
12967
  enabled: boolean$1().default(true)
12968
12968
  });
12969
+ const playgroundColumnSchema = object({
12970
+ id: string$1().uuid(),
12971
+ name: string$1(),
12972
+ position: number$1().int().min(0),
12973
+ providerConfigId: union([string$1().uuid(), _null()]),
12974
+ modelName: string$1(),
12975
+ messages: array(object({
12976
+ role: _enum([
12977
+ "system",
12978
+ "user",
12979
+ "assistant"
12980
+ ]),
12981
+ content: string$1()
12982
+ })),
12983
+ temperature: number$1().nullable().optional(),
12984
+ maxTokens: number$1().int().nullable().optional(),
12985
+ topP: number$1().nullable().optional(),
12986
+ frequencyPenalty: number$1().nullable().optional(),
12987
+ presencePenalty: number$1().nullable().optional(),
12988
+ configId: string$1().uuid().nullable().optional(),
12989
+ variantId: string$1().uuid().nullable().optional(),
12990
+ variantVersionId: string$1().uuid().nullable().optional()
12991
+ });
12992
+ const playgroundsSchema = object({
12993
+ ...baseSchema,
12994
+ name: string$1(),
12995
+ datasetId: string$1().uuid().nullable().optional(),
12996
+ columns: array(playgroundColumnSchema).nullable()
12997
+ });
12998
+ const playgroundRunsSchema = object({
12999
+ ...baseSchema,
13000
+ playgroundId: string$1().uuid(),
13001
+ datasetId: string$1().uuid().nullable(),
13002
+ datasetVersionId: string$1().uuid().nullable(),
13003
+ status: _enum([
13004
+ "pending",
13005
+ "running",
13006
+ "completed",
13007
+ "failed",
13008
+ "cancelled"
13009
+ ]),
13010
+ startedAt: date$1().nullable(),
13011
+ completedAt: date$1().nullable(),
13012
+ totalRecords: number$1().int().default(0),
13013
+ completedRecords: number$1().int().default(0)
13014
+ });
13015
+ const playgroundResultsSchema = object({
13016
+ ...baseSchema,
13017
+ runId: string$1().uuid(),
13018
+ columnId: string$1().uuid(),
13019
+ datasetRecordId: string$1().uuid().nullable(),
13020
+ inputVariables: record(string$1(), unknown()),
13021
+ outputContent: string$1().nullable(),
13022
+ status: _enum([
13023
+ "pending",
13024
+ "running",
13025
+ "completed",
13026
+ "failed"
13027
+ ]),
13028
+ error: string$1().nullable(),
13029
+ latencyMs: number$1().int().nullable(),
13030
+ promptTokens: number$1().int().nullable(),
13031
+ completionTokens: number$1().int().nullable(),
13032
+ totalTokens: number$1().int().nullable(),
13033
+ cost: number$1().int().nullable()
13034
+ });
13035
+ const datasetsSchema = object({
13036
+ ...baseSchema,
13037
+ name: string$1(),
13038
+ description: string$1().nullable().optional(),
13039
+ recordCount: number$1().int().default(0),
13040
+ latestVersionNumber: number$1().int().default(1)
13041
+ });
13042
+ const datasetVersionsSchema = object({
13043
+ ...baseSchema,
13044
+ datasetId: string$1().uuid(),
13045
+ versionNumber: number$1().int().min(1),
13046
+ name: string$1().nullable().optional(),
13047
+ description: string$1().nullable().optional(),
13048
+ recordCount: number$1().int().default(0),
13049
+ snapshotHash: string$1()
13050
+ });
13051
+ const datasetRecordsSchema = object({
13052
+ ...baseSchema,
13053
+ datasetId: string$1().uuid(),
13054
+ input: record(string$1(), unknown()),
13055
+ expected: record(string$1(), unknown()).nullable().optional(),
13056
+ metadata: record(string$1(), unknown()).default({})
13057
+ });
13058
+ const datasetVersionRecordsSchema = object({
13059
+ ...baseSchema,
13060
+ datasetVersionId: string$1().uuid(),
13061
+ datasetRecordId: string$1().uuid(),
13062
+ position: number$1().int().default(0)
13063
+ });
12969
13064
  const guardrailConfigsSchema = object({
12970
13065
  ...baseSchema,
12971
13066
  name: string$1(),
@@ -13327,8 +13422,167 @@ const SCHEMA_METADATA = { tables: {
13327
13422
  }
13328
13423
  }
13329
13424
  },
13330
- guardrail_configs: {
13425
+ playgrounds: {
13331
13426
  order: 10,
13427
+ schema: playgroundsSchema,
13428
+ fields: {
13429
+ id: {
13430
+ type: "uuid",
13431
+ primaryKey: true
13432
+ },
13433
+ name: { type: "text" },
13434
+ datasetId: {
13435
+ type: "uuid",
13436
+ nullable: true,
13437
+ references: {
13438
+ table: "datasets",
13439
+ column: "id"
13440
+ }
13441
+ },
13442
+ columns: {
13443
+ type: "jsonb",
13444
+ nullable: true
13445
+ },
13446
+ createdAt: {
13447
+ type: "timestamp",
13448
+ default: "now()"
13449
+ },
13450
+ updatedAt: {
13451
+ type: "timestamp",
13452
+ default: "now()",
13453
+ onUpdate: "now()"
13454
+ }
13455
+ }
13456
+ },
13457
+ playground_runs: {
13458
+ order: 18,
13459
+ schema: playgroundRunsSchema,
13460
+ fields: {
13461
+ id: {
13462
+ type: "uuid",
13463
+ primaryKey: true
13464
+ },
13465
+ playgroundId: {
13466
+ type: "uuid",
13467
+ references: {
13468
+ table: "playgrounds",
13469
+ column: "id"
13470
+ }
13471
+ },
13472
+ datasetId: {
13473
+ type: "uuid",
13474
+ nullable: true,
13475
+ references: {
13476
+ table: "datasets",
13477
+ column: "id"
13478
+ }
13479
+ },
13480
+ datasetVersionId: {
13481
+ type: "uuid",
13482
+ nullable: true,
13483
+ references: {
13484
+ table: "dataset_versions",
13485
+ column: "id"
13486
+ }
13487
+ },
13488
+ status: { type: "text" },
13489
+ startedAt: {
13490
+ type: "timestamp",
13491
+ nullable: true
13492
+ },
13493
+ completedAt: {
13494
+ type: "timestamp",
13495
+ nullable: true
13496
+ },
13497
+ totalRecords: {
13498
+ type: "integer",
13499
+ default: 0
13500
+ },
13501
+ completedRecords: {
13502
+ type: "integer",
13503
+ default: 0
13504
+ },
13505
+ createdAt: {
13506
+ type: "timestamp",
13507
+ default: "now()"
13508
+ },
13509
+ updatedAt: {
13510
+ type: "timestamp",
13511
+ default: "now()",
13512
+ onUpdate: "now()"
13513
+ }
13514
+ }
13515
+ },
13516
+ playground_results: {
13517
+ order: 19,
13518
+ schema: playgroundResultsSchema,
13519
+ fields: {
13520
+ id: {
13521
+ type: "uuid",
13522
+ primaryKey: true
13523
+ },
13524
+ runId: {
13525
+ type: "uuid",
13526
+ references: {
13527
+ table: "playground_runs",
13528
+ column: "id"
13529
+ }
13530
+ },
13531
+ columnId: { type: "uuid" },
13532
+ datasetRecordId: {
13533
+ type: "uuid",
13534
+ nullable: true,
13535
+ references: {
13536
+ table: "dataset_records",
13537
+ column: "id"
13538
+ }
13539
+ },
13540
+ inputVariables: {
13541
+ type: "jsonb",
13542
+ default: "{}"
13543
+ },
13544
+ outputContent: {
13545
+ type: "text",
13546
+ nullable: true
13547
+ },
13548
+ status: { type: "text" },
13549
+ error: {
13550
+ type: "text",
13551
+ nullable: true
13552
+ },
13553
+ latencyMs: {
13554
+ type: "integer",
13555
+ nullable: true
13556
+ },
13557
+ promptTokens: {
13558
+ type: "integer",
13559
+ nullable: true
13560
+ },
13561
+ completionTokens: {
13562
+ type: "integer",
13563
+ nullable: true
13564
+ },
13565
+ totalTokens: {
13566
+ type: "integer",
13567
+ nullable: true
13568
+ },
13569
+ cost: {
13570
+ type: "integer",
13571
+ nullable: true
13572
+ },
13573
+ createdAt: {
13574
+ type: "timestamp",
13575
+ default: "now()"
13576
+ },
13577
+ updatedAt: {
13578
+ type: "timestamp",
13579
+ default: "now()",
13580
+ onUpdate: "now()"
13581
+ }
13582
+ }
13583
+ },
13584
+ guardrail_configs: {
13585
+ order: 11,
13332
13586
  schema: guardrailConfigsSchema,
13333
13587
  fields: {
13334
13588
  id: {
@@ -13366,8 +13620,154 @@ const SCHEMA_METADATA = { tables: {
13366
13620
  }
13367
13621
  }
13368
13622
  },
13623
+ datasets: {
13624
+ order: 12,
13625
+ schema: datasetsSchema,
13626
+ fields: {
13627
+ id: {
13628
+ type: "uuid",
13629
+ primaryKey: true
13630
+ },
13631
+ name: { type: "text" },
13632
+ description: {
13633
+ type: "text",
13634
+ nullable: true
13635
+ },
13636
+ recordCount: {
13637
+ type: "integer",
13638
+ default: 0
13639
+ },
13640
+ latestVersionNumber: {
13641
+ type: "integer",
13642
+ default: 1
13643
+ },
13644
+ createdAt: {
13645
+ type: "timestamp",
13646
+ default: "now()"
13647
+ },
13648
+ updatedAt: {
13649
+ type: "timestamp",
13650
+ default: "now()",
13651
+ onUpdate: "now()"
13652
+ }
13653
+ }
13654
+ },
13655
+ dataset_versions: {
13656
+ order: 13,
13657
+ schema: datasetVersionsSchema,
13658
+ fields: {
13659
+ id: {
13660
+ type: "uuid",
13661
+ primaryKey: true
13662
+ },
13663
+ datasetId: {
13664
+ type: "uuid",
13665
+ references: {
13666
+ table: "datasets",
13667
+ column: "id"
13668
+ }
13669
+ },
13670
+ versionNumber: { type: "integer" },
13671
+ name: {
13672
+ type: "text",
13673
+ nullable: true
13674
+ },
13675
+ description: {
13676
+ type: "text",
13677
+ nullable: true
13678
+ },
13679
+ recordCount: {
13680
+ type: "integer",
13681
+ default: 0
13682
+ },
13683
+ snapshotHash: { type: "text" },
13684
+ createdAt: {
13685
+ type: "timestamp",
13686
+ default: "now()"
13687
+ },
13688
+ updatedAt: {
13689
+ type: "timestamp",
13690
+ default: "now()",
13691
+ onUpdate: "now()"
13692
+ }
13693
+ },
13694
+ uniqueConstraints: [{ columns: ["datasetId", "versionNumber"] }]
13695
+ },
13696
+ dataset_records: {
13697
+ order: 14,
13698
+ schema: datasetRecordsSchema,
13699
+ fields: {
13700
+ id: {
13701
+ type: "uuid",
13702
+ primaryKey: true
13703
+ },
13704
+ datasetId: {
13705
+ type: "uuid",
13706
+ references: {
13707
+ table: "datasets",
13708
+ column: "id"
13709
+ }
13710
+ },
13711
+ input: { type: "jsonb" },
13712
+ expected: {
13713
+ type: "jsonb",
13714
+ nullable: true
13715
+ },
13716
+ metadata: {
13717
+ type: "jsonb",
13718
+ default: "{}"
13719
+ },
13720
+ createdAt: {
13721
+ type: "timestamp",
13722
+ default: "now()"
13723
+ },
13724
+ updatedAt: {
13725
+ type: "timestamp",
13726
+ default: "now()",
13727
+ onUpdate: "now()"
13728
+ }
13729
+ }
13730
+ },
13731
+ dataset_version_records: {
13732
+ order: 15,
13733
+ schema: datasetVersionRecordsSchema,
13734
+ fields: {
13735
+ id: {
13736
+ type: "uuid",
13737
+ primaryKey: true
13738
+ },
13739
+ datasetVersionId: {
13740
+ type: "uuid",
13741
+ references: {
13742
+ table: "dataset_versions",
13743
+ column: "id"
13744
+ }
13745
+ },
13746
+ datasetRecordId: {
13747
+ type: "uuid",
13748
+ references: {
13749
+ table: "dataset_records",
13750
+ column: "id"
13751
+ }
13752
+ },
13753
+ position: {
13754
+ type: "integer",
13755
+ default: 0
13756
+ },
13757
+ createdAt: {
13758
+ type: "timestamp",
13759
+ default: "now()"
13760
+ },
13761
+ updatedAt: {
13762
+ type: "timestamp",
13763
+ default: "now()",
13764
+ onUpdate: "now()"
13765
+ }
13766
+ },
13767
+ uniqueConstraints: [{ columns: ["datasetVersionId", "datasetRecordId"] }]
13768
+ },
13369
13769
  provider_guardrail_overrides: {
13370
- order: 11,
13770
+ order: 16,
13371
13771
  schema: providerGuardrailOverridesSchema,
13372
13772
  fields: {
13373
13773
  id: {
@@ -13409,7 +13809,7 @@ const SCHEMA_METADATA = { tables: {
13409
13809
  uniqueConstraints: [{ columns: ["providerConfigId", "guardrailConfigId"] }]
13410
13810
  },
13411
13811
  llm_requests: {
13412
- order: 12,
13812
+ order: 17,
13413
13813
  schema: llmRequestsSchema,
13414
13814
  fields: {
13415
13815
  id: {
@@ -13526,8 +13926,16 @@ const schemas = {
13526
13926
  targeting_rules: targetingRulesSchema,
13527
13927
  workspace_settings: workspaceSettingsSchema,
13528
13928
  provider_configs: providerConfigsSchema,
13929
+ playgrounds: playgroundsSchema,
13930
+ playground_columns: playgroundColumnSchema,
13931
+ playground_runs: playgroundRunsSchema,
13932
+ playground_results: playgroundResultsSchema,
13529
13933
  guardrail_configs: guardrailConfigsSchema,
13530
13934
  provider_guardrail_overrides: providerGuardrailOverridesSchema,
13935
+ datasets: datasetsSchema,
13936
+ dataset_versions: datasetVersionsSchema,
13937
+ dataset_records: datasetRecordsSchema,
13938
+ dataset_version_records: datasetVersionRecordsSchema,
13531
13939
  llm_requests: llmRequestsSchema
13532
13940
  };
13533
13941
 
@@ -13976,12 +14384,12 @@ async function createDatabaseFromConnection(rawConnection, options) {
13976
14384
  case "sqlite":
13977
14385
  if ("aggregate" in rawConnection && !("createSession" in rawConnection)) dialect = new kysely.SqliteDialect({ database: rawConnection });
13978
14386
  else if ("fileControl" in rawConnection) {
13979
- const { BunSqliteDialect } = await Promise.resolve().then(() => require("./bun-sqlite-dialect-B5odtOFX.cjs"));
14387
+ const { BunSqliteDialect } = await Promise.resolve().then(() => require("./bun-sqlite-dialect-BOVsPUU1.cjs"));
13980
14388
  dialect = new BunSqliteDialect({ database: rawConnection });
13981
14389
  } else if ("createSession" in rawConnection && typeof window === "undefined") try {
13982
14390
  const { DatabaseSync } = await import("node:sqlite");
13983
14391
  if (rawConnection instanceof DatabaseSync) {
13984
- const { NodeSqliteDialect } = await Promise.resolve().then(() => require("./node-sqlite-dialect-BGjMUONa.cjs"));
14392
+ const { NodeSqliteDialect } = await Promise.resolve().then(() => require("./node-sqlite-dialect-BeXYiIVe.cjs"));
13985
14393
  dialect = new NodeSqliteDialect({ database: rawConnection });
13986
14394
  }
13987
14395
  } catch {}
@@ -14010,7 +14418,7 @@ async function createDatabaseFromConnection(rawConnection, options) {
14010
14418
  }
14011
14419
  });
14012
14420
  } else {
14013
- const { createNeonDialect } = await Promise.resolve().then(() => require("./neon-dialect-DSmsjY8m.cjs"));
14421
+ const { createNeonDialect } = await Promise.resolve().then(() => require("./neon-dialect-DIrx-7Rh.cjs"));
14014
14422
  dialect = createNeonDialect(rawConnection);
14015
14423
  }
14016
14424
  break;
@@ -14082,6 +14490,30 @@ Object.defineProperty(exports, 'createDatabaseFromConnection', {
14082
14490
  return createDatabaseFromConnection;
14083
14491
  }
14084
14492
  });
14493
+ Object.defineProperty(exports, 'datasetRecordsSchema', {
14494
+ enumerable: true,
14495
+ get: function () {
14496
+ return datasetRecordsSchema;
14497
+ }
14498
+ });
14499
+ Object.defineProperty(exports, 'datasetVersionRecordsSchema', {
14500
+ enumerable: true,
14501
+ get: function () {
14502
+ return datasetVersionRecordsSchema;
14503
+ }
14504
+ });
14505
+ Object.defineProperty(exports, 'datasetVersionsSchema', {
14506
+ enumerable: true,
14507
+ get: function () {
14508
+ return datasetVersionsSchema;
14509
+ }
14510
+ });
14511
+ Object.defineProperty(exports, 'datasetsSchema', {
14512
+ enumerable: true,
14513
+ get: function () {
14514
+ return datasetsSchema;
14515
+ }
14516
+ });
14085
14517
  Object.defineProperty(exports, 'detectDatabaseType', {
14086
14518
  enumerable: true,
14087
14519
  get: function () {
@@ -14166,6 +14598,30 @@ Object.defineProperty(exports, 'parseTableData', {
14166
14598
  return parseTableData;
14167
14599
  }
14168
14600
  });
14601
+ Object.defineProperty(exports, 'playgroundColumnSchema', {
14602
+ enumerable: true,
14603
+ get: function () {
14604
+ return playgroundColumnSchema;
14605
+ }
14606
+ });
14607
+ Object.defineProperty(exports, 'playgroundResultsSchema', {
14608
+ enumerable: true,
14609
+ get: function () {
14610
+ return playgroundResultsSchema;
14611
+ }
14612
+ });
14613
+ Object.defineProperty(exports, 'playgroundRunsSchema', {
14614
+ enumerable: true,
14615
+ get: function () {
14616
+ return playgroundRunsSchema;
14617
+ }
14618
+ });
14619
+ Object.defineProperty(exports, 'playgroundsSchema', {
14620
+ enumerable: true,
14621
+ get: function () {
14622
+ return playgroundsSchema;
14623
+ }
14624
+ });
14169
14625
  Object.defineProperty(exports, 'providerConfigsSchema', {
14170
14626
  enumerable: true,
14171
14627
  get: function () {