@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.
@@ -1003,6 +1003,17 @@ export type RAGAnswerGroundingCaseDifficultyHistory = {
1003
1003
  latestRun?: RAGAnswerGroundingCaseDifficultyRun;
1004
1004
  previousRun?: RAGAnswerGroundingCaseDifficultyRun;
1005
1005
  diff?: RAGAnswerGroundingCaseDifficultyRunDiff;
1006
+ trends: {
1007
+ hardestCaseIds: string[];
1008
+ easiestCaseIds: string[];
1009
+ mostOftenHarderCaseIds: string[];
1010
+ mostOftenEasierCaseIds: string[];
1011
+ movementCounts: Record<string, {
1012
+ harder: number;
1013
+ easier: number;
1014
+ unchanged: number;
1015
+ }>;
1016
+ };
1006
1017
  };
1007
1018
  export type RAGAnswerGroundingEvaluationCaseDiff = {
1008
1019
  caseId: string;
@@ -1014,10 +1025,22 @@ export type RAGAnswerGroundingEvaluationCaseDiff = {
1014
1025
  currentCoverage: RAGAnswerGroundingEvaluationCaseResult['coverage'];
1015
1026
  previousCitationF1?: number;
1016
1027
  currentCitationF1: number;
1028
+ previousCitedIds: string[];
1029
+ currentCitedIds: string[];
1017
1030
  previousMatchedIds: string[];
1018
1031
  currentMatchedIds: string[];
1019
1032
  previousMissingIds: string[];
1020
1033
  currentMissingIds: string[];
1034
+ previousExtraIds: string[];
1035
+ currentExtraIds: string[];
1036
+ previousReferenceCount?: number;
1037
+ currentReferenceCount: number;
1038
+ previousResolvedCitationCount?: number;
1039
+ currentResolvedCitationCount: number;
1040
+ previousUnresolvedCitationCount?: number;
1041
+ currentUnresolvedCitationCount: number;
1042
+ previousUngroundedReferenceNumbers: number[];
1043
+ currentUngroundedReferenceNumbers: number[];
1021
1044
  previousAnswer?: string;
1022
1045
  currentAnswer: string;
1023
1046
  answerChanged: boolean;
@@ -1030,9 +1053,15 @@ export type RAGAnswerGroundingEvaluationCaseSnapshot = {
1030
1053
  coverage: RAGAnswerGroundingEvaluationCaseResult['coverage'];
1031
1054
  citationF1: number;
1032
1055
  resolvedCitationRate: number;
1056
+ citationCount: number;
1057
+ referenceCount: number;
1058
+ resolvedCitationCount: number;
1059
+ unresolvedCitationCount: number;
1060
+ citedIds: string[];
1033
1061
  matchedIds: string[];
1034
1062
  missingIds: string[];
1035
1063
  extraIds: string[];
1064
+ ungroundedReferenceNumbers: number[];
1036
1065
  answer: string;
1037
1066
  previousAnswer?: string;
1038
1067
  answerChange: 'new' | 'changed' | 'unchanged';
@@ -1819,6 +1819,82 @@ var buildGroundingDifficultyDiffEntry = (current, previous) => ({
1819
1819
  previousRank: previous?.rank,
1820
1820
  query: current.query
1821
1821
  });
1822
+ var buildRAGAnswerGroundingCaseDifficultyTrends = ({
1823
+ runs
1824
+ }) => {
1825
+ const movementCounts = new Map;
1826
+ for (let index = 0;index < runs.length - 1; index += 1) {
1827
+ const current = runs[index];
1828
+ const previous = runs[index + 1];
1829
+ if (!current || !previous) {
1830
+ continue;
1831
+ }
1832
+ const diff = buildRAGAnswerGroundingCaseDifficultyRunDiff({
1833
+ current,
1834
+ previous
1835
+ });
1836
+ for (const entry of diff.harderCases) {
1837
+ const currentCounts = movementCounts.get(entry.caseId) ?? {
1838
+ easier: 0,
1839
+ harder: 0,
1840
+ label: entry.label,
1841
+ unchanged: 0
1842
+ };
1843
+ currentCounts.harder += 1;
1844
+ currentCounts.label ??= entry.label;
1845
+ movementCounts.set(entry.caseId, currentCounts);
1846
+ }
1847
+ for (const entry of diff.easierCases) {
1848
+ const currentCounts = movementCounts.get(entry.caseId) ?? {
1849
+ easier: 0,
1850
+ harder: 0,
1851
+ label: entry.label,
1852
+ unchanged: 0
1853
+ };
1854
+ currentCounts.easier += 1;
1855
+ currentCounts.label ??= entry.label;
1856
+ movementCounts.set(entry.caseId, currentCounts);
1857
+ }
1858
+ for (const entry of diff.unchangedCases) {
1859
+ const currentCounts = movementCounts.get(entry.caseId) ?? {
1860
+ easier: 0,
1861
+ harder: 0,
1862
+ label: entry.label,
1863
+ unchanged: 0
1864
+ };
1865
+ currentCounts.unchanged += 1;
1866
+ currentCounts.label ??= entry.label;
1867
+ movementCounts.set(entry.caseId, currentCounts);
1868
+ }
1869
+ }
1870
+ const movementEntries = [...movementCounts.entries()];
1871
+ const mostOftenHarderCaseIds = movementEntries.filter(([, counts]) => counts.harder > 0).sort((left, right) => {
1872
+ if (right[1].harder !== left[1].harder) {
1873
+ return right[1].harder - left[1].harder;
1874
+ }
1875
+ return left[0].localeCompare(right[0]);
1876
+ }).map(([caseId]) => caseId);
1877
+ const mostOftenEasierCaseIds = movementEntries.filter(([, counts]) => counts.easier > 0).sort((left, right) => {
1878
+ if (right[1].easier !== left[1].easier) {
1879
+ return right[1].easier - left[1].easier;
1880
+ }
1881
+ return left[0].localeCompare(right[0]);
1882
+ }).map(([caseId]) => caseId);
1883
+ return {
1884
+ easiestCaseIds: runs[runs.length - 1]?.entries.map((entry) => entry.caseId).reverse() ?? [],
1885
+ hardestCaseIds: runs[0]?.entries.map((entry) => entry.caseId) ?? [],
1886
+ mostOftenEasierCaseIds,
1887
+ mostOftenHarderCaseIds,
1888
+ movementCounts: Object.fromEntries(movementEntries.map(([caseId, counts]) => [
1889
+ caseId,
1890
+ {
1891
+ easier: counts.easier,
1892
+ harder: counts.harder,
1893
+ unchanged: counts.unchanged
1894
+ }
1895
+ ]))
1896
+ };
1897
+ };
1822
1898
  var buildRAGAnswerGroundingCaseDifficultyRunDiff = ({
1823
1899
  current,
1824
1900
  previous
@@ -1866,18 +1942,30 @@ var buildGroundingCaseDiff = (currentCase, previousCase) => ({
1866
1942
  answerChanged: typeof previousCase?.answer === "string" ? previousCase.answer !== currentCase.answer : true,
1867
1943
  caseId: currentCase.caseId,
1868
1944
  currentCitationF1: currentCase.citationF1,
1945
+ currentCitedIds: currentCase.citedIds,
1869
1946
  currentCoverage: currentCase.coverage,
1947
+ currentExtraIds: currentCase.extraIds,
1870
1948
  currentMatchedIds: currentCase.matchedIds,
1871
1949
  currentMissingIds: currentCase.missingIds,
1950
+ currentReferenceCount: currentCase.referenceCount,
1951
+ currentResolvedCitationCount: currentCase.resolvedCitationCount,
1872
1952
  currentAnswer: currentCase.answer,
1873
1953
  currentStatus: currentCase.status,
1954
+ currentUngroundedReferenceNumbers: currentCase.groundedAnswer.ungroundedReferenceNumbers,
1955
+ currentUnresolvedCitationCount: currentCase.unresolvedCitationCount,
1874
1956
  label: currentCase.label,
1875
1957
  previousAnswer: previousCase?.answer,
1876
1958
  previousCitationF1: previousCase?.citationF1,
1959
+ previousCitedIds: previousCase?.citedIds ?? [],
1877
1960
  previousCoverage: previousCase?.coverage,
1961
+ previousExtraIds: previousCase?.extraIds ?? [],
1878
1962
  previousMatchedIds: previousCase?.matchedIds ?? [],
1879
1963
  previousMissingIds: previousCase?.missingIds ?? [],
1964
+ previousReferenceCount: previousCase?.referenceCount,
1965
+ previousResolvedCitationCount: previousCase?.resolvedCitationCount,
1880
1966
  previousStatus: previousCase?.status,
1967
+ previousUngroundedReferenceNumbers: previousCase?.groundedAnswer.ungroundedReferenceNumbers ?? [],
1968
+ previousUnresolvedCitationCount: previousCase?.unresolvedCitationCount,
1881
1969
  query: currentCase.query
1882
1970
  });
1883
1971
  var buildGroundingCaseSnapshots = ({
@@ -1894,7 +1982,9 @@ var buildGroundingCaseSnapshots = ({
1894
1982
  answer: entry.answer,
1895
1983
  answerChange: typeof previousCase?.answer === "string" ? previousCase.answer === entry.answer ? "unchanged" : "changed" : "new",
1896
1984
  caseId: entry.caseId,
1985
+ citationCount: entry.citationCount,
1897
1986
  citationF1: entry.citationF1,
1987
+ citedIds: entry.citedIds,
1898
1988
  coverage: entry.coverage,
1899
1989
  extraIds: entry.extraIds,
1900
1990
  label: entry.label,
@@ -1902,8 +1992,12 @@ var buildGroundingCaseSnapshots = ({
1902
1992
  missingIds: entry.missingIds,
1903
1993
  previousAnswer: previousCase?.answer,
1904
1994
  query: entry.query,
1995
+ referenceCount: entry.referenceCount,
1996
+ resolvedCitationCount: entry.resolvedCitationCount,
1905
1997
  resolvedCitationRate: entry.resolvedCitationRate,
1906
- status: entry.status
1998
+ status: entry.status,
1999
+ ungroundedReferenceNumbers: entry.groundedAnswer.ungroundedReferenceNumbers,
2000
+ unresolvedCitationCount: entry.unresolvedCitationCount
1907
2001
  };
1908
2002
  });
1909
2003
  };
@@ -2139,7 +2233,8 @@ var loadRAGAnswerGroundingCaseDifficultyHistory = async ({
2139
2233
  previousRun,
2140
2234
  runs,
2141
2235
  suiteId: suite.id,
2142
- suiteLabel: suite.label ?? suite.id
2236
+ suiteLabel: suite.label ?? suite.id,
2237
+ trends: buildRAGAnswerGroundingCaseDifficultyTrends({ runs })
2143
2238
  };
2144
2239
  };
2145
2240
  var persistRAGEvaluationSuiteRun = async ({
@@ -3179,5 +3274,5 @@ export {
3179
3274
  AIStreamKey
3180
3275
  };
3181
3276
 
3182
- //# debugId=8138A6ECFE2C732864756E2164756E21
3277
+ //# debugId=FCF3EE50E141C64C64756E2164756E21
3183
3278
  //# sourceMappingURL=index.js.map