@absolutejs/absolute 0.19.0-beta.524 → 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.
- package/dist/ai/client/index.js +79 -2
- package/dist/ai/client/index.js.map +3 -3
- package/dist/ai/index.js +79 -2
- package/dist/ai/index.js.map +3 -3
- package/dist/react/ai/index.js +79 -2
- package/dist/react/ai/index.js.map +3 -3
- package/dist/svelte/ai/index.js +79 -2
- package/dist/svelte/ai/index.js.map +3 -3
- package/dist/types/ai.d.ts +11 -0
- package/dist/vue/ai/index.js +79 -2
- package/dist/vue/ai/index.js.map +3 -3
- package/package.json +1 -1
package/dist/ai/client/index.js
CHANGED
|
@@ -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
|
|
@@ -2133,7 +2209,8 @@ var loadRAGAnswerGroundingCaseDifficultyHistory = async ({
|
|
|
2133
2209
|
previousRun,
|
|
2134
2210
|
runs,
|
|
2135
2211
|
suiteId: suite.id,
|
|
2136
|
-
suiteLabel: suite.label ?? suite.id
|
|
2212
|
+
suiteLabel: suite.label ?? suite.id,
|
|
2213
|
+
trends: buildRAGAnswerGroundingCaseDifficultyTrends({ runs })
|
|
2137
2214
|
};
|
|
2138
2215
|
};
|
|
2139
2216
|
var persistRAGEvaluationSuiteRun = async ({
|
|
@@ -2534,5 +2611,5 @@ export {
|
|
|
2534
2611
|
buildRAGAnswerWorkflowState
|
|
2535
2612
|
};
|
|
2536
2613
|
|
|
2537
|
-
//# debugId=
|
|
2614
|
+
//# debugId=B29805440D07EE6F64756E2164756E21
|
|
2538
2615
|
//# sourceMappingURL=index.js.map
|