@llmops/core 0.6.7-beta.3 → 0.6.7

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.mjs CHANGED
@@ -2066,7 +2066,8 @@ const costSummarySchema = zod_default.object({
2066
2066
  variantId: zod_default.string().uuid().optional(),
2067
2067
  environmentId: zod_default.string().uuid().optional(),
2068
2068
  tags: zod_default.record(zod_default.string(), zod_default.array(zod_default.string())).optional(),
2069
- groupBy: zod_default.enum(COST_SUMMARY_GROUP_BY).optional()
2069
+ groupBy: zod_default.enum(COST_SUMMARY_GROUP_BY).optional(),
2070
+ tagKeys: zod_default.array(zod_default.string()).optional()
2070
2071
  });
2071
2072
  /**
2072
2073
  * Helper to create column reference for SQL
@@ -2282,7 +2283,7 @@ const createLLMRequestsDataLayer = (db) => {
2282
2283
  getCostSummary: async (params) => {
2283
2284
  const result = await costSummarySchema.safeParseAsync(params);
2284
2285
  if (!result.success) throw new LLMOpsError(`Invalid parameters: ${result.error.message}`);
2285
- const { startDate, endDate, groupBy, configId, variantId, environmentId, tags } = result.data;
2286
+ const { startDate, endDate, groupBy, configId, variantId, environmentId, tags, tagKeys } = result.data;
2286
2287
  let baseQuery = db.selectFrom("llm_requests").where(sql`${col$1("createdAt")} >= ${startDate.toISOString()}`).where(sql`${col$1("createdAt")} <= ${endDate.toISOString()}`);
2287
2288
  if (configId) baseQuery = baseQuery.where("configId", "=", configId);
2288
2289
  if (variantId) baseQuery = baseQuery.where("variantId", "=", variantId);
@@ -2341,6 +2342,10 @@ const createLLMRequestsDataLayer = (db) => {
2341
2342
  conditions.push(sql`${col$1("tags")}->>${key} IN (${valueList})`);
2342
2343
  }
2343
2344
  }
2345
+ if (tagKeys && tagKeys.length > 0) {
2346
+ const tagKeyList = sql.join(tagKeys.map((k) => sql`${k}`), sql`, `);
2347
+ conditions.push(sql`t.key IN (${tagKeyList})`);
2348
+ }
2344
2349
  const whereClause = sql.join(conditions, sql` AND `);
2345
2350
  return (await sql`
2346
2351
  SELECT t.key || ':' || t.value as "groupKey",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llmops/core",
3
- "version": "0.6.7-beta.3",
3
+ "version": "0.6.7",
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.6.7-beta.3"
58
+ "@llmops/gateway": "^0.6.7"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@types/json-logic-js": "^2.0.8",