@llmops/core 0.2.11 → 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-t1xHHJDz.cjs → bun-sqlite-dialect-Bxz4B97L.cjs} +1 -1
- package/dist/db/index.cjs +4 -1
- package/dist/db/index.d.cts +2 -2
- package/dist/db/index.d.mts +2 -2
- package/dist/db/index.mjs +3 -2
- package/dist/{db-CqDD6Ydv.cjs → db-BOe6mM51.cjs} +94 -57
- package/dist/{db-BGDhJROC.mjs → db-DohlAqJU.mjs} +94 -57
- package/dist/{index-BUlmWTh7.d.cts → index-BO5Rse5J.d.mts} +28 -7
- package/dist/{index-CkrtLH8W.d.mts → index-DwZhaRvQ.d.cts} +28 -7
- package/dist/index.cjs +4 -1
- package/dist/index.d.cts +493 -493
- package/dist/index.d.mts +493 -493
- package/dist/index.mjs +3 -2
- 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-D4V5e49r.cjs → node-sqlite-dialect-N8j5UsT-.cjs} +1 -1
- package/package.json +7 -2
- /package/dist/{bun-sqlite-dialect-YVmcpOaa.mjs → bun-sqlite-dialect-CHpTFgAo.mjs} +0 -0
- /package/dist/{node-sqlite-dialect-rrsskSJp.mjs → node-sqlite-dialect-B5oKhOm1.mjs} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
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-
|
|
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";
|
|
2
3
|
import gateway from "@llmops/gateway";
|
|
3
4
|
import { sql } from "kysely";
|
|
4
5
|
import * as fs from "node:fs/promises";
|
|
@@ -2577,4 +2578,4 @@ function getDefaultPricingProvider() {
|
|
|
2577
2578
|
}
|
|
2578
2579
|
|
|
2579
2580
|
//#endregion
|
|
2580
|
-
export { CacheService, FileCacheBackend, MS, MemoryCacheBackend, ModelsDevPricingProvider, SCHEMA_METADATA, SupportedProviders, calculateCost, chatCompletionCreateParamsBaseSchema, configVariantsSchema, configsSchema, createDataLayer, createDatabase, createDatabaseFromConnection, createLLMRequestsDataLayer, createProviderConfigsDataLayer, createWorkspaceSettingsDataLayer, detectDatabaseType, dollarsToMicroDollars, environmentSecretsSchema, environmentsSchema, formatCost, gateway, generateId, getAuthClientOptions, getDefaultPricingProvider, getMigrations, llmRequestsSchema, llmopsConfigSchema, logger, matchType, microDollarsToDollars, parsePartialTableData, parseTableData, providerConfigsSchema, runAutoMigrations, schemas, targetingRulesSchema, validateLLMOpsConfig, validatePartialTableData, validateTableData, variantJsonDataSchema, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
|
|
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,11 +48,16 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@better-auth/utils": "^0.3.0",
|
|
51
|
+
"@neondatabase/serverless": "^1.0.2",
|
|
51
52
|
"better-auth": "^1.4.10",
|
|
52
53
|
"hono": "^4.10.7",
|
|
53
54
|
"kysely": "^0.28.8",
|
|
55
|
+
"kysely-neon": "^2.0.2",
|
|
54
56
|
"pino": "^10.1.0",
|
|
55
|
-
"@llmops/gateway": "^0.2.
|
|
57
|
+
"@llmops/gateway": "^0.2.12-beta.1"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@types/ws": "^8.18.1"
|
|
56
61
|
},
|
|
57
62
|
"scripts": {
|
|
58
63
|
"build": "tsdown",
|
|
File without changes
|
|
File without changes
|