@llmops/core 0.6.7-beta.1 → 0.6.7-beta.3
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/db/index.d.cts +1 -1
- package/dist/db/index.d.mts +1 -1
- package/dist/{index-CyVFWq76.d.cts → index-2POEhF2_.d.mts} +49 -49
- package/dist/{index-D3onb7gK.d.mts → index-BVI_reop.d.cts} +49 -49
- package/dist/index.cjs +24 -21
- package/dist/index.d.cts +279 -307
- package/dist/index.d.mts +279 -307
- package/dist/index.mjs +24 -21
- package/package.json +2 -2
package/dist/db/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as SCHEMA_METADATA, A as DatasetsTable, At as playgroundsSchema, B as LLMRequest, Bt as workspaceSettingsSchema, C as Dataset, Ct as environmentSecretsSchema, D as DatasetVersionRecord, Dt as playgroundColumnSchema, E as DatasetVersion, Et as llmRequestsSchema, F as GuardrailConfig, Ft as spansSchema, G as PlaygroundResultsTable, H as Playground, I as GuardrailConfigsTable, It as targetingRulesSchema, J as PlaygroundsTable, K as PlaygroundRun, L as GuardrailResult, Lt as tracesSchema, M as EnvironmentSecret, Mt as providerGuardrailOverridesSchema, N as EnvironmentSecretsTable, Nt as schemas, O as DatasetVersionRecordsTable, Ot as playgroundResultsSchema, P as EnvironmentsTable, Pt as spanEventsSchema, Q as ProviderGuardrailOverridesTable, R as GuardrailResults, Rt as variantVersionsSchema, S as Database, St as datasetsSchema, T as DatasetRecordsTable, Tt as guardrailConfigsSchema, U as PlaygroundColumn, V as LLMRequestsTable, W as PlaygroundResult, X as ProviderConfigsTable, Y as ProviderConfig, Z as ProviderGuardrailOverride, _ as validateTableData, _t as configVariantsSchema, a as createDatabaseFromConnection, at as TableName, b as ConfigVariantsTable, bt as datasetVersionRecordsSchema, c as executeWithSchema, ct as Trace, d as getMigrations, dt as Variant, et as Selectable, f as matchType, ft as VariantVersion, g as validatePartialTableData, gt as WorkspaceSettingsTable, h as parseTableData, ht as WorkspaceSettings, i as createDatabase, it as SpansTable, j as Environment, jt as providerConfigsSchema, k as DatasetVersionsTable, kt as playgroundRunsSchema, l as MigrationOptions, lt as TracesTable, m as parsePartialTableData, mt as VariantsTable, n as DatabaseOptions, nt as SpanEvent, o as detectDatabaseType, ot as TargetingRule, p as runAutoMigrations, pt as VariantVersionsTable, q as PlaygroundRunsTable, r as DatabaseType, rt as SpanEventsTable, s as createNeonDialect, st as TargetingRulesTable, t as DatabaseConnection, tt as Span, u as MigrationResult, ut as Updateable, v as Config, vt as configsSchema, w as DatasetRecord, wt as environmentsSchema, x as ConfigsTable, xt as datasetVersionsSchema, y as ConfigVariant, yt as datasetRecordsSchema, z as Insertable, zt as variantsSchema } from "../index-
|
|
1
|
+
import { $ as SCHEMA_METADATA, A as DatasetsTable, At as playgroundsSchema, B as LLMRequest, Bt as workspaceSettingsSchema, C as Dataset, Ct as environmentSecretsSchema, D as DatasetVersionRecord, Dt as playgroundColumnSchema, E as DatasetVersion, Et as llmRequestsSchema, F as GuardrailConfig, Ft as spansSchema, G as PlaygroundResultsTable, H as Playground, I as GuardrailConfigsTable, It as targetingRulesSchema, J as PlaygroundsTable, K as PlaygroundRun, L as GuardrailResult, Lt as tracesSchema, M as EnvironmentSecret, Mt as providerGuardrailOverridesSchema, N as EnvironmentSecretsTable, Nt as schemas, O as DatasetVersionRecordsTable, Ot as playgroundResultsSchema, P as EnvironmentsTable, Pt as spanEventsSchema, Q as ProviderGuardrailOverridesTable, R as GuardrailResults, Rt as variantVersionsSchema, S as Database, St as datasetsSchema, T as DatasetRecordsTable, Tt as guardrailConfigsSchema, U as PlaygroundColumn, V as LLMRequestsTable, W as PlaygroundResult, X as ProviderConfigsTable, Y as ProviderConfig, Z as ProviderGuardrailOverride, _ as validateTableData, _t as configVariantsSchema, a as createDatabaseFromConnection, at as TableName, b as ConfigVariantsTable, bt as datasetVersionRecordsSchema, c as executeWithSchema, ct as Trace, d as getMigrations, dt as Variant, et as Selectable, f as matchType, ft as VariantVersion, g as validatePartialTableData, gt as WorkspaceSettingsTable, h as parseTableData, ht as WorkspaceSettings, i as createDatabase, it as SpansTable, j as Environment, jt as providerConfigsSchema, k as DatasetVersionsTable, kt as playgroundRunsSchema, l as MigrationOptions, lt as TracesTable, m as parsePartialTableData, mt as VariantsTable, n as DatabaseOptions, nt as SpanEvent, o as detectDatabaseType, ot as TargetingRule, p as runAutoMigrations, pt as VariantVersionsTable, q as PlaygroundRunsTable, r as DatabaseType, rt as SpanEventsTable, s as createNeonDialect, st as TargetingRulesTable, t as DatabaseConnection, tt as Span, u as MigrationResult, ut as Updateable, v as Config, vt as configsSchema, w as DatasetRecord, wt as environmentsSchema, x as ConfigsTable, xt as datasetVersionsSchema, y as ConfigVariant, yt as datasetRecordsSchema, z as Insertable, zt as variantsSchema } from "../index-BVI_reop.cjs";
|
|
2
2
|
export { Config, ConfigVariant, ConfigVariantsTable, ConfigsTable, Database, DatabaseConnection, DatabaseOptions, DatabaseType, Dataset, DatasetRecord, DatasetRecordsTable, DatasetVersion, DatasetVersionRecord, DatasetVersionRecordsTable, DatasetVersionsTable, DatasetsTable, Environment, EnvironmentSecret, EnvironmentSecretsTable, EnvironmentsTable, GuardrailConfig, GuardrailConfigsTable, GuardrailResult, GuardrailResults, Insertable, LLMRequest, LLMRequestsTable, MigrationOptions, MigrationResult, Playground, PlaygroundColumn, PlaygroundResult, PlaygroundResultsTable, PlaygroundRun, PlaygroundRunsTable, PlaygroundsTable, ProviderConfig, ProviderConfigsTable, ProviderGuardrailOverride, ProviderGuardrailOverridesTable, SCHEMA_METADATA, Selectable, Span, SpanEvent, SpanEventsTable, SpansTable, TableName, TargetingRule, TargetingRulesTable, Trace, TracesTable, Updateable, Variant, VariantVersion, VariantVersionsTable, VariantsTable, WorkspaceSettings, WorkspaceSettingsTable, configVariantsSchema, configsSchema, createDatabase, createDatabaseFromConnection, createNeonDialect, datasetRecordsSchema, datasetVersionRecordsSchema, datasetVersionsSchema, datasetsSchema, detectDatabaseType, environmentSecretsSchema, environmentsSchema, executeWithSchema, getMigrations, guardrailConfigsSchema, llmRequestsSchema, matchType, parsePartialTableData, parseTableData, playgroundColumnSchema, playgroundResultsSchema, playgroundRunsSchema, playgroundsSchema, providerConfigsSchema, providerGuardrailOverridesSchema, runAutoMigrations, schemas, spanEventsSchema, spansSchema, targetingRulesSchema, tracesSchema, validatePartialTableData, validateTableData, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
|
package/dist/db/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as SCHEMA_METADATA, A as DatasetsTable, At as playgroundsSchema, B as LLMRequest, Bt as workspaceSettingsSchema, C as Dataset, Ct as environmentSecretsSchema, D as DatasetVersionRecord, Dt as playgroundColumnSchema, E as DatasetVersion, Et as llmRequestsSchema, F as GuardrailConfig, Ft as spansSchema, G as PlaygroundResultsTable, H as Playground, I as GuardrailConfigsTable, It as targetingRulesSchema, J as PlaygroundsTable, K as PlaygroundRun, L as GuardrailResult, Lt as tracesSchema, M as EnvironmentSecret, Mt as providerGuardrailOverridesSchema, N as EnvironmentSecretsTable, Nt as schemas, O as DatasetVersionRecordsTable, Ot as playgroundResultsSchema, P as EnvironmentsTable, Pt as spanEventsSchema, Q as ProviderGuardrailOverridesTable, R as GuardrailResults, Rt as variantVersionsSchema, S as Database, St as datasetsSchema, T as DatasetRecordsTable, Tt as guardrailConfigsSchema, U as PlaygroundColumn, V as LLMRequestsTable, W as PlaygroundResult, X as ProviderConfigsTable, Y as ProviderConfig, Z as ProviderGuardrailOverride, _ as validateTableData, _t as configVariantsSchema, a as createDatabaseFromConnection, at as TableName, b as ConfigVariantsTable, bt as datasetVersionRecordsSchema, c as executeWithSchema, ct as Trace, d as getMigrations, dt as Variant, et as Selectable, f as matchType, ft as VariantVersion, g as validatePartialTableData, gt as WorkspaceSettingsTable, h as parseTableData, ht as WorkspaceSettings, i as createDatabase, it as SpansTable, j as Environment, jt as providerConfigsSchema, k as DatasetVersionsTable, kt as playgroundRunsSchema, l as MigrationOptions, lt as TracesTable, m as parsePartialTableData, mt as VariantsTable, n as DatabaseOptions, nt as SpanEvent, o as detectDatabaseType, ot as TargetingRule, p as runAutoMigrations, pt as VariantVersionsTable, q as PlaygroundRunsTable, r as DatabaseType, rt as SpanEventsTable, s as createNeonDialect, st as TargetingRulesTable, t as DatabaseConnection, tt as Span, u as MigrationResult, ut as Updateable, v as Config, vt as configsSchema, w as DatasetRecord, wt as environmentsSchema, x as ConfigsTable, xt as datasetVersionsSchema, y as ConfigVariant, yt as datasetRecordsSchema, z as Insertable, zt as variantsSchema } from "../index-
|
|
1
|
+
import { $ as SCHEMA_METADATA, A as DatasetsTable, At as playgroundsSchema, B as LLMRequest, Bt as workspaceSettingsSchema, C as Dataset, Ct as environmentSecretsSchema, D as DatasetVersionRecord, Dt as playgroundColumnSchema, E as DatasetVersion, Et as llmRequestsSchema, F as GuardrailConfig, Ft as spansSchema, G as PlaygroundResultsTable, H as Playground, I as GuardrailConfigsTable, It as targetingRulesSchema, J as PlaygroundsTable, K as PlaygroundRun, L as GuardrailResult, Lt as tracesSchema, M as EnvironmentSecret, Mt as providerGuardrailOverridesSchema, N as EnvironmentSecretsTable, Nt as schemas, O as DatasetVersionRecordsTable, Ot as playgroundResultsSchema, P as EnvironmentsTable, Pt as spanEventsSchema, Q as ProviderGuardrailOverridesTable, R as GuardrailResults, Rt as variantVersionsSchema, S as Database, St as datasetsSchema, T as DatasetRecordsTable, Tt as guardrailConfigsSchema, U as PlaygroundColumn, V as LLMRequestsTable, W as PlaygroundResult, X as ProviderConfigsTable, Y as ProviderConfig, Z as ProviderGuardrailOverride, _ as validateTableData, _t as configVariantsSchema, a as createDatabaseFromConnection, at as TableName, b as ConfigVariantsTable, bt as datasetVersionRecordsSchema, c as executeWithSchema, ct as Trace, d as getMigrations, dt as Variant, et as Selectable, f as matchType, ft as VariantVersion, g as validatePartialTableData, gt as WorkspaceSettingsTable, h as parseTableData, ht as WorkspaceSettings, i as createDatabase, it as SpansTable, j as Environment, jt as providerConfigsSchema, k as DatasetVersionsTable, kt as playgroundRunsSchema, l as MigrationOptions, lt as TracesTable, m as parsePartialTableData, mt as VariantsTable, n as DatabaseOptions, nt as SpanEvent, o as detectDatabaseType, ot as TargetingRule, p as runAutoMigrations, pt as VariantVersionsTable, q as PlaygroundRunsTable, r as DatabaseType, rt as SpanEventsTable, s as createNeonDialect, st as TargetingRulesTable, t as DatabaseConnection, tt as Span, u as MigrationResult, ut as Updateable, v as Config, vt as configsSchema, w as DatasetRecord, wt as environmentsSchema, x as ConfigsTable, xt as datasetVersionsSchema, y as ConfigVariant, yt as datasetRecordsSchema, z as Insertable, zt as variantsSchema } from "../index-2POEhF2_.mjs";
|
|
2
2
|
export { Config, ConfigVariant, ConfigVariantsTable, ConfigsTable, Database, DatabaseConnection, DatabaseOptions, DatabaseType, Dataset, DatasetRecord, DatasetRecordsTable, DatasetVersion, DatasetVersionRecord, DatasetVersionRecordsTable, DatasetVersionsTable, DatasetsTable, Environment, EnvironmentSecret, EnvironmentSecretsTable, EnvironmentsTable, GuardrailConfig, GuardrailConfigsTable, GuardrailResult, GuardrailResults, Insertable, LLMRequest, LLMRequestsTable, MigrationOptions, MigrationResult, Playground, PlaygroundColumn, PlaygroundResult, PlaygroundResultsTable, PlaygroundRun, PlaygroundRunsTable, PlaygroundsTable, ProviderConfig, ProviderConfigsTable, ProviderGuardrailOverride, ProviderGuardrailOverridesTable, SCHEMA_METADATA, Selectable, Span, SpanEvent, SpanEventsTable, SpansTable, TableName, TargetingRule, TargetingRulesTable, Trace, TracesTable, Updateable, Variant, VariantVersion, VariantVersionsTable, VariantsTable, WorkspaceSettings, WorkspaceSettingsTable, configVariantsSchema, configsSchema, createDatabase, createDatabaseFromConnection, createNeonDialect, datasetRecordsSchema, datasetVersionRecordsSchema, datasetVersionsSchema, datasetsSchema, detectDatabaseType, environmentSecretsSchema, environmentsSchema, executeWithSchema, getMigrations, guardrailConfigsSchema, llmRequestsSchema, matchType, parsePartialTableData, parseTableData, playgroundColumnSchema, playgroundResultsSchema, playgroundRunsSchema, playgroundsSchema, providerConfigsSchema, providerGuardrailOverridesSchema, runAutoMigrations, schemas, spanEventsSchema, spansSchema, targetingRulesSchema, tracesSchema, validatePartialTableData, validateTableData, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ColumnType, Dialect, Generated, Kysely, MssqlDialect, MysqlDialect, PostgresDialect, SqliteDialect } from "kysely";
|
|
2
|
+
import { NeonQueryFunction } from "@neondatabase/serverless";
|
|
2
3
|
import * as zod0 from "zod";
|
|
3
4
|
import { z } from "zod";
|
|
4
|
-
import { NeonQueryFunction } from "@neondatabase/serverless";
|
|
5
5
|
|
|
6
6
|
//#region src/db/schema.d.ts
|
|
7
7
|
declare const configsSchema: z.ZodObject<{
|
|
@@ -2588,6 +2588,22 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
2588
2588
|
id: string;
|
|
2589
2589
|
createdAt: Date;
|
|
2590
2590
|
updatedAt: Date;
|
|
2591
|
+
}> | zod0.ZodSafeParseSuccess<{
|
|
2592
|
+
providerConfigId: string;
|
|
2593
|
+
guardrailConfigId: string;
|
|
2594
|
+
enabled: boolean;
|
|
2595
|
+
id: string;
|
|
2596
|
+
createdAt: Date;
|
|
2597
|
+
updatedAt: Date;
|
|
2598
|
+
parameters?: Record<string, unknown> | null | undefined;
|
|
2599
|
+
}> | zod0.ZodSafeParseError<{
|
|
2600
|
+
providerConfigId: string;
|
|
2601
|
+
guardrailConfigId: string;
|
|
2602
|
+
enabled: boolean;
|
|
2603
|
+
id: string;
|
|
2604
|
+
createdAt: Date;
|
|
2605
|
+
updatedAt: Date;
|
|
2606
|
+
parameters?: Record<string, unknown> | null | undefined;
|
|
2591
2607
|
}> | zod0.ZodSafeParseSuccess<{
|
|
2592
2608
|
datasetId: string;
|
|
2593
2609
|
versionNumber: number;
|
|
@@ -2638,22 +2654,6 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
2638
2654
|
id: string;
|
|
2639
2655
|
createdAt: Date;
|
|
2640
2656
|
updatedAt: Date;
|
|
2641
|
-
}> | zod0.ZodSafeParseSuccess<{
|
|
2642
|
-
providerConfigId: string;
|
|
2643
|
-
guardrailConfigId: string;
|
|
2644
|
-
enabled: boolean;
|
|
2645
|
-
id: string;
|
|
2646
|
-
createdAt: Date;
|
|
2647
|
-
updatedAt: Date;
|
|
2648
|
-
parameters?: Record<string, unknown> | null | undefined;
|
|
2649
|
-
}> | zod0.ZodSafeParseError<{
|
|
2650
|
-
providerConfigId: string;
|
|
2651
|
-
guardrailConfigId: string;
|
|
2652
|
-
enabled: boolean;
|
|
2653
|
-
id: string;
|
|
2654
|
-
createdAt: Date;
|
|
2655
|
-
updatedAt: Date;
|
|
2656
|
-
parameters?: Record<string, unknown> | null | undefined;
|
|
2657
2657
|
}> | zod0.ZodSafeParseSuccess<{
|
|
2658
2658
|
requestId: string;
|
|
2659
2659
|
provider: string;
|
|
@@ -2960,6 +2960,22 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
|
|
|
2960
2960
|
id?: string | undefined;
|
|
2961
2961
|
createdAt?: Date | undefined;
|
|
2962
2962
|
updatedAt?: Date | undefined;
|
|
2963
|
+
}> | zod0.ZodSafeParseSuccess<{
|
|
2964
|
+
providerConfigId?: string | undefined;
|
|
2965
|
+
guardrailConfigId?: string | undefined;
|
|
2966
|
+
enabled?: boolean | undefined;
|
|
2967
|
+
parameters?: Record<string, unknown> | null | undefined;
|
|
2968
|
+
id?: string | undefined;
|
|
2969
|
+
createdAt?: Date | undefined;
|
|
2970
|
+
updatedAt?: Date | undefined;
|
|
2971
|
+
}> | zod0.ZodSafeParseError<{
|
|
2972
|
+
providerConfigId?: string | undefined;
|
|
2973
|
+
guardrailConfigId?: string | undefined;
|
|
2974
|
+
enabled?: boolean | undefined;
|
|
2975
|
+
parameters?: Record<string, unknown> | null | undefined;
|
|
2976
|
+
id?: string | undefined;
|
|
2977
|
+
createdAt?: Date | undefined;
|
|
2978
|
+
updatedAt?: Date | undefined;
|
|
2963
2979
|
}> | zod0.ZodSafeParseSuccess<{
|
|
2964
2980
|
datasetId?: string | undefined;
|
|
2965
2981
|
versionNumber?: number | undefined;
|
|
@@ -3010,22 +3026,6 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
|
|
|
3010
3026
|
id?: string | undefined;
|
|
3011
3027
|
createdAt?: Date | undefined;
|
|
3012
3028
|
updatedAt?: Date | undefined;
|
|
3013
|
-
}> | zod0.ZodSafeParseSuccess<{
|
|
3014
|
-
providerConfigId?: string | undefined;
|
|
3015
|
-
guardrailConfigId?: string | undefined;
|
|
3016
|
-
enabled?: boolean | undefined;
|
|
3017
|
-
parameters?: Record<string, unknown> | null | undefined;
|
|
3018
|
-
id?: string | undefined;
|
|
3019
|
-
createdAt?: Date | undefined;
|
|
3020
|
-
updatedAt?: Date | undefined;
|
|
3021
|
-
}> | zod0.ZodSafeParseError<{
|
|
3022
|
-
providerConfigId?: string | undefined;
|
|
3023
|
-
guardrailConfigId?: string | undefined;
|
|
3024
|
-
enabled?: boolean | undefined;
|
|
3025
|
-
parameters?: Record<string, unknown> | null | undefined;
|
|
3026
|
-
id?: string | undefined;
|
|
3027
|
-
createdAt?: Date | undefined;
|
|
3028
|
-
updatedAt?: Date | undefined;
|
|
3029
3029
|
}> | zod0.ZodSafeParseSuccess<{
|
|
3030
3030
|
requestId?: string | undefined;
|
|
3031
3031
|
configId?: string | null | undefined;
|
|
@@ -3255,6 +3255,14 @@ declare function parseTableData<T extends TableName>(table: T, data: unknown): {
|
|
|
3255
3255
|
id: string;
|
|
3256
3256
|
createdAt: Date;
|
|
3257
3257
|
updatedAt: Date;
|
|
3258
|
+
} | {
|
|
3259
|
+
providerConfigId: string;
|
|
3260
|
+
guardrailConfigId: string;
|
|
3261
|
+
enabled: boolean;
|
|
3262
|
+
id: string;
|
|
3263
|
+
createdAt: Date;
|
|
3264
|
+
updatedAt: Date;
|
|
3265
|
+
parameters?: Record<string, unknown> | null | undefined;
|
|
3258
3266
|
} | {
|
|
3259
3267
|
datasetId: string;
|
|
3260
3268
|
versionNumber: number;
|
|
@@ -3280,14 +3288,6 @@ declare function parseTableData<T extends TableName>(table: T, data: unknown): {
|
|
|
3280
3288
|
id: string;
|
|
3281
3289
|
createdAt: Date;
|
|
3282
3290
|
updatedAt: Date;
|
|
3283
|
-
} | {
|
|
3284
|
-
providerConfigId: string;
|
|
3285
|
-
guardrailConfigId: string;
|
|
3286
|
-
enabled: boolean;
|
|
3287
|
-
id: string;
|
|
3288
|
-
createdAt: Date;
|
|
3289
|
-
updatedAt: Date;
|
|
3290
|
-
parameters?: Record<string, unknown> | null | undefined;
|
|
3291
3291
|
} | {
|
|
3292
3292
|
requestId: string;
|
|
3293
3293
|
provider: string;
|
|
@@ -3443,6 +3443,14 @@ declare function parsePartialTableData<T extends TableName>(table: T, data: unkn
|
|
|
3443
3443
|
id?: string | undefined;
|
|
3444
3444
|
createdAt?: Date | undefined;
|
|
3445
3445
|
updatedAt?: Date | undefined;
|
|
3446
|
+
} | {
|
|
3447
|
+
providerConfigId?: string | undefined;
|
|
3448
|
+
guardrailConfigId?: string | undefined;
|
|
3449
|
+
enabled?: boolean | undefined;
|
|
3450
|
+
parameters?: Record<string, unknown> | null | undefined;
|
|
3451
|
+
id?: string | undefined;
|
|
3452
|
+
createdAt?: Date | undefined;
|
|
3453
|
+
updatedAt?: Date | undefined;
|
|
3446
3454
|
} | {
|
|
3447
3455
|
datasetId?: string | undefined;
|
|
3448
3456
|
versionNumber?: number | undefined;
|
|
@@ -3468,14 +3476,6 @@ declare function parsePartialTableData<T extends TableName>(table: T, data: unkn
|
|
|
3468
3476
|
id?: string | undefined;
|
|
3469
3477
|
createdAt?: Date | undefined;
|
|
3470
3478
|
updatedAt?: Date | undefined;
|
|
3471
|
-
} | {
|
|
3472
|
-
providerConfigId?: string | undefined;
|
|
3473
|
-
guardrailConfigId?: string | undefined;
|
|
3474
|
-
enabled?: boolean | undefined;
|
|
3475
|
-
parameters?: Record<string, unknown> | null | undefined;
|
|
3476
|
-
id?: string | undefined;
|
|
3477
|
-
createdAt?: Date | undefined;
|
|
3478
|
-
updatedAt?: Date | undefined;
|
|
3479
3479
|
} | {
|
|
3480
3480
|
requestId?: string | undefined;
|
|
3481
3481
|
configId?: string | null | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ColumnType, Dialect, Generated, Kysely, MssqlDialect, MysqlDialect, PostgresDialect, SqliteDialect } from "kysely";
|
|
2
|
-
import { NeonQueryFunction } from "@neondatabase/serverless";
|
|
3
2
|
import * as zod0 from "zod";
|
|
4
3
|
import { z } from "zod";
|
|
4
|
+
import { NeonQueryFunction } from "@neondatabase/serverless";
|
|
5
5
|
|
|
6
6
|
//#region src/db/schema.d.ts
|
|
7
7
|
declare const configsSchema: z.ZodObject<{
|
|
@@ -2588,6 +2588,22 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
2588
2588
|
id: string;
|
|
2589
2589
|
createdAt: Date;
|
|
2590
2590
|
updatedAt: Date;
|
|
2591
|
+
}> | zod0.ZodSafeParseSuccess<{
|
|
2592
|
+
providerConfigId: string;
|
|
2593
|
+
guardrailConfigId: string;
|
|
2594
|
+
enabled: boolean;
|
|
2595
|
+
id: string;
|
|
2596
|
+
createdAt: Date;
|
|
2597
|
+
updatedAt: Date;
|
|
2598
|
+
parameters?: Record<string, unknown> | null | undefined;
|
|
2599
|
+
}> | zod0.ZodSafeParseError<{
|
|
2600
|
+
providerConfigId: string;
|
|
2601
|
+
guardrailConfigId: string;
|
|
2602
|
+
enabled: boolean;
|
|
2603
|
+
id: string;
|
|
2604
|
+
createdAt: Date;
|
|
2605
|
+
updatedAt: Date;
|
|
2606
|
+
parameters?: Record<string, unknown> | null | undefined;
|
|
2591
2607
|
}> | zod0.ZodSafeParseSuccess<{
|
|
2592
2608
|
datasetId: string;
|
|
2593
2609
|
versionNumber: number;
|
|
@@ -2638,22 +2654,6 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
2638
2654
|
id: string;
|
|
2639
2655
|
createdAt: Date;
|
|
2640
2656
|
updatedAt: Date;
|
|
2641
|
-
}> | zod0.ZodSafeParseSuccess<{
|
|
2642
|
-
providerConfigId: string;
|
|
2643
|
-
guardrailConfigId: string;
|
|
2644
|
-
enabled: boolean;
|
|
2645
|
-
id: string;
|
|
2646
|
-
createdAt: Date;
|
|
2647
|
-
updatedAt: Date;
|
|
2648
|
-
parameters?: Record<string, unknown> | null | undefined;
|
|
2649
|
-
}> | zod0.ZodSafeParseError<{
|
|
2650
|
-
providerConfigId: string;
|
|
2651
|
-
guardrailConfigId: string;
|
|
2652
|
-
enabled: boolean;
|
|
2653
|
-
id: string;
|
|
2654
|
-
createdAt: Date;
|
|
2655
|
-
updatedAt: Date;
|
|
2656
|
-
parameters?: Record<string, unknown> | null | undefined;
|
|
2657
2657
|
}> | zod0.ZodSafeParseSuccess<{
|
|
2658
2658
|
requestId: string;
|
|
2659
2659
|
provider: string;
|
|
@@ -2960,6 +2960,22 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
|
|
|
2960
2960
|
id?: string | undefined;
|
|
2961
2961
|
createdAt?: Date | undefined;
|
|
2962
2962
|
updatedAt?: Date | undefined;
|
|
2963
|
+
}> | zod0.ZodSafeParseSuccess<{
|
|
2964
|
+
providerConfigId?: string | undefined;
|
|
2965
|
+
guardrailConfigId?: string | undefined;
|
|
2966
|
+
enabled?: boolean | undefined;
|
|
2967
|
+
parameters?: Record<string, unknown> | null | undefined;
|
|
2968
|
+
id?: string | undefined;
|
|
2969
|
+
createdAt?: Date | undefined;
|
|
2970
|
+
updatedAt?: Date | undefined;
|
|
2971
|
+
}> | zod0.ZodSafeParseError<{
|
|
2972
|
+
providerConfigId?: string | undefined;
|
|
2973
|
+
guardrailConfigId?: string | undefined;
|
|
2974
|
+
enabled?: boolean | undefined;
|
|
2975
|
+
parameters?: Record<string, unknown> | null | undefined;
|
|
2976
|
+
id?: string | undefined;
|
|
2977
|
+
createdAt?: Date | undefined;
|
|
2978
|
+
updatedAt?: Date | undefined;
|
|
2963
2979
|
}> | zod0.ZodSafeParseSuccess<{
|
|
2964
2980
|
datasetId?: string | undefined;
|
|
2965
2981
|
versionNumber?: number | undefined;
|
|
@@ -3010,22 +3026,6 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
|
|
|
3010
3026
|
id?: string | undefined;
|
|
3011
3027
|
createdAt?: Date | undefined;
|
|
3012
3028
|
updatedAt?: Date | undefined;
|
|
3013
|
-
}> | zod0.ZodSafeParseSuccess<{
|
|
3014
|
-
providerConfigId?: string | undefined;
|
|
3015
|
-
guardrailConfigId?: string | undefined;
|
|
3016
|
-
enabled?: boolean | undefined;
|
|
3017
|
-
parameters?: Record<string, unknown> | null | undefined;
|
|
3018
|
-
id?: string | undefined;
|
|
3019
|
-
createdAt?: Date | undefined;
|
|
3020
|
-
updatedAt?: Date | undefined;
|
|
3021
|
-
}> | zod0.ZodSafeParseError<{
|
|
3022
|
-
providerConfigId?: string | undefined;
|
|
3023
|
-
guardrailConfigId?: string | undefined;
|
|
3024
|
-
enabled?: boolean | undefined;
|
|
3025
|
-
parameters?: Record<string, unknown> | null | undefined;
|
|
3026
|
-
id?: string | undefined;
|
|
3027
|
-
createdAt?: Date | undefined;
|
|
3028
|
-
updatedAt?: Date | undefined;
|
|
3029
3029
|
}> | zod0.ZodSafeParseSuccess<{
|
|
3030
3030
|
requestId?: string | undefined;
|
|
3031
3031
|
configId?: string | null | undefined;
|
|
@@ -3255,6 +3255,14 @@ declare function parseTableData<T extends TableName>(table: T, data: unknown): {
|
|
|
3255
3255
|
id: string;
|
|
3256
3256
|
createdAt: Date;
|
|
3257
3257
|
updatedAt: Date;
|
|
3258
|
+
} | {
|
|
3259
|
+
providerConfigId: string;
|
|
3260
|
+
guardrailConfigId: string;
|
|
3261
|
+
enabled: boolean;
|
|
3262
|
+
id: string;
|
|
3263
|
+
createdAt: Date;
|
|
3264
|
+
updatedAt: Date;
|
|
3265
|
+
parameters?: Record<string, unknown> | null | undefined;
|
|
3258
3266
|
} | {
|
|
3259
3267
|
datasetId: string;
|
|
3260
3268
|
versionNumber: number;
|
|
@@ -3280,14 +3288,6 @@ declare function parseTableData<T extends TableName>(table: T, data: unknown): {
|
|
|
3280
3288
|
id: string;
|
|
3281
3289
|
createdAt: Date;
|
|
3282
3290
|
updatedAt: Date;
|
|
3283
|
-
} | {
|
|
3284
|
-
providerConfigId: string;
|
|
3285
|
-
guardrailConfigId: string;
|
|
3286
|
-
enabled: boolean;
|
|
3287
|
-
id: string;
|
|
3288
|
-
createdAt: Date;
|
|
3289
|
-
updatedAt: Date;
|
|
3290
|
-
parameters?: Record<string, unknown> | null | undefined;
|
|
3291
3291
|
} | {
|
|
3292
3292
|
requestId: string;
|
|
3293
3293
|
provider: string;
|
|
@@ -3443,6 +3443,14 @@ declare function parsePartialTableData<T extends TableName>(table: T, data: unkn
|
|
|
3443
3443
|
id?: string | undefined;
|
|
3444
3444
|
createdAt?: Date | undefined;
|
|
3445
3445
|
updatedAt?: Date | undefined;
|
|
3446
|
+
} | {
|
|
3447
|
+
providerConfigId?: string | undefined;
|
|
3448
|
+
guardrailConfigId?: string | undefined;
|
|
3449
|
+
enabled?: boolean | undefined;
|
|
3450
|
+
parameters?: Record<string, unknown> | null | undefined;
|
|
3451
|
+
id?: string | undefined;
|
|
3452
|
+
createdAt?: Date | undefined;
|
|
3453
|
+
updatedAt?: Date | undefined;
|
|
3446
3454
|
} | {
|
|
3447
3455
|
datasetId?: string | undefined;
|
|
3448
3456
|
versionNumber?: number | undefined;
|
|
@@ -3468,14 +3476,6 @@ declare function parsePartialTableData<T extends TableName>(table: T, data: unkn
|
|
|
3468
3476
|
id?: string | undefined;
|
|
3469
3477
|
createdAt?: Date | undefined;
|
|
3470
3478
|
updatedAt?: Date | undefined;
|
|
3471
|
-
} | {
|
|
3472
|
-
providerConfigId?: string | undefined;
|
|
3473
|
-
guardrailConfigId?: string | undefined;
|
|
3474
|
-
enabled?: boolean | undefined;
|
|
3475
|
-
parameters?: Record<string, unknown> | null | undefined;
|
|
3476
|
-
id?: string | undefined;
|
|
3477
|
-
createdAt?: Date | undefined;
|
|
3478
|
-
updatedAt?: Date | undefined;
|
|
3479
3479
|
} | {
|
|
3480
3480
|
requestId?: string | undefined;
|
|
3481
3481
|
configId?: string | null | undefined;
|
package/dist/index.cjs
CHANGED
|
@@ -632,24 +632,13 @@ const inlineProviderConfigSchema = require_db.object({
|
|
|
632
632
|
*/
|
|
633
633
|
const providersConfigSchema = require_db.array(inlineProviderConfigSchema).optional();
|
|
634
634
|
/**
|
|
635
|
-
* Schema for OTLP endpoint configuration.
|
|
636
|
-
* When configured, trace/span data is forwarded to this endpoint
|
|
637
|
-
* instead of being stored in PostgreSQL.
|
|
638
|
-
*/
|
|
639
|
-
const otlpConfigSchema = require_db.object({
|
|
640
|
-
endpoint: require_db.string().url("OTLP endpoint must be a valid URL").refine((url) => url.startsWith("http://") || url.startsWith("https://"), "OTLP endpoint must use http:// or https://"),
|
|
641
|
-
headers: require_db.record(require_db.string(), require_db.string()).optional(),
|
|
642
|
-
protocol: require_db._enum(["http/protobuf", "http/json"]).optional().default("http/protobuf")
|
|
643
|
-
}).optional();
|
|
644
|
-
/**
|
|
645
635
|
* Base schema without refinements (used for transform)
|
|
646
636
|
*/
|
|
647
637
|
const llmopsConfigBaseSchema = require_db.object({
|
|
648
638
|
database: require_db.any().optional(),
|
|
649
639
|
basePath: require_db.string().min(1, "Base path cannot be empty").refine((path) => path.startsWith("/"), "Base path must start with a forward slash").default("/llmops"),
|
|
650
640
|
schema: require_db.string().optional().default("llmops"),
|
|
651
|
-
providers: providersConfigSchema
|
|
652
|
-
otlp: otlpConfigSchema
|
|
641
|
+
providers: providersConfigSchema
|
|
653
642
|
});
|
|
654
643
|
const llmopsConfigSchema = llmopsConfigBaseSchema.transform((config) => ({
|
|
655
644
|
...config,
|
|
@@ -3189,7 +3178,11 @@ const insertSpanSchema = require_db.zod_default.object({
|
|
|
3189
3178
|
environmentId: require_db.zod_default.string().uuid().nullable().optional(),
|
|
3190
3179
|
providerConfigId: require_db.zod_default.string().uuid().nullable().optional(),
|
|
3191
3180
|
requestId: require_db.zod_default.string().uuid().nullable().optional(),
|
|
3192
|
-
source: require_db.zod_default.enum([
|
|
3181
|
+
source: require_db.zod_default.enum([
|
|
3182
|
+
"gateway",
|
|
3183
|
+
"otlp",
|
|
3184
|
+
"langsmith"
|
|
3185
|
+
]).default("gateway"),
|
|
3193
3186
|
input: require_db.zod_default.unknown().nullable().optional(),
|
|
3194
3187
|
output: require_db.zod_default.unknown().nullable().optional(),
|
|
3195
3188
|
attributes: require_db.zod_default.record(require_db.zod_default.string(), require_db.zod_default.unknown()).default({})
|
|
@@ -3287,11 +3280,16 @@ const createTracesDataLayer = (db) => {
|
|
|
3287
3280
|
},
|
|
3288
3281
|
batchInsertSpans: async (spans) => {
|
|
3289
3282
|
if (spans.length === 0) return { count: 0 };
|
|
3290
|
-
const validatedSpans =
|
|
3283
|
+
const validatedSpans = [];
|
|
3284
|
+
for (const span of spans) {
|
|
3291
3285
|
const result = await insertSpanSchema.safeParseAsync(span);
|
|
3292
|
-
if (!result.success)
|
|
3293
|
-
|
|
3294
|
-
|
|
3286
|
+
if (!result.success) {
|
|
3287
|
+
require_db.logger.warn(`[batchInsertSpans] Skipping invalid span ${span.spanId}: ${result.error.message}`);
|
|
3288
|
+
continue;
|
|
3289
|
+
}
|
|
3290
|
+
validatedSpans.push(result.data);
|
|
3291
|
+
}
|
|
3292
|
+
if (validatedSpans.length === 0) return { count: 0 };
|
|
3295
3293
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
3296
3294
|
const values = validatedSpans.map((span) => ({
|
|
3297
3295
|
id: (0, node_crypto.randomUUID)(),
|
|
@@ -3328,11 +3326,16 @@ const createTracesDataLayer = (db) => {
|
|
|
3328
3326
|
},
|
|
3329
3327
|
batchInsertSpanEvents: async (events) => {
|
|
3330
3328
|
if (events.length === 0) return { count: 0 };
|
|
3331
|
-
const validatedEvents =
|
|
3329
|
+
const validatedEvents = [];
|
|
3330
|
+
for (const event of events) {
|
|
3332
3331
|
const result = await insertSpanEventSchema.safeParseAsync(event);
|
|
3333
|
-
if (!result.success)
|
|
3334
|
-
|
|
3335
|
-
|
|
3332
|
+
if (!result.success) {
|
|
3333
|
+
require_db.logger.warn(`[batchInsertSpanEvents] Skipping invalid event: ${result.error.message}`);
|
|
3334
|
+
continue;
|
|
3335
|
+
}
|
|
3336
|
+
validatedEvents.push(result.data);
|
|
3337
|
+
}
|
|
3338
|
+
if (validatedEvents.length === 0) return { count: 0 };
|
|
3336
3339
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
3337
3340
|
const values = validatedEvents.map((event) => ({
|
|
3338
3341
|
id: (0, node_crypto.randomUUID)(),
|