@absolutejs/absolute 0.19.0-beta.520 → 0.19.0-beta.521
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 +3 -3
- package/dist/react/ai/index.js +67 -1
- package/dist/react/ai/index.js.map +3 -3
- package/dist/src/ai/index.d.ts +1 -1
- package/dist/src/ai/rag/index.d.ts +1 -1
- package/dist/src/ai/rag/quality.d.ts +5 -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/ai/index.js
CHANGED
|
@@ -5129,6 +5129,72 @@ var buildRAGAnswerGroundingEvaluationLeaderboard = (runs) => {
|
|
|
5129
5129
|
totalCases: run.response.totalCases
|
|
5130
5130
|
}));
|
|
5131
5131
|
};
|
|
5132
|
+
var buildRAGAnswerGroundingCaseDifficultyLeaderboard = (entries) => {
|
|
5133
|
+
const grouped = new Map;
|
|
5134
|
+
for (const entry of entries) {
|
|
5135
|
+
for (const result of entry.response.cases) {
|
|
5136
|
+
const current = grouped.get(result.caseId) ?? {
|
|
5137
|
+
caseId: result.caseId,
|
|
5138
|
+
failCount: 0,
|
|
5139
|
+
groundedCount: 0,
|
|
5140
|
+
label: result.label,
|
|
5141
|
+
passCount: 0,
|
|
5142
|
+
partialCount: 0,
|
|
5143
|
+
query: result.query,
|
|
5144
|
+
totalCitationF1: 0,
|
|
5145
|
+
totalEvaluations: 0,
|
|
5146
|
+
totalResolvedCitationRate: 0
|
|
5147
|
+
};
|
|
5148
|
+
current.label ??= result.label;
|
|
5149
|
+
current.query ??= result.query;
|
|
5150
|
+
current.totalEvaluations += 1;
|
|
5151
|
+
current.totalCitationF1 += result.citationF1;
|
|
5152
|
+
current.totalResolvedCitationRate += result.resolvedCitationRate;
|
|
5153
|
+
if (result.status === "pass") {
|
|
5154
|
+
current.passCount += 1;
|
|
5155
|
+
} else if (result.status === "partial") {
|
|
5156
|
+
current.partialCount += 1;
|
|
5157
|
+
} else {
|
|
5158
|
+
current.failCount += 1;
|
|
5159
|
+
}
|
|
5160
|
+
if (result.coverage === "grounded") {
|
|
5161
|
+
current.groundedCount += 1;
|
|
5162
|
+
}
|
|
5163
|
+
grouped.set(result.caseId, current);
|
|
5164
|
+
}
|
|
5165
|
+
}
|
|
5166
|
+
const ranked = Array.from(grouped.values()).sort((left, right) => {
|
|
5167
|
+
const leftPassRate = left.passCount / left.totalEvaluations;
|
|
5168
|
+
const rightPassRate = right.passCount / right.totalEvaluations;
|
|
5169
|
+
if (leftPassRate !== rightPassRate) {
|
|
5170
|
+
return leftPassRate - rightPassRate;
|
|
5171
|
+
}
|
|
5172
|
+
const leftCitationF1 = left.totalCitationF1 / left.totalEvaluations;
|
|
5173
|
+
const rightCitationF1 = right.totalCitationF1 / right.totalEvaluations;
|
|
5174
|
+
if (leftCitationF1 !== rightCitationF1) {
|
|
5175
|
+
return leftCitationF1 - rightCitationF1;
|
|
5176
|
+
}
|
|
5177
|
+
const leftResolved = left.totalResolvedCitationRate / left.totalEvaluations;
|
|
5178
|
+
const rightResolved = right.totalResolvedCitationRate / right.totalEvaluations;
|
|
5179
|
+
if (leftResolved !== rightResolved) {
|
|
5180
|
+
return leftResolved - rightResolved;
|
|
5181
|
+
}
|
|
5182
|
+
return left.caseId.localeCompare(right.caseId);
|
|
5183
|
+
});
|
|
5184
|
+
return ranked.map((entry, index) => ({
|
|
5185
|
+
averageCitationF1: entry.totalCitationF1 / entry.totalEvaluations,
|
|
5186
|
+
averageResolvedCitationRate: entry.totalResolvedCitationRate / entry.totalEvaluations,
|
|
5187
|
+
caseId: entry.caseId,
|
|
5188
|
+
failRate: entry.failCount / entry.totalEvaluations * 100,
|
|
5189
|
+
groundedRate: entry.groundedCount / entry.totalEvaluations * 100,
|
|
5190
|
+
label: entry.label,
|
|
5191
|
+
passRate: entry.passCount / entry.totalEvaluations * 100,
|
|
5192
|
+
partialRate: entry.partialCount / entry.totalEvaluations * 100,
|
|
5193
|
+
query: entry.query,
|
|
5194
|
+
rank: index + 1,
|
|
5195
|
+
totalEvaluations: entry.totalEvaluations
|
|
5196
|
+
}));
|
|
5197
|
+
};
|
|
5132
5198
|
var toHistorySortOrder = (left, right) => right.finishedAt - left.finishedAt;
|
|
5133
5199
|
var normalizeHistoryRuns = (runs) => [...runs].sort(toHistorySortOrder);
|
|
5134
5200
|
var toGroundingHistorySortOrder = (left, right) => right.finishedAt - left.finishedAt;
|
|
@@ -10828,6 +10894,7 @@ export {
|
|
|
10828
10894
|
buildRAGAnswerGroundingEvaluationRunDiff,
|
|
10829
10895
|
buildRAGAnswerGroundingEvaluationResponse,
|
|
10830
10896
|
buildRAGAnswerGroundingEvaluationLeaderboard,
|
|
10897
|
+
buildRAGAnswerGroundingCaseDifficultyLeaderboard,
|
|
10831
10898
|
applyRAGReranking,
|
|
10832
10899
|
applyRAGQueryTransform,
|
|
10833
10900
|
anthropicOCR,
|
|
@@ -10836,5 +10903,5 @@ export {
|
|
|
10836
10903
|
aiChat
|
|
10837
10904
|
};
|
|
10838
10905
|
|
|
10839
|
-
//# debugId=
|
|
10906
|
+
//# debugId=9E8ADC0BDAB94FDA64756E2164756E21
|
|
10840
10907
|
//# sourceMappingURL=index.js.map
|