@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/svelte/ai/index.js
CHANGED
|
@@ -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
|
|
@@ -2160,7 +2236,8 @@ var loadRAGAnswerGroundingCaseDifficultyHistory = async ({
|
|
|
2160
2236
|
previousRun,
|
|
2161
2237
|
runs,
|
|
2162
2238
|
suiteId: suite.id,
|
|
2163
|
-
suiteLabel: suite.label ?? suite.id
|
|
2239
|
+
suiteLabel: suite.label ?? suite.id,
|
|
2240
|
+
trends: buildRAGAnswerGroundingCaseDifficultyTrends({ runs })
|
|
2164
2241
|
};
|
|
2165
2242
|
};
|
|
2166
2243
|
var persistRAGEvaluationSuiteRun = async ({
|
|
@@ -3214,5 +3291,5 @@ export {
|
|
|
3214
3291
|
createAIStream
|
|
3215
3292
|
};
|
|
3216
3293
|
|
|
3217
|
-
//# debugId=
|
|
3294
|
+
//# debugId=B0246F6D46F2EAEA64756E2164756E21
|
|
3218
3295
|
//# sourceMappingURL=index.js.map
|