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

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.
@@ -936,6 +936,16 @@ export type RAGAnswerGroundingEvaluationHistoryStore = {
936
936
  limit?: number;
937
937
  }) => Promise<RAGAnswerGroundingEvaluationRun[]> | RAGAnswerGroundingEvaluationRun[];
938
938
  };
939
+ export type RAGAnswerGroundingEvaluationLeaderboardEntry = {
940
+ runId: string;
941
+ suiteId: string;
942
+ label: string;
943
+ passingRate: number;
944
+ averageCitationF1: number;
945
+ averageResolvedCitationRate: number;
946
+ rank: number;
947
+ totalCases: number;
948
+ };
939
949
  export type RAGAnswerGroundingEvaluationCaseDiff = {
940
950
  caseId: string;
941
951
  label?: string;
@@ -969,6 +979,7 @@ export type RAGAnswerGroundingEvaluationHistory = {
969
979
  suiteId: string;
970
980
  suiteLabel?: string;
971
981
  runs: RAGAnswerGroundingEvaluationRun[];
982
+ leaderboard: RAGAnswerGroundingEvaluationLeaderboardEntry[];
972
983
  latestRun?: RAGAnswerGroundingEvaluationRun;
973
984
  previousRun?: RAGAnswerGroundingEvaluationRun;
974
985
  diff?: RAGAnswerGroundingEvaluationRunDiff;
@@ -1716,6 +1716,30 @@ var buildRAGEvaluationLeaderboard = (runs) => {
1716
1716
  totalCases: run.response.totalCases
1717
1717
  }));
1718
1718
  };
1719
+ var buildRAGAnswerGroundingEvaluationLeaderboard = (runs) => {
1720
+ const sorted = [...runs].sort((left, right) => {
1721
+ if (right.response.passingRate !== left.response.passingRate) {
1722
+ return right.response.passingRate - left.response.passingRate;
1723
+ }
1724
+ if (right.response.summary.averageCitationF1 !== left.response.summary.averageCitationF1) {
1725
+ return right.response.summary.averageCitationF1 - left.response.summary.averageCitationF1;
1726
+ }
1727
+ if (right.response.summary.averageResolvedCitationRate !== left.response.summary.averageResolvedCitationRate) {
1728
+ return right.response.summary.averageResolvedCitationRate - left.response.summary.averageResolvedCitationRate;
1729
+ }
1730
+ return left.elapsedMs - right.elapsedMs;
1731
+ });
1732
+ return sorted.map((run, index) => ({
1733
+ averageCitationF1: run.response.summary.averageCitationF1,
1734
+ averageResolvedCitationRate: run.response.summary.averageResolvedCitationRate,
1735
+ label: run.label,
1736
+ passingRate: run.response.passingRate,
1737
+ rank: index + 1,
1738
+ runId: run.id,
1739
+ suiteId: run.suiteId,
1740
+ totalCases: run.response.totalCases
1741
+ }));
1742
+ };
1719
1743
  var toHistorySortOrder = (left, right) => right.finishedAt - left.finishedAt;
1720
1744
  var normalizeHistoryRuns = (runs) => [...runs].sort(toHistorySortOrder);
1721
1745
  var toGroundingHistorySortOrder = (left, right) => right.finishedAt - left.finishedAt;
@@ -1911,6 +1935,7 @@ var loadRAGAnswerGroundingEvaluationHistory = async ({
1911
1935
  previous: previousRun
1912
1936
  }) : undefined,
1913
1937
  latestRun,
1938
+ leaderboard: buildRAGAnswerGroundingEvaluationLeaderboard(runs),
1914
1939
  previousRun,
1915
1940
  runs,
1916
1941
  suiteId: suite.id,
@@ -2947,5 +2972,5 @@ export {
2947
2972
  AIStreamKey
2948
2973
  };
2949
2974
 
2950
- //# debugId=9275DFD130B50DC164756E2164756E21
2975
+ //# debugId=CE780A331BCCEACE64756E2164756E21
2951
2976
  //# sourceMappingURL=index.js.map