@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.
@@ -1822,6 +1822,82 @@ var buildGroundingDifficultyDiffEntry = (current, previous) => ({
1822
1822
  previousRank: previous?.rank,
1823
1823
  query: current.query
1824
1824
  });
1825
+ var buildRAGAnswerGroundingCaseDifficultyTrends = ({
1826
+ runs
1827
+ }) => {
1828
+ const movementCounts = new Map;
1829
+ for (let index = 0;index < runs.length - 1; index += 1) {
1830
+ const current = runs[index];
1831
+ const previous = runs[index + 1];
1832
+ if (!current || !previous) {
1833
+ continue;
1834
+ }
1835
+ const diff = buildRAGAnswerGroundingCaseDifficultyRunDiff({
1836
+ current,
1837
+ previous
1838
+ });
1839
+ for (const entry of diff.harderCases) {
1840
+ const currentCounts = movementCounts.get(entry.caseId) ?? {
1841
+ easier: 0,
1842
+ harder: 0,
1843
+ label: entry.label,
1844
+ unchanged: 0
1845
+ };
1846
+ currentCounts.harder += 1;
1847
+ currentCounts.label ??= entry.label;
1848
+ movementCounts.set(entry.caseId, currentCounts);
1849
+ }
1850
+ for (const entry of diff.easierCases) {
1851
+ const currentCounts = movementCounts.get(entry.caseId) ?? {
1852
+ easier: 0,
1853
+ harder: 0,
1854
+ label: entry.label,
1855
+ unchanged: 0
1856
+ };
1857
+ currentCounts.easier += 1;
1858
+ currentCounts.label ??= entry.label;
1859
+ movementCounts.set(entry.caseId, currentCounts);
1860
+ }
1861
+ for (const entry of diff.unchangedCases) {
1862
+ const currentCounts = movementCounts.get(entry.caseId) ?? {
1863
+ easier: 0,
1864
+ harder: 0,
1865
+ label: entry.label,
1866
+ unchanged: 0
1867
+ };
1868
+ currentCounts.unchanged += 1;
1869
+ currentCounts.label ??= entry.label;
1870
+ movementCounts.set(entry.caseId, currentCounts);
1871
+ }
1872
+ }
1873
+ const movementEntries = [...movementCounts.entries()];
1874
+ const mostOftenHarderCaseIds = movementEntries.filter(([, counts]) => counts.harder > 0).sort((left, right) => {
1875
+ if (right[1].harder !== left[1].harder) {
1876
+ return right[1].harder - left[1].harder;
1877
+ }
1878
+ return left[0].localeCompare(right[0]);
1879
+ }).map(([caseId]) => caseId);
1880
+ const mostOftenEasierCaseIds = movementEntries.filter(([, counts]) => counts.easier > 0).sort((left, right) => {
1881
+ if (right[1].easier !== left[1].easier) {
1882
+ return right[1].easier - left[1].easier;
1883
+ }
1884
+ return left[0].localeCompare(right[0]);
1885
+ }).map(([caseId]) => caseId);
1886
+ return {
1887
+ easiestCaseIds: runs[runs.length - 1]?.entries.map((entry) => entry.caseId).reverse() ?? [],
1888
+ hardestCaseIds: runs[0]?.entries.map((entry) => entry.caseId) ?? [],
1889
+ mostOftenEasierCaseIds,
1890
+ mostOftenHarderCaseIds,
1891
+ movementCounts: Object.fromEntries(movementEntries.map(([caseId, counts]) => [
1892
+ caseId,
1893
+ {
1894
+ easier: counts.easier,
1895
+ harder: counts.harder,
1896
+ unchanged: counts.unchanged
1897
+ }
1898
+ ]))
1899
+ };
1900
+ };
1825
1901
  var buildRAGAnswerGroundingCaseDifficultyRunDiff = ({
1826
1902
  current,
1827
1903
  previous
@@ -1869,18 +1945,30 @@ var buildGroundingCaseDiff = (currentCase, previousCase) => ({
1869
1945
  answerChanged: typeof previousCase?.answer === "string" ? previousCase.answer !== currentCase.answer : true,
1870
1946
  caseId: currentCase.caseId,
1871
1947
  currentCitationF1: currentCase.citationF1,
1948
+ currentCitedIds: currentCase.citedIds,
1872
1949
  currentCoverage: currentCase.coverage,
1950
+ currentExtraIds: currentCase.extraIds,
1873
1951
  currentMatchedIds: currentCase.matchedIds,
1874
1952
  currentMissingIds: currentCase.missingIds,
1953
+ currentReferenceCount: currentCase.referenceCount,
1954
+ currentResolvedCitationCount: currentCase.resolvedCitationCount,
1875
1955
  currentAnswer: currentCase.answer,
1876
1956
  currentStatus: currentCase.status,
1957
+ currentUngroundedReferenceNumbers: currentCase.groundedAnswer.ungroundedReferenceNumbers,
1958
+ currentUnresolvedCitationCount: currentCase.unresolvedCitationCount,
1877
1959
  label: currentCase.label,
1878
1960
  previousAnswer: previousCase?.answer,
1879
1961
  previousCitationF1: previousCase?.citationF1,
1962
+ previousCitedIds: previousCase?.citedIds ?? [],
1880
1963
  previousCoverage: previousCase?.coverage,
1964
+ previousExtraIds: previousCase?.extraIds ?? [],
1881
1965
  previousMatchedIds: previousCase?.matchedIds ?? [],
1882
1966
  previousMissingIds: previousCase?.missingIds ?? [],
1967
+ previousReferenceCount: previousCase?.referenceCount,
1968
+ previousResolvedCitationCount: previousCase?.resolvedCitationCount,
1883
1969
  previousStatus: previousCase?.status,
1970
+ previousUngroundedReferenceNumbers: previousCase?.groundedAnswer.ungroundedReferenceNumbers ?? [],
1971
+ previousUnresolvedCitationCount: previousCase?.unresolvedCitationCount,
1884
1972
  query: currentCase.query
1885
1973
  });
1886
1974
  var buildGroundingCaseSnapshots = ({
@@ -1897,7 +1985,9 @@ var buildGroundingCaseSnapshots = ({
1897
1985
  answer: entry.answer,
1898
1986
  answerChange: typeof previousCase?.answer === "string" ? previousCase.answer === entry.answer ? "unchanged" : "changed" : "new",
1899
1987
  caseId: entry.caseId,
1988
+ citationCount: entry.citationCount,
1900
1989
  citationF1: entry.citationF1,
1990
+ citedIds: entry.citedIds,
1901
1991
  coverage: entry.coverage,
1902
1992
  extraIds: entry.extraIds,
1903
1993
  label: entry.label,
@@ -1905,8 +1995,12 @@ var buildGroundingCaseSnapshots = ({
1905
1995
  missingIds: entry.missingIds,
1906
1996
  previousAnswer: previousCase?.answer,
1907
1997
  query: entry.query,
1998
+ referenceCount: entry.referenceCount,
1999
+ resolvedCitationCount: entry.resolvedCitationCount,
1908
2000
  resolvedCitationRate: entry.resolvedCitationRate,
1909
- status: entry.status
2001
+ status: entry.status,
2002
+ ungroundedReferenceNumbers: entry.groundedAnswer.ungroundedReferenceNumbers,
2003
+ unresolvedCitationCount: entry.unresolvedCitationCount
1910
2004
  };
1911
2005
  });
1912
2006
  };
@@ -2142,7 +2236,8 @@ var loadRAGAnswerGroundingCaseDifficultyHistory = async ({
2142
2236
  previousRun,
2143
2237
  runs,
2144
2238
  suiteId: suite.id,
2145
- suiteLabel: suite.label ?? suite.id
2239
+ suiteLabel: suite.label ?? suite.id,
2240
+ trends: buildRAGAnswerGroundingCaseDifficultyTrends({ runs })
2146
2241
  };
2147
2242
  };
2148
2243
  var persistRAGEvaluationSuiteRun = async ({
@@ -3196,5 +3291,5 @@ export {
3196
3291
  createAIStream
3197
3292
  };
3198
3293
 
3199
- //# debugId=43CDB10645A5754E64756E2164756E21
3294
+ //# debugId=B0246F6D46F2EAEA64756E2164756E21
3200
3295
  //# sourceMappingURL=index.js.map