@llmops/core 0.1.7 → 0.1.8
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-CzGmPK4Q.d.mts → index-CCfvTBvD.d.cts} +25 -25
- package/dist/{index-dC_m_WTU.d.cts → index-fgiyw393.d.mts} +25 -25
- package/dist/index.cjs +4 -23
- package/dist/index.d.cts +395 -395
- package/dist/index.d.mts +395 -395
- package/dist/index.mjs +4 -23
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1592,26 +1592,10 @@ const createLLMRequestsDataLayer = (db) => {
|
|
|
1592
1592
|
const result = await listRequestsSchema.safeParseAsync(params || {});
|
|
1593
1593
|
if (!result.success) throw new LLMOpsError(`Invalid parameters: ${result.error.message}`);
|
|
1594
1594
|
const { limit, offset, configId, variantId, environmentId, provider, model, startDate, endDate, tags } = result.data;
|
|
1595
|
-
console.log("[listRequests] Parsed filters:", {
|
|
1596
|
-
configId,
|
|
1597
|
-
variantId,
|
|
1598
|
-
environmentId,
|
|
1599
|
-
provider,
|
|
1600
|
-
model
|
|
1601
|
-
});
|
|
1602
1595
|
let baseQuery = db.selectFrom("llm_requests");
|
|
1603
|
-
if (configId)
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
}
|
|
1607
|
-
if (variantId) {
|
|
1608
|
-
console.log("[listRequests] Adding variantId filter:", variantId);
|
|
1609
|
-
baseQuery = baseQuery.where("variantId", "=", variantId);
|
|
1610
|
-
}
|
|
1611
|
-
if (environmentId) {
|
|
1612
|
-
console.log("[listRequests] Adding environmentId filter:", environmentId);
|
|
1613
|
-
baseQuery = baseQuery.where("environmentId", "=", environmentId);
|
|
1614
|
-
}
|
|
1596
|
+
if (configId) baseQuery = baseQuery.where("configId", "=", configId);
|
|
1597
|
+
if (variantId) baseQuery = baseQuery.where("variantId", "=", variantId);
|
|
1598
|
+
if (environmentId) baseQuery = baseQuery.where("environmentId", "=", environmentId);
|
|
1615
1599
|
if (provider) baseQuery = baseQuery.where("provider", "=", provider);
|
|
1616
1600
|
if (model) baseQuery = baseQuery.where("model", "=", model);
|
|
1617
1601
|
if (startDate) baseQuery = baseQuery.where(sql`${col("createdAt")} >= ${startDate.toISOString()}`);
|
|
@@ -1624,10 +1608,7 @@ const createLLMRequestsDataLayer = (db) => {
|
|
|
1624
1608
|
baseQuery = baseQuery.where(sql`${col("tags")}->>${key} IN (${valueList})`);
|
|
1625
1609
|
}
|
|
1626
1610
|
}
|
|
1627
|
-
const
|
|
1628
|
-
console.log("[listRequests] Count SQL:", countQuery.compile().sql);
|
|
1629
|
-
console.log("[listRequests] Count params:", countQuery.compile().parameters);
|
|
1630
|
-
const countResult = await countQuery.executeTakeFirst();
|
|
1611
|
+
const countResult = await baseQuery.select(sql`COUNT(*)`.as("total")).executeTakeFirst();
|
|
1631
1612
|
const total = Number(countResult?.total ?? 0);
|
|
1632
1613
|
return {
|
|
1633
1614
|
data: await baseQuery.selectAll().orderBy("createdAt", "desc").limit(limit).offset(offset).execute(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llmops/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Core LLMOps functionality and utilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"hono": "^4.10.7",
|
|
52
52
|
"kysely": "^0.28.8",
|
|
53
53
|
"pino": "^10.1.0",
|
|
54
|
-
"@llmops/gateway": "^0.1.
|
|
54
|
+
"@llmops/gateway": "^0.1.8"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "tsdown",
|