@absolutejs/absolute 0.19.0-beta.519 → 0.19.0-beta.520

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
@@ -5147,18 +5147,50 @@ var buildCaseDiff = (currentCase, previousCase) => ({
5147
5147
  query: currentCase.query
5148
5148
  });
5149
5149
  var buildGroundingCaseDiff = (currentCase, previousCase) => ({
5150
+ answerChanged: typeof previousCase?.answer === "string" ? previousCase.answer !== currentCase.answer : true,
5150
5151
  caseId: currentCase.caseId,
5151
5152
  currentCitationF1: currentCase.citationF1,
5153
+ currentCoverage: currentCase.coverage,
5152
5154
  currentMatchedIds: currentCase.matchedIds,
5153
5155
  currentMissingIds: currentCase.missingIds,
5156
+ currentAnswer: currentCase.answer,
5154
5157
  currentStatus: currentCase.status,
5155
5158
  label: currentCase.label,
5159
+ previousAnswer: previousCase?.answer,
5156
5160
  previousCitationF1: previousCase?.citationF1,
5161
+ previousCoverage: previousCase?.coverage,
5157
5162
  previousMatchedIds: previousCase?.matchedIds ?? [],
5158
5163
  previousMissingIds: previousCase?.missingIds ?? [],
5159
5164
  previousStatus: previousCase?.status,
5160
5165
  query: currentCase.query
5161
5166
  });
5167
+ var buildGroundingCaseSnapshots = ({
5168
+ current,
5169
+ previous
5170
+ }) => {
5171
+ if (!current) {
5172
+ return [];
5173
+ }
5174
+ const previousCases = new Map((previous?.response.cases ?? []).map((entry) => [entry.caseId, entry]));
5175
+ return current.response.cases.map((entry) => {
5176
+ const previousCase = previousCases.get(entry.caseId);
5177
+ return {
5178
+ answer: entry.answer,
5179
+ answerChange: typeof previousCase?.answer === "string" ? previousCase.answer === entry.answer ? "unchanged" : "changed" : "new",
5180
+ caseId: entry.caseId,
5181
+ citationF1: entry.citationF1,
5182
+ coverage: entry.coverage,
5183
+ extraIds: entry.extraIds,
5184
+ label: entry.label,
5185
+ matchedIds: entry.matchedIds,
5186
+ missingIds: entry.missingIds,
5187
+ previousAnswer: previousCase?.answer,
5188
+ query: entry.query,
5189
+ resolvedCitationRate: entry.resolvedCitationRate,
5190
+ status: entry.status
5191
+ };
5192
+ });
5193
+ };
5162
5194
  var getStatusRank = (status) => status === "pass" ? 2 : status === "partial" ? 1 : 0;
5163
5195
  var buildRAGEvaluationRunDiff = ({
5164
5196
  current,
@@ -5319,6 +5351,10 @@ var loadRAGAnswerGroundingEvaluationHistory = async ({
5319
5351
  const latestRun = runs[0];
5320
5352
  const previousRun = runs[1];
5321
5353
  return {
5354
+ caseSnapshots: buildGroundingCaseSnapshots({
5355
+ current: latestRun,
5356
+ previous: previousRun
5357
+ }),
5322
5358
  diff: latestRun && previousRun ? buildRAGAnswerGroundingEvaluationRunDiff({
5323
5359
  current: latestRun,
5324
5360
  previous: previousRun
@@ -10800,5 +10836,5 @@ export {
10800
10836
  aiChat
10801
10837
  };
10802
10838
 
10803
- //# debugId=100847E6C5E33ADB64756E2164756E21
10839
+ //# debugId=ECF363055286173764756E2164756E21
10804
10840
  //# sourceMappingURL=index.js.map