@llmops/core 0.5.1 → 0.5.2
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 +2 -2
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -621,7 +621,7 @@ const providersConfigSchema = require_db.array(inlineProviderConfigSchema).optio
|
|
|
621
621
|
*/
|
|
622
622
|
const llmopsConfigBaseSchema = require_db.object({
|
|
623
623
|
database: require_db.any().optional(),
|
|
624
|
-
basePath: require_db.string().min(1, "Base path
|
|
624
|
+
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"),
|
|
625
625
|
schema: require_db.string().optional().default("llmops"),
|
|
626
626
|
providers: providersConfigSchema
|
|
627
627
|
});
|
|
@@ -630,7 +630,7 @@ const llmopsConfigSchema = llmopsConfigBaseSchema.transform((config) => ({
|
|
|
630
630
|
providers: mergeWithDefaultProviders(config.providers)
|
|
631
631
|
})).refine((config) => config.database !== void 0 || config.providers && config.providers.length > 0, "Either database or providers must be configured. Set a database connection, configure providers explicitly, or set API key environment variables (e.g., OPENAI_API_KEY).");
|
|
632
632
|
function validateLLMOpsConfig(config) {
|
|
633
|
-
const result = llmopsConfigSchema.safeParse(config);
|
|
633
|
+
const result = llmopsConfigSchema.safeParse(config ?? {});
|
|
634
634
|
if (!result.success) {
|
|
635
635
|
const errorMessages = result.error.issues.map((err) => `${err.path.join(".")}: ${err.message}`).join("\n");
|
|
636
636
|
throw new Error(`LLMOps configuration validation failed:\n${errorMessages}`);
|
package/dist/index.d.cts
CHANGED
|
@@ -471,7 +471,7 @@ declare const DEFAULT_PROVIDER_ENV_VARS: string[];
|
|
|
471
471
|
//#region src/schemas/config.d.ts
|
|
472
472
|
declare const llmopsConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
473
473
|
database: z.ZodOptional<z.ZodAny>;
|
|
474
|
-
basePath: z.ZodString
|
|
474
|
+
basePath: z.ZodDefault<z.ZodString>;
|
|
475
475
|
schema: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
476
476
|
providers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
477
477
|
provider: z.ZodString;
|
|
@@ -519,11 +519,11 @@ type ValidatedLLMOpsConfig = {
|
|
|
519
519
|
*/
|
|
520
520
|
type LLMOpsConfigInput = {
|
|
521
521
|
database?: unknown;
|
|
522
|
-
basePath
|
|
522
|
+
basePath?: string;
|
|
523
523
|
schema?: string;
|
|
524
524
|
providers?: InlineProvidersConfig;
|
|
525
525
|
};
|
|
526
|
-
declare function validateLLMOpsConfig(config
|
|
526
|
+
declare function validateLLMOpsConfig(config?: unknown): ValidatedLLMOpsConfig;
|
|
527
527
|
//#endregion
|
|
528
528
|
//#region src/types/helper.d.ts
|
|
529
529
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -471,7 +471,7 @@ declare const DEFAULT_PROVIDER_ENV_VARS: string[];
|
|
|
471
471
|
//#region src/schemas/config.d.ts
|
|
472
472
|
declare const llmopsConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
473
473
|
database: z.ZodOptional<z.ZodAny>;
|
|
474
|
-
basePath: z.ZodString
|
|
474
|
+
basePath: z.ZodDefault<z.ZodString>;
|
|
475
475
|
schema: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
476
476
|
providers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
477
477
|
provider: z.ZodString;
|
|
@@ -519,11 +519,11 @@ type ValidatedLLMOpsConfig = {
|
|
|
519
519
|
*/
|
|
520
520
|
type LLMOpsConfigInput = {
|
|
521
521
|
database?: unknown;
|
|
522
|
-
basePath
|
|
522
|
+
basePath?: string;
|
|
523
523
|
schema?: string;
|
|
524
524
|
providers?: InlineProvidersConfig;
|
|
525
525
|
};
|
|
526
|
-
declare function validateLLMOpsConfig(config
|
|
526
|
+
declare function validateLLMOpsConfig(config?: unknown): ValidatedLLMOpsConfig;
|
|
527
527
|
//#endregion
|
|
528
528
|
//#region src/types/helper.d.ts
|
|
529
529
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -617,7 +617,7 @@ const providersConfigSchema = array(inlineProviderConfigSchema).optional();
|
|
|
617
617
|
*/
|
|
618
618
|
const llmopsConfigBaseSchema = object({
|
|
619
619
|
database: any().optional(),
|
|
620
|
-
basePath: string().min(1, "Base path
|
|
620
|
+
basePath: string().min(1, "Base path cannot be empty").refine((path$1) => path$1.startsWith("/"), "Base path must start with a forward slash").default("/llmops"),
|
|
621
621
|
schema: string().optional().default("llmops"),
|
|
622
622
|
providers: providersConfigSchema
|
|
623
623
|
});
|
|
@@ -626,7 +626,7 @@ const llmopsConfigSchema = llmopsConfigBaseSchema.transform((config) => ({
|
|
|
626
626
|
providers: mergeWithDefaultProviders(config.providers)
|
|
627
627
|
})).refine((config) => config.database !== void 0 || config.providers && config.providers.length > 0, "Either database or providers must be configured. Set a database connection, configure providers explicitly, or set API key environment variables (e.g., OPENAI_API_KEY).");
|
|
628
628
|
function validateLLMOpsConfig(config) {
|
|
629
|
-
const result = llmopsConfigSchema.safeParse(config);
|
|
629
|
+
const result = llmopsConfigSchema.safeParse(config ?? {});
|
|
630
630
|
if (!result.success) {
|
|
631
631
|
const errorMessages = result.error.issues.map((err) => `${err.path.join(".")}: ${err.message}`).join("\n");
|
|
632
632
|
throw new Error(`LLMOps configuration validation failed:\n${errorMessages}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llmops/core",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Core LLMOps functionality and utilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"kysely": "^0.28.8",
|
|
56
56
|
"kysely-neon": "^2.0.2",
|
|
57
57
|
"pino": "^10.1.0",
|
|
58
|
-
"@llmops/gateway": "^0.5.
|
|
58
|
+
"@llmops/gateway": "^0.5.2"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/json-logic-js": "^2.0.8",
|