@absolutejs/absolute 0.19.0-beta.523 → 0.19.0-beta.525

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/ai/index.js CHANGED
@@ -5208,6 +5208,82 @@ var buildGroundingDifficultyDiffEntry = (current, previous) => ({
5208
5208
  previousRank: previous?.rank,
5209
5209
  query: current.query
5210
5210
  });
5211
+ var buildRAGAnswerGroundingCaseDifficultyTrends = ({
5212
+ runs
5213
+ }) => {
5214
+ const movementCounts = new Map;
5215
+ for (let index = 0;index < runs.length - 1; index += 1) {
5216
+ const current = runs[index];
5217
+ const previous = runs[index + 1];
5218
+ if (!current || !previous) {
5219
+ continue;
5220
+ }
5221
+ const diff = buildRAGAnswerGroundingCaseDifficultyRunDiff({
5222
+ current,
5223
+ previous
5224
+ });
5225
+ for (const entry of diff.harderCases) {
5226
+ const currentCounts = movementCounts.get(entry.caseId) ?? {
5227
+ easier: 0,
5228
+ harder: 0,
5229
+ label: entry.label,
5230
+ unchanged: 0
5231
+ };
5232
+ currentCounts.harder += 1;
5233
+ currentCounts.label ??= entry.label;
5234
+ movementCounts.set(entry.caseId, currentCounts);
5235
+ }
5236
+ for (const entry of diff.easierCases) {
5237
+ const currentCounts = movementCounts.get(entry.caseId) ?? {
5238
+ easier: 0,
5239
+ harder: 0,
5240
+ label: entry.label,
5241
+ unchanged: 0
5242
+ };
5243
+ currentCounts.easier += 1;
5244
+ currentCounts.label ??= entry.label;
5245
+ movementCounts.set(entry.caseId, currentCounts);
5246
+ }
5247
+ for (const entry of diff.unchangedCases) {
5248
+ const currentCounts = movementCounts.get(entry.caseId) ?? {
5249
+ easier: 0,
5250
+ harder: 0,
5251
+ label: entry.label,
5252
+ unchanged: 0
5253
+ };
5254
+ currentCounts.unchanged += 1;
5255
+ currentCounts.label ??= entry.label;
5256
+ movementCounts.set(entry.caseId, currentCounts);
5257
+ }
5258
+ }
5259
+ const movementEntries = [...movementCounts.entries()];
5260
+ const mostOftenHarderCaseIds = movementEntries.filter(([, counts]) => counts.harder > 0).sort((left, right) => {
5261
+ if (right[1].harder !== left[1].harder) {
5262
+ return right[1].harder - left[1].harder;
5263
+ }
5264
+ return left[0].localeCompare(right[0]);
5265
+ }).map(([caseId]) => caseId);
5266
+ const mostOftenEasierCaseIds = movementEntries.filter(([, counts]) => counts.easier > 0).sort((left, right) => {
5267
+ if (right[1].easier !== left[1].easier) {
5268
+ return right[1].easier - left[1].easier;
5269
+ }
5270
+ return left[0].localeCompare(right[0]);
5271
+ }).map(([caseId]) => caseId);
5272
+ return {
5273
+ easiestCaseIds: runs[runs.length - 1]?.entries.map((entry) => entry.caseId).reverse() ?? [],
5274
+ hardestCaseIds: runs[0]?.entries.map((entry) => entry.caseId) ?? [],
5275
+ mostOftenEasierCaseIds,
5276
+ mostOftenHarderCaseIds,
5277
+ movementCounts: Object.fromEntries(movementEntries.map(([caseId, counts]) => [
5278
+ caseId,
5279
+ {
5280
+ easier: counts.easier,
5281
+ harder: counts.harder,
5282
+ unchanged: counts.unchanged
5283
+ }
5284
+ ]))
5285
+ };
5286
+ };
5211
5287
  var buildRAGAnswerGroundingCaseDifficultyRunDiff = ({
5212
5288
  current,
5213
5289
  previous
@@ -5255,18 +5331,30 @@ var buildGroundingCaseDiff = (currentCase, previousCase) => ({
5255
5331
  answerChanged: typeof previousCase?.answer === "string" ? previousCase.answer !== currentCase.answer : true,
5256
5332
  caseId: currentCase.caseId,
5257
5333
  currentCitationF1: currentCase.citationF1,
5334
+ currentCitedIds: currentCase.citedIds,
5258
5335
  currentCoverage: currentCase.coverage,
5336
+ currentExtraIds: currentCase.extraIds,
5259
5337
  currentMatchedIds: currentCase.matchedIds,
5260
5338
  currentMissingIds: currentCase.missingIds,
5339
+ currentReferenceCount: currentCase.referenceCount,
5340
+ currentResolvedCitationCount: currentCase.resolvedCitationCount,
5261
5341
  currentAnswer: currentCase.answer,
5262
5342
  currentStatus: currentCase.status,
5343
+ currentUngroundedReferenceNumbers: currentCase.groundedAnswer.ungroundedReferenceNumbers,
5344
+ currentUnresolvedCitationCount: currentCase.unresolvedCitationCount,
5263
5345
  label: currentCase.label,
5264
5346
  previousAnswer: previousCase?.answer,
5265
5347
  previousCitationF1: previousCase?.citationF1,
5348
+ previousCitedIds: previousCase?.citedIds ?? [],
5266
5349
  previousCoverage: previousCase?.coverage,
5350
+ previousExtraIds: previousCase?.extraIds ?? [],
5267
5351
  previousMatchedIds: previousCase?.matchedIds ?? [],
5268
5352
  previousMissingIds: previousCase?.missingIds ?? [],
5353
+ previousReferenceCount: previousCase?.referenceCount,
5354
+ previousResolvedCitationCount: previousCase?.resolvedCitationCount,
5269
5355
  previousStatus: previousCase?.status,
5356
+ previousUngroundedReferenceNumbers: previousCase?.groundedAnswer.ungroundedReferenceNumbers ?? [],
5357
+ previousUnresolvedCitationCount: previousCase?.unresolvedCitationCount,
5270
5358
  query: currentCase.query
5271
5359
  });
5272
5360
  var buildGroundingCaseSnapshots = ({
@@ -5283,7 +5371,9 @@ var buildGroundingCaseSnapshots = ({
5283
5371
  answer: entry.answer,
5284
5372
  answerChange: typeof previousCase?.answer === "string" ? previousCase.answer === entry.answer ? "unchanged" : "changed" : "new",
5285
5373
  caseId: entry.caseId,
5374
+ citationCount: entry.citationCount,
5286
5375
  citationF1: entry.citationF1,
5376
+ citedIds: entry.citedIds,
5287
5377
  coverage: entry.coverage,
5288
5378
  extraIds: entry.extraIds,
5289
5379
  label: entry.label,
@@ -5291,8 +5381,12 @@ var buildGroundingCaseSnapshots = ({
5291
5381
  missingIds: entry.missingIds,
5292
5382
  previousAnswer: previousCase?.answer,
5293
5383
  query: entry.query,
5384
+ referenceCount: entry.referenceCount,
5385
+ resolvedCitationCount: entry.resolvedCitationCount,
5294
5386
  resolvedCitationRate: entry.resolvedCitationRate,
5295
- status: entry.status
5387
+ status: entry.status,
5388
+ ungroundedReferenceNumbers: entry.groundedAnswer.ungroundedReferenceNumbers,
5389
+ unresolvedCitationCount: entry.unresolvedCitationCount
5296
5390
  };
5297
5391
  });
5298
5392
  };
@@ -5528,7 +5622,8 @@ var loadRAGAnswerGroundingCaseDifficultyHistory = async ({
5528
5622
  previousRun,
5529
5623
  runs,
5530
5624
  suiteId: suite.id,
5531
- suiteLabel: suite.label ?? suite.id
5625
+ suiteLabel: suite.label ?? suite.id,
5626
+ trends: buildRAGAnswerGroundingCaseDifficultyTrends({ runs })
5532
5627
  };
5533
5628
  };
5534
5629
  var persistRAGEvaluationSuiteRun = async ({
@@ -11012,5 +11107,5 @@ export {
11012
11107
  aiChat
11013
11108
  };
11014
11109
 
11015
- //# debugId=6BA83464C7071EAD64756E2164756E21
11110
+ //# debugId=601251A55B5F4DCE64756E2164756E21
11016
11111
  //# sourceMappingURL=index.js.map