@absolutejs/absolute 0.19.0-beta.538 → 0.19.0-beta.539

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.
@@ -2287,8 +2287,11 @@ var buildEvaluationCaseTraceSnapshots = ({
2287
2287
  };
2288
2288
  var getStatusRank = (status) => status === "pass" ? 2 : status === "partial" ? 1 : 0;
2289
2289
  var formatSignedDelta = (value, decimals = 0, suffix = "") => `${value >= 0 ? "+" : ""}${value.toFixed(decimals)}${suffix}`;
2290
+ var formatEvaluationPassingRate = (value) => `${value.toFixed(1)}%`;
2290
2291
  var formatEvaluationSummary = (response) => `${response.summary.passedCases}/${response.totalCases} pass \xB7 f1 ${response.summary.averageF1.toFixed(3)} \xB7 latency ${response.summary.averageLatencyMs.toFixed(1)}ms`;
2292
+ var formatGroundingHistorySummaryValue = (response) => `${response.summary.passedCases}/${response.summary.totalCases} pass \xB7 grounded ${response.summary.groundedCases} \xB7 partial ${response.summary.partialCases} \xB7 ungrounded ${response.summary.ungroundedCases} \xB7 resolved citations ${(response.summary.averageResolvedCitationRate * 100).toFixed(1)}% \xB7 citation f1 ${response.summary.averageCitationF1.toFixed(3)}`;
2291
2293
  var formatHistoryCaseLabels = (cases) => cases.length > 0 ? cases.map((entry) => entry.label ?? entry.caseId).join(", ") : "none";
2294
+ var formatGroundingHistoryCaseLabels = (cases) => cases.length > 0 ? cases.map((entry) => entry.label ?? entry.caseId).join(", ") : "none";
2292
2295
  var formatTraceModes = (modes) => modes.length > 0 ? modes.join(" / ") : "n/a";
2293
2296
  var formatTraceStageSummary = (stageCounts) => {
2294
2297
  const topStages = Object.entries(stageCounts).sort((left, right) => right[1] - left[1]).slice(0, 3);
@@ -2511,6 +2514,11 @@ var buildRAGEvaluationCaseTracePresentations = (history) => {
2511
2514
  };
2512
2515
  });
2513
2516
  };
2517
+ var buildRAGEvaluationHistoryPresentation = (history) => ({
2518
+ caseTraces: buildRAGEvaluationCaseTracePresentations(history),
2519
+ rows: buildRAGEvaluationHistoryRows(history),
2520
+ summary: history?.latestRun ? history.latestRun.label : "No persisted benchmark runs yet."
2521
+ });
2514
2522
  var buildRAGEvaluationRunDiff = ({
2515
2523
  current,
2516
2524
  previous
@@ -2642,6 +2650,66 @@ var buildRAGAnswerGroundingCaseSnapshotPresentations = (history) => {
2642
2650
  };
2643
2651
  });
2644
2652
  };
2653
+ var buildRAGAnswerGroundingHistoryRows = (history) => {
2654
+ if (!history?.latestRun) {
2655
+ return [{ label: "History", value: "No persisted provider runs yet." }];
2656
+ }
2657
+ const rows = [
2658
+ { label: "Runs recorded", value: String(history.runs.length) },
2659
+ {
2660
+ label: "Latest",
2661
+ value: `${history.latestRun.label} \xB7 ${formatGroundingHistorySummaryValue(history.latestRun.response)}`
2662
+ }
2663
+ ];
2664
+ if (history.previousRun) {
2665
+ rows.push({
2666
+ label: "Previous",
2667
+ value: `${history.previousRun.label} \xB7 ${formatGroundingHistorySummaryValue(history.previousRun.response)}`
2668
+ });
2669
+ }
2670
+ if (history.leaderboard[0]) {
2671
+ rows.push({
2672
+ label: "Best recorded",
2673
+ value: `#${history.leaderboard[0].rank} \xB7 ${history.leaderboard[0].label} \xB7 passing ${formatEvaluationPassingRate(history.leaderboard[0].passingRate)} \xB7 citation f1 ${history.leaderboard[0].averageCitationF1.toFixed(3)} \xB7 resolved ${formatEvaluationPassingRate(history.leaderboard[0].averageResolvedCitationRate)}`
2674
+ });
2675
+ }
2676
+ if (history.caseSnapshots.length > 0) {
2677
+ const changedAnswers = history.caseSnapshots.filter((entry) => entry.answerChange === "changed").length;
2678
+ rows.push({
2679
+ label: "Answer drift",
2680
+ value: `${changedAnswers}/${history.caseSnapshots.length} changed`
2681
+ });
2682
+ }
2683
+ if (!history.diff) {
2684
+ rows.push({
2685
+ label: "History diff",
2686
+ value: "Run the provider comparison again to diff grounding regressions over time."
2687
+ });
2688
+ return rows;
2689
+ }
2690
+ rows.push({
2691
+ label: "Passing delta",
2692
+ value: formatSignedDelta(history.diff.summaryDelta.passingRate, 1, "%")
2693
+ }, {
2694
+ label: "Citation F1 delta",
2695
+ value: formatSignedDelta(history.diff.summaryDelta.averageCitationF1, 3)
2696
+ }, {
2697
+ label: "Resolved citation delta",
2698
+ value: formatSignedDelta(history.diff.summaryDelta.averageResolvedCitationRate * 100, 1, "%")
2699
+ }, {
2700
+ label: "Improved",
2701
+ value: formatGroundingHistoryCaseLabels(history.diff.improvedCases)
2702
+ }, {
2703
+ label: "Regressed",
2704
+ value: formatGroundingHistoryCaseLabels(history.diff.regressedCases)
2705
+ });
2706
+ return rows;
2707
+ };
2708
+ var buildRAGAnswerGroundingHistoryPresentation = (history) => ({
2709
+ caseSnapshots: buildRAGAnswerGroundingCaseSnapshotPresentations(history),
2710
+ rows: buildRAGAnswerGroundingHistoryRows(history),
2711
+ summary: history?.latestRun ? history.latestRun.label : "No persisted provider runs yet."
2712
+ });
2645
2713
  var createRAGFileEvaluationHistoryStore = (path) => ({
2646
2714
  listRuns: async ({ limit, suiteId } = {}) => {
2647
2715
  let parsed = [];
@@ -4113,5 +4181,5 @@ export {
4113
4181
  AIStreamProvider
4114
4182
  };
4115
4183
 
4116
- //# debugId=0CA1C6598EBB5C6564756E2164756E21
4184
+ //# debugId=7E7C7A3FF0EFC10564756E2164756E21
4117
4185
  //# sourceMappingURL=index.js.map