@absolutejs/absolute 0.19.0-beta.520 → 0.19.0-beta.522
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 +67 -1
- package/dist/ai/client/index.js.map +3 -3
- package/dist/ai/index.js +68 -1
- package/dist/ai/index.js.map +4 -4
- package/dist/react/ai/index.js +67 -1
- package/dist/react/ai/index.js.map +3 -3
- package/dist/src/ai/index.d.ts +2 -2
- package/dist/src/ai/rag/index.d.ts +1 -1
- package/dist/src/ai/rag/quality.d.ts +5 -1
- package/dist/src/ai/rag/types.d.ts +1 -1
- package/dist/svelte/ai/index.js +67 -1
- package/dist/svelte/ai/index.js.map +3 -3
- package/dist/types/ai.d.ts +13 -0
- package/dist/vue/ai/index.js +67 -1
- package/dist/vue/ai/index.js.map +3 -3
- package/package.json +1 -1
package/dist/types/ai.d.ts
CHANGED
|
@@ -946,6 +946,19 @@ export type RAGAnswerGroundingEvaluationLeaderboardEntry = {
|
|
|
946
946
|
rank: number;
|
|
947
947
|
totalCases: number;
|
|
948
948
|
};
|
|
949
|
+
export type RAGAnswerGroundingEvaluationCaseDifficultyEntry = {
|
|
950
|
+
caseId: string;
|
|
951
|
+
label?: string;
|
|
952
|
+
query?: string;
|
|
953
|
+
passRate: number;
|
|
954
|
+
partialRate: number;
|
|
955
|
+
failRate: number;
|
|
956
|
+
groundedRate: number;
|
|
957
|
+
averageCitationF1: number;
|
|
958
|
+
averageResolvedCitationRate: number;
|
|
959
|
+
rank: number;
|
|
960
|
+
totalEvaluations: number;
|
|
961
|
+
};
|
|
949
962
|
export type RAGAnswerGroundingEvaluationCaseDiff = {
|
|
950
963
|
caseId: string;
|
|
951
964
|
label?: string;
|
package/dist/vue/ai/index.js
CHANGED
|
@@ -1740,6 +1740,72 @@ var buildRAGAnswerGroundingEvaluationLeaderboard = (runs) => {
|
|
|
1740
1740
|
totalCases: run.response.totalCases
|
|
1741
1741
|
}));
|
|
1742
1742
|
};
|
|
1743
|
+
var buildRAGAnswerGroundingCaseDifficultyLeaderboard = (entries) => {
|
|
1744
|
+
const grouped = new Map;
|
|
1745
|
+
for (const entry of entries) {
|
|
1746
|
+
for (const result of entry.response.cases) {
|
|
1747
|
+
const current = grouped.get(result.caseId) ?? {
|
|
1748
|
+
caseId: result.caseId,
|
|
1749
|
+
failCount: 0,
|
|
1750
|
+
groundedCount: 0,
|
|
1751
|
+
label: result.label,
|
|
1752
|
+
passCount: 0,
|
|
1753
|
+
partialCount: 0,
|
|
1754
|
+
query: result.query,
|
|
1755
|
+
totalCitationF1: 0,
|
|
1756
|
+
totalEvaluations: 0,
|
|
1757
|
+
totalResolvedCitationRate: 0
|
|
1758
|
+
};
|
|
1759
|
+
current.label ??= result.label;
|
|
1760
|
+
current.query ??= result.query;
|
|
1761
|
+
current.totalEvaluations += 1;
|
|
1762
|
+
current.totalCitationF1 += result.citationF1;
|
|
1763
|
+
current.totalResolvedCitationRate += result.resolvedCitationRate;
|
|
1764
|
+
if (result.status === "pass") {
|
|
1765
|
+
current.passCount += 1;
|
|
1766
|
+
} else if (result.status === "partial") {
|
|
1767
|
+
current.partialCount += 1;
|
|
1768
|
+
} else {
|
|
1769
|
+
current.failCount += 1;
|
|
1770
|
+
}
|
|
1771
|
+
if (result.coverage === "grounded") {
|
|
1772
|
+
current.groundedCount += 1;
|
|
1773
|
+
}
|
|
1774
|
+
grouped.set(result.caseId, current);
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
const ranked = Array.from(grouped.values()).sort((left, right) => {
|
|
1778
|
+
const leftPassRate = left.passCount / left.totalEvaluations;
|
|
1779
|
+
const rightPassRate = right.passCount / right.totalEvaluations;
|
|
1780
|
+
if (leftPassRate !== rightPassRate) {
|
|
1781
|
+
return leftPassRate - rightPassRate;
|
|
1782
|
+
}
|
|
1783
|
+
const leftCitationF1 = left.totalCitationF1 / left.totalEvaluations;
|
|
1784
|
+
const rightCitationF1 = right.totalCitationF1 / right.totalEvaluations;
|
|
1785
|
+
if (leftCitationF1 !== rightCitationF1) {
|
|
1786
|
+
return leftCitationF1 - rightCitationF1;
|
|
1787
|
+
}
|
|
1788
|
+
const leftResolved = left.totalResolvedCitationRate / left.totalEvaluations;
|
|
1789
|
+
const rightResolved = right.totalResolvedCitationRate / right.totalEvaluations;
|
|
1790
|
+
if (leftResolved !== rightResolved) {
|
|
1791
|
+
return leftResolved - rightResolved;
|
|
1792
|
+
}
|
|
1793
|
+
return left.caseId.localeCompare(right.caseId);
|
|
1794
|
+
});
|
|
1795
|
+
return ranked.map((entry, index) => ({
|
|
1796
|
+
averageCitationF1: entry.totalCitationF1 / entry.totalEvaluations,
|
|
1797
|
+
averageResolvedCitationRate: entry.totalResolvedCitationRate / entry.totalEvaluations,
|
|
1798
|
+
caseId: entry.caseId,
|
|
1799
|
+
failRate: entry.failCount / entry.totalEvaluations * 100,
|
|
1800
|
+
groundedRate: entry.groundedCount / entry.totalEvaluations * 100,
|
|
1801
|
+
label: entry.label,
|
|
1802
|
+
passRate: entry.passCount / entry.totalEvaluations * 100,
|
|
1803
|
+
partialRate: entry.partialCount / entry.totalEvaluations * 100,
|
|
1804
|
+
query: entry.query,
|
|
1805
|
+
rank: index + 1,
|
|
1806
|
+
totalEvaluations: entry.totalEvaluations
|
|
1807
|
+
}));
|
|
1808
|
+
};
|
|
1743
1809
|
var toHistorySortOrder = (left, right) => right.finishedAt - left.finishedAt;
|
|
1744
1810
|
var normalizeHistoryRuns = (runs) => [...runs].sort(toHistorySortOrder);
|
|
1745
1811
|
var toGroundingHistorySortOrder = (left, right) => right.finishedAt - left.finishedAt;
|
|
@@ -3008,5 +3074,5 @@ export {
|
|
|
3008
3074
|
AIStreamKey
|
|
3009
3075
|
};
|
|
3010
3076
|
|
|
3011
|
-
//# debugId=
|
|
3077
|
+
//# debugId=EB5A5D06CF24564764756E2164756E21
|
|
3012
3078
|
//# sourceMappingURL=index.js.map
|