@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.
@@ -952,12 +952,32 @@ export type RAGAnswerGroundingEvaluationCaseDiff = {
952
952
  query?: string;
953
953
  previousStatus?: RAGAnswerGroundingEvaluationCaseResult['status'];
954
954
  currentStatus: RAGAnswerGroundingEvaluationCaseResult['status'];
955
+ previousCoverage?: RAGAnswerGroundingEvaluationCaseResult['coverage'];
956
+ currentCoverage: RAGAnswerGroundingEvaluationCaseResult['coverage'];
955
957
  previousCitationF1?: number;
956
958
  currentCitationF1: number;
957
959
  previousMatchedIds: string[];
958
960
  currentMatchedIds: string[];
959
961
  previousMissingIds: string[];
960
962
  currentMissingIds: string[];
963
+ previousAnswer?: string;
964
+ currentAnswer: string;
965
+ answerChanged: boolean;
966
+ };
967
+ export type RAGAnswerGroundingEvaluationCaseSnapshot = {
968
+ caseId: string;
969
+ label?: string;
970
+ query?: string;
971
+ status: RAGAnswerGroundingEvaluationCaseResult['status'];
972
+ coverage: RAGAnswerGroundingEvaluationCaseResult['coverage'];
973
+ citationF1: number;
974
+ resolvedCitationRate: number;
975
+ matchedIds: string[];
976
+ missingIds: string[];
977
+ extraIds: string[];
978
+ answer: string;
979
+ previousAnswer?: string;
980
+ answerChange: 'new' | 'changed' | 'unchanged';
961
981
  };
962
982
  export type RAGAnswerGroundingEvaluationRunDiff = {
963
983
  suiteId: string;
@@ -982,6 +1002,7 @@ export type RAGAnswerGroundingEvaluationHistory = {
982
1002
  leaderboard: RAGAnswerGroundingEvaluationLeaderboardEntry[];
983
1003
  latestRun?: RAGAnswerGroundingEvaluationRun;
984
1004
  previousRun?: RAGAnswerGroundingEvaluationRun;
1005
+ caseSnapshots: RAGAnswerGroundingEvaluationCaseSnapshot[];
985
1006
  diff?: RAGAnswerGroundingEvaluationRunDiff;
986
1007
  };
987
1008
  export type RAGEvaluationInput = {
@@ -1758,18 +1758,50 @@ var buildCaseDiff = (currentCase, previousCase) => ({
1758
1758
  query: currentCase.query
1759
1759
  });
1760
1760
  var buildGroundingCaseDiff = (currentCase, previousCase) => ({
1761
+ answerChanged: typeof previousCase?.answer === "string" ? previousCase.answer !== currentCase.answer : true,
1761
1762
  caseId: currentCase.caseId,
1762
1763
  currentCitationF1: currentCase.citationF1,
1764
+ currentCoverage: currentCase.coverage,
1763
1765
  currentMatchedIds: currentCase.matchedIds,
1764
1766
  currentMissingIds: currentCase.missingIds,
1767
+ currentAnswer: currentCase.answer,
1765
1768
  currentStatus: currentCase.status,
1766
1769
  label: currentCase.label,
1770
+ previousAnswer: previousCase?.answer,
1767
1771
  previousCitationF1: previousCase?.citationF1,
1772
+ previousCoverage: previousCase?.coverage,
1768
1773
  previousMatchedIds: previousCase?.matchedIds ?? [],
1769
1774
  previousMissingIds: previousCase?.missingIds ?? [],
1770
1775
  previousStatus: previousCase?.status,
1771
1776
  query: currentCase.query
1772
1777
  });
1778
+ var buildGroundingCaseSnapshots = ({
1779
+ current,
1780
+ previous
1781
+ }) => {
1782
+ if (!current) {
1783
+ return [];
1784
+ }
1785
+ const previousCases = new Map((previous?.response.cases ?? []).map((entry) => [entry.caseId, entry]));
1786
+ return current.response.cases.map((entry) => {
1787
+ const previousCase = previousCases.get(entry.caseId);
1788
+ return {
1789
+ answer: entry.answer,
1790
+ answerChange: typeof previousCase?.answer === "string" ? previousCase.answer === entry.answer ? "unchanged" : "changed" : "new",
1791
+ caseId: entry.caseId,
1792
+ citationF1: entry.citationF1,
1793
+ coverage: entry.coverage,
1794
+ extraIds: entry.extraIds,
1795
+ label: entry.label,
1796
+ matchedIds: entry.matchedIds,
1797
+ missingIds: entry.missingIds,
1798
+ previousAnswer: previousCase?.answer,
1799
+ query: entry.query,
1800
+ resolvedCitationRate: entry.resolvedCitationRate,
1801
+ status: entry.status
1802
+ };
1803
+ });
1804
+ };
1773
1805
  var getStatusRank = (status) => status === "pass" ? 2 : status === "partial" ? 1 : 0;
1774
1806
  var buildRAGEvaluationRunDiff = ({
1775
1807
  current,
@@ -1930,6 +1962,10 @@ var loadRAGAnswerGroundingEvaluationHistory = async ({
1930
1962
  const latestRun = runs[0];
1931
1963
  const previousRun = runs[1];
1932
1964
  return {
1965
+ caseSnapshots: buildGroundingCaseSnapshots({
1966
+ current: latestRun,
1967
+ previous: previousRun
1968
+ }),
1933
1969
  diff: latestRun && previousRun ? buildRAGAnswerGroundingEvaluationRunDiff({
1934
1970
  current: latestRun,
1935
1971
  previous: previousRun
@@ -2972,5 +3008,5 @@ export {
2972
3008
  AIStreamKey
2973
3009
  };
2974
3010
 
2975
- //# debugId=CE780A331BCCEACE64756E2164756E21
3011
+ //# debugId=1734A168DA77F77764756E2164756E21
2976
3012
  //# sourceMappingURL=index.js.map