@llmops/core 0.2.11-beta.4 → 0.2.12-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.
- package/dist/{bun-sqlite-dialect-DLqPd3F0.cjs → bun-sqlite-dialect-Bxz4B97L.cjs} +1 -2
- package/dist/{bun-sqlite-dialect-BiyQ5XmW.mjs → bun-sqlite-dialect-CHpTFgAo.mjs} +0 -1
- package/dist/db/index.cjs +4 -10
- package/dist/db/index.d.cts +2 -2
- package/dist/db/index.d.mts +2 -2
- package/dist/db/index.mjs +3 -4
- package/dist/{db-BIiDmOuQ.cjs → db-BOe6mM51.cjs} +94 -63
- package/dist/{db-CEHt_ysR.mjs → db-DohlAqJU.mjs} +94 -63
- package/dist/{index-C66pTe1n.d.cts → index-BO5Rse5J.d.mts} +60 -43
- package/dist/{index-BX96l072.d.mts → index-DwZhaRvQ.d.cts} +25 -8
- package/dist/index.cjs +5 -14
- package/dist/index.d.cts +226 -226
- package/dist/index.d.mts +493 -493
- package/dist/index.mjs +4 -8
- package/dist/neon-dialect-BQey5lUw.cjs +42 -0
- package/dist/neon-dialect-C0GZuGot.cjs +3 -0
- package/dist/neon-dialect-DySGBYUi.mjs +30 -0
- package/dist/neon-dialect-Hmo08nUq.mjs +3 -0
- package/dist/{node-sqlite-dialect-B3Mejscr.mjs → node-sqlite-dialect-B5oKhOm1.mjs} +0 -1
- package/dist/{node-sqlite-dialect-HRKgk8Ae.cjs → node-sqlite-dialect-N8j5UsT-.cjs} +1 -2
- package/package.json +7 -4
- package/dist/neon-dialect-C8y4ymaE.mjs +0 -4
- package/dist/neon-dialect-CTFuNy48.mjs +0 -4
- package/dist/neon-dialect-eEOfdvtN.cjs +0 -11
- package/dist/neon-dialect-js5JsNqM.cjs +0 -2
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { t as NeonDialect } from "./neon-dialect-C8y4ymaE.mjs";
|
|
1
|
+
import { A as literal, C as variantsSchema, D as any, E as _enum, F as union, I as unknown, M as object, N as record, O as array, P as string, S as variantVersionsSchema, T as zod_default, _ as environmentsSchema, a as matchType, b as schemas, c as logger, d as validatePartialTableData, f as validateTableData, g as environmentSecretsSchema, h as configsSchema, i as getMigrations, j as number, k as boolean, l as parsePartialTableData, m as configVariantsSchema, n as createDatabaseFromConnection, o as runAutoMigrations, p as SCHEMA_METADATA, r as detectDatabaseType, s as getAuthClientOptions, t as createDatabase, u as parseTableData, v as llmRequestsSchema, w as workspaceSettingsSchema, x as targetingRulesSchema, y as providerConfigsSchema } from "./db-DohlAqJU.mjs";
|
|
2
|
+
import { n as executeWithSchema, t as createNeonDialect } from "./neon-dialect-DySGBYUi.mjs";
|
|
4
3
|
import gateway from "@llmops/gateway";
|
|
5
4
|
import { sql } from "kysely";
|
|
6
5
|
import * as fs from "node:fs/promises";
|
|
@@ -838,10 +837,7 @@ var CacheService = class {
|
|
|
838
837
|
}
|
|
839
838
|
createBackend(config) {
|
|
840
839
|
switch (config.backend) {
|
|
841
|
-
case "memory": return new MemoryCacheBackend(
|
|
842
|
-
maxSize: config.maxSize,
|
|
843
|
-
cleanupIntervalMs: config.cleanupInterval
|
|
844
|
-
});
|
|
840
|
+
case "memory": return new MemoryCacheBackend(config.maxSize, config.cleanupInterval);
|
|
845
841
|
case "file": return new FileCacheBackend(config.dataDir, config.fileName, config.saveInterval, config.cleanupInterval);
|
|
846
842
|
default: throw new Error(`Unsupported cache backend: ${config.backend}`);
|
|
847
843
|
}
|
|
@@ -2582,4 +2578,4 @@ function getDefaultPricingProvider() {
|
|
|
2582
2578
|
}
|
|
2583
2579
|
|
|
2584
2580
|
//#endregion
|
|
2585
|
-
export { CacheService, FileCacheBackend, MS, MemoryCacheBackend, ModelsDevPricingProvider,
|
|
2581
|
+
export { CacheService, FileCacheBackend, MS, MemoryCacheBackend, ModelsDevPricingProvider, SCHEMA_METADATA, SupportedProviders, calculateCost, chatCompletionCreateParamsBaseSchema, configVariantsSchema, configsSchema, createDataLayer, createDatabase, createDatabaseFromConnection, createLLMRequestsDataLayer, createNeonDialect, createProviderConfigsDataLayer, createWorkspaceSettingsDataLayer, detectDatabaseType, dollarsToMicroDollars, environmentSecretsSchema, environmentsSchema, executeWithSchema, formatCost, gateway, generateId, getAuthClientOptions, getDefaultPricingProvider, getMigrations, llmRequestsSchema, llmopsConfigSchema, logger, matchType, microDollarsToDollars, parsePartialTableData, parseTableData, providerConfigsSchema, runAutoMigrations, schemas, targetingRulesSchema, validateLLMOpsConfig, validatePartialTableData, validateTableData, variantJsonDataSchema, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const require_db = require('./db-BOe6mM51.cjs');
|
|
2
|
+
let kysely_neon = require("kysely-neon");
|
|
3
|
+
require("@neondatabase/serverless");
|
|
4
|
+
|
|
5
|
+
//#region src/db/neon-dialect.ts
|
|
6
|
+
/**
|
|
7
|
+
* Create a Neon serverless dialect for Kysely
|
|
8
|
+
*
|
|
9
|
+
* @param neonInstance - Neon database query function
|
|
10
|
+
* @returns Kysely dialect configured for Neon serverless
|
|
11
|
+
*/
|
|
12
|
+
function createNeonDialect(neonInstance) {
|
|
13
|
+
return new kysely_neon.NeonDialect({ neon: neonInstance });
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Execute a query with search_path set for Neon serverless
|
|
17
|
+
*
|
|
18
|
+
* @param neonInstance - Neon database query function
|
|
19
|
+
* @param query - SQL query to execute
|
|
20
|
+
* @param schema - Schema to set (optional)
|
|
21
|
+
* @returns Query result
|
|
22
|
+
*/
|
|
23
|
+
async function executeWithSchema(neonInstance, query, schema) {
|
|
24
|
+
if (schema && schema !== "public") try {
|
|
25
|
+
await neonInstance`SET search_path TO ${schema}`;
|
|
26
|
+
} catch (error) {}
|
|
27
|
+
return neonInstance(query);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
Object.defineProperty(exports, 'createNeonDialect', {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () {
|
|
34
|
+
return createNeonDialect;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(exports, 'executeWithSchema', {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function () {
|
|
40
|
+
return executeWithSchema;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { NeonDialect } from "kysely-neon";
|
|
2
|
+
import "@neondatabase/serverless";
|
|
3
|
+
|
|
4
|
+
//#region src/db/neon-dialect.ts
|
|
5
|
+
/**
|
|
6
|
+
* Create a Neon serverless dialect for Kysely
|
|
7
|
+
*
|
|
8
|
+
* @param neonInstance - Neon database query function
|
|
9
|
+
* @returns Kysely dialect configured for Neon serverless
|
|
10
|
+
*/
|
|
11
|
+
function createNeonDialect(neonInstance) {
|
|
12
|
+
return new NeonDialect({ neon: neonInstance });
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Execute a query with search_path set for Neon serverless
|
|
16
|
+
*
|
|
17
|
+
* @param neonInstance - Neon database query function
|
|
18
|
+
* @param query - SQL query to execute
|
|
19
|
+
* @param schema - Schema to set (optional)
|
|
20
|
+
* @returns Query result
|
|
21
|
+
*/
|
|
22
|
+
async function executeWithSchema(neonInstance, query, schema) {
|
|
23
|
+
if (schema && schema !== "public") try {
|
|
24
|
+
await neonInstance`SET search_path TO ${schema}`;
|
|
25
|
+
} catch (error) {}
|
|
26
|
+
return neonInstance(query);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { executeWithSchema as n, createNeonDialect as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llmops/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12-beta.1",
|
|
4
4
|
"description": "Core LLMOps functionality and utilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -48,13 +48,16 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@better-auth/utils": "^0.3.0",
|
|
51
|
-
"@neondatabase/serverless": "^0.
|
|
51
|
+
"@neondatabase/serverless": "^1.0.2",
|
|
52
52
|
"better-auth": "^1.4.10",
|
|
53
53
|
"hono": "^4.10.7",
|
|
54
54
|
"kysely": "^0.28.8",
|
|
55
|
-
"kysely-neon": "^
|
|
55
|
+
"kysely-neon": "^2.0.2",
|
|
56
56
|
"pino": "^10.1.0",
|
|
57
|
-
"@llmops/gateway": "^0.2.
|
|
57
|
+
"@llmops/gateway": "^0.2.12-beta.1"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@types/ws": "^8.18.1"
|
|
58
61
|
},
|
|
59
62
|
"scripts": {
|
|
60
63
|
"build": "tsdown",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use node";
|
|
2
|
-
const require_db = require('./db-BIiDmOuQ.cjs');
|
|
3
|
-
require('./neon-dialect-js5JsNqM.cjs');
|
|
4
|
-
let kysely_neon = require("kysely-neon");
|
|
5
|
-
|
|
6
|
-
Object.defineProperty(exports, 'NeonDialect', {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return kysely_neon.NeonDialect;
|
|
10
|
-
}
|
|
11
|
-
});
|