@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.
@@ -1795,6 +1795,82 @@ var buildGroundingDifficultyDiffEntry = (current, previous) => ({
1795
1795
  previousRank: previous?.rank,
1796
1796
  query: current.query
1797
1797
  });
1798
+ var buildRAGAnswerGroundingCaseDifficultyTrends = ({
1799
+ runs
1800
+ }) => {
1801
+ const movementCounts = new Map;
1802
+ for (let index = 0;index < runs.length - 1; index += 1) {
1803
+ const current = runs[index];
1804
+ const previous = runs[index + 1];
1805
+ if (!current || !previous) {
1806
+ continue;
1807
+ }
1808
+ const diff = buildRAGAnswerGroundingCaseDifficultyRunDiff({
1809
+ current,
1810
+ previous
1811
+ });
1812
+ for (const entry of diff.harderCases) {
1813
+ const currentCounts = movementCounts.get(entry.caseId) ?? {
1814
+ easier: 0,
1815
+ harder: 0,
1816
+ label: entry.label,
1817
+ unchanged: 0
1818
+ };
1819
+ currentCounts.harder += 1;
1820
+ currentCounts.label ??= entry.label;
1821
+ movementCounts.set(entry.caseId, currentCounts);
1822
+ }
1823
+ for (const entry of diff.easierCases) {
1824
+ const currentCounts = movementCounts.get(entry.caseId) ?? {
1825
+ easier: 0,
1826
+ harder: 0,
1827
+ label: entry.label,
1828
+ unchanged: 0
1829
+ };
1830
+ currentCounts.easier += 1;
1831
+ currentCounts.label ??= entry.label;
1832
+ movementCounts.set(entry.caseId, currentCounts);
1833
+ }
1834
+ for (const entry of diff.unchangedCases) {
1835
+ const currentCounts = movementCounts.get(entry.caseId) ?? {
1836
+ easier: 0,
1837
+ harder: 0,
1838
+ label: entry.label,
1839
+ unchanged: 0
1840
+ };
1841
+ currentCounts.unchanged += 1;
1842
+ currentCounts.label ??= entry.label;
1843
+ movementCounts.set(entry.caseId, currentCounts);
1844
+ }
1845
+ }
1846
+ const movementEntries = [...movementCounts.entries()];
1847
+ const mostOftenHarderCaseIds = movementEntries.filter(([, counts]) => counts.harder > 0).sort((left, right) => {
1848
+ if (right[1].harder !== left[1].harder) {
1849
+ return right[1].harder - left[1].harder;
1850
+ }
1851
+ return left[0].localeCompare(right[0]);
1852
+ }).map(([caseId]) => caseId);
1853
+ const mostOftenEasierCaseIds = movementEntries.filter(([, counts]) => counts.easier > 0).sort((left, right) => {
1854
+ if (right[1].easier !== left[1].easier) {
1855
+ return right[1].easier - left[1].easier;
1856
+ }
1857
+ return left[0].localeCompare(right[0]);
1858
+ }).map(([caseId]) => caseId);
1859
+ return {
1860
+ easiestCaseIds: runs[runs.length - 1]?.entries.map((entry) => entry.caseId).reverse() ?? [],
1861
+ hardestCaseIds: runs[0]?.entries.map((entry) => entry.caseId) ?? [],
1862
+ mostOftenEasierCaseIds,
1863
+ mostOftenHarderCaseIds,
1864
+ movementCounts: Object.fromEntries(movementEntries.map(([caseId, counts]) => [
1865
+ caseId,
1866
+ {
1867
+ easier: counts.easier,
1868
+ harder: counts.harder,
1869
+ unchanged: counts.unchanged
1870
+ }
1871
+ ]))
1872
+ };
1873
+ };
1798
1874
  var buildRAGAnswerGroundingCaseDifficultyRunDiff = ({
1799
1875
  current,
1800
1876
  previous
@@ -1842,18 +1918,30 @@ var buildGroundingCaseDiff = (currentCase, previousCase) => ({
1842
1918
  answerChanged: typeof previousCase?.answer === "string" ? previousCase.answer !== currentCase.answer : true,
1843
1919
  caseId: currentCase.caseId,
1844
1920
  currentCitationF1: currentCase.citationF1,
1921
+ currentCitedIds: currentCase.citedIds,
1845
1922
  currentCoverage: currentCase.coverage,
1923
+ currentExtraIds: currentCase.extraIds,
1846
1924
  currentMatchedIds: currentCase.matchedIds,
1847
1925
  currentMissingIds: currentCase.missingIds,
1926
+ currentReferenceCount: currentCase.referenceCount,
1927
+ currentResolvedCitationCount: currentCase.resolvedCitationCount,
1848
1928
  currentAnswer: currentCase.answer,
1849
1929
  currentStatus: currentCase.status,
1930
+ currentUngroundedReferenceNumbers: currentCase.groundedAnswer.ungroundedReferenceNumbers,
1931
+ currentUnresolvedCitationCount: currentCase.unresolvedCitationCount,
1850
1932
  label: currentCase.label,
1851
1933
  previousAnswer: previousCase?.answer,
1852
1934
  previousCitationF1: previousCase?.citationF1,
1935
+ previousCitedIds: previousCase?.citedIds ?? [],
1853
1936
  previousCoverage: previousCase?.coverage,
1937
+ previousExtraIds: previousCase?.extraIds ?? [],
1854
1938
  previousMatchedIds: previousCase?.matchedIds ?? [],
1855
1939
  previousMissingIds: previousCase?.missingIds ?? [],
1940
+ previousReferenceCount: previousCase?.referenceCount,
1941
+ previousResolvedCitationCount: previousCase?.resolvedCitationCount,
1856
1942
  previousStatus: previousCase?.status,
1943
+ previousUngroundedReferenceNumbers: previousCase?.groundedAnswer.ungroundedReferenceNumbers ?? [],
1944
+ previousUnresolvedCitationCount: previousCase?.unresolvedCitationCount,
1857
1945
  query: currentCase.query
1858
1946
  });
1859
1947
  var buildGroundingCaseSnapshots = ({
@@ -1870,7 +1958,9 @@ var buildGroundingCaseSnapshots = ({
1870
1958
  answer: entry.answer,
1871
1959
  answerChange: typeof previousCase?.answer === "string" ? previousCase.answer === entry.answer ? "unchanged" : "changed" : "new",
1872
1960
  caseId: entry.caseId,
1961
+ citationCount: entry.citationCount,
1873
1962
  citationF1: entry.citationF1,
1963
+ citedIds: entry.citedIds,
1874
1964
  coverage: entry.coverage,
1875
1965
  extraIds: entry.extraIds,
1876
1966
  label: entry.label,
@@ -1878,8 +1968,12 @@ var buildGroundingCaseSnapshots = ({
1878
1968
  missingIds: entry.missingIds,
1879
1969
  previousAnswer: previousCase?.answer,
1880
1970
  query: entry.query,
1971
+ referenceCount: entry.referenceCount,
1972
+ resolvedCitationCount: entry.resolvedCitationCount,
1881
1973
  resolvedCitationRate: entry.resolvedCitationRate,
1882
- status: entry.status
1974
+ status: entry.status,
1975
+ ungroundedReferenceNumbers: entry.groundedAnswer.ungroundedReferenceNumbers,
1976
+ unresolvedCitationCount: entry.unresolvedCitationCount
1883
1977
  };
1884
1978
  });
1885
1979
  };
@@ -2115,7 +2209,8 @@ var loadRAGAnswerGroundingCaseDifficultyHistory = async ({
2115
2209
  previousRun,
2116
2210
  runs,
2117
2211
  suiteId: suite.id,
2118
- suiteLabel: suite.label ?? suite.id
2212
+ suiteLabel: suite.label ?? suite.id,
2213
+ trends: buildRAGAnswerGroundingCaseDifficultyTrends({ runs })
2119
2214
  };
2120
2215
  };
2121
2216
  var persistRAGEvaluationSuiteRun = async ({
@@ -2516,5 +2611,5 @@ export {
2516
2611
  buildRAGAnswerWorkflowState
2517
2612
  };
2518
2613
 
2519
- //# debugId=00A3D464CC429EC964756E2164756E21
2614
+ //# debugId=B29805440D07EE6F64756E2164756E21
2520
2615
  //# sourceMappingURL=index.js.map