@absolutejs/absolute 0.19.0-beta.537 → 0.19.0-beta.539
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 +132 -1
- package/dist/ai/client/index.js.map +3 -3
- package/dist/ai/index.js +136 -1
- package/dist/ai/index.js.map +3 -3
- package/dist/react/ai/index.js +132 -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 +132 -1
- package/dist/svelte/ai/index.js.map +3 -3
- package/dist/types/ai.d.ts +17 -0
- package/dist/vue/ai/index.js +132 -1
- package/dist/vue/ai/index.js.map +3 -3
- package/package.json +7 -7
package/dist/ai/index.js
CHANGED
|
@@ -5834,8 +5834,11 @@ var buildEvaluationCaseTraceSnapshots = ({
|
|
|
5834
5834
|
};
|
|
5835
5835
|
var getStatusRank = (status) => status === "pass" ? 2 : status === "partial" ? 1 : 0;
|
|
5836
5836
|
var formatSignedDelta = (value, decimals = 0, suffix = "") => `${value >= 0 ? "+" : ""}${value.toFixed(decimals)}${suffix}`;
|
|
5837
|
+
var formatEvaluationPassingRate = (value) => `${value.toFixed(1)}%`;
|
|
5837
5838
|
var formatEvaluationSummary = (response) => `${response.summary.passedCases}/${response.totalCases} pass \xB7 f1 ${response.summary.averageF1.toFixed(3)} \xB7 latency ${response.summary.averageLatencyMs.toFixed(1)}ms`;
|
|
5839
|
+
var formatGroundingHistorySummaryValue = (response) => `${response.summary.passedCases}/${response.summary.totalCases} pass \xB7 grounded ${response.summary.groundedCases} \xB7 partial ${response.summary.partialCases} \xB7 ungrounded ${response.summary.ungroundedCases} \xB7 resolved citations ${(response.summary.averageResolvedCitationRate * 100).toFixed(1)}% \xB7 citation f1 ${response.summary.averageCitationF1.toFixed(3)}`;
|
|
5838
5840
|
var formatHistoryCaseLabels = (cases) => cases.length > 0 ? cases.map((entry) => entry.label ?? entry.caseId).join(", ") : "none";
|
|
5841
|
+
var formatGroundingHistoryCaseLabels = (cases) => cases.length > 0 ? cases.map((entry) => entry.label ?? entry.caseId).join(", ") : "none";
|
|
5839
5842
|
var formatTraceModes = (modes) => modes.length > 0 ? modes.join(" / ") : "n/a";
|
|
5840
5843
|
var formatTraceStageSummary = (stageCounts) => {
|
|
5841
5844
|
const topStages = Object.entries(stageCounts).sort((left, right) => right[1] - left[1]).slice(0, 3);
|
|
@@ -6058,6 +6061,11 @@ var buildRAGEvaluationCaseTracePresentations = (history) => {
|
|
|
6058
6061
|
};
|
|
6059
6062
|
});
|
|
6060
6063
|
};
|
|
6064
|
+
var buildRAGEvaluationHistoryPresentation = (history) => ({
|
|
6065
|
+
caseTraces: buildRAGEvaluationCaseTracePresentations(history),
|
|
6066
|
+
rows: buildRAGEvaluationHistoryRows(history),
|
|
6067
|
+
summary: history?.latestRun ? history.latestRun.label : "No persisted benchmark runs yet."
|
|
6068
|
+
});
|
|
6061
6069
|
var buildRAGEvaluationRunDiff = ({
|
|
6062
6070
|
current,
|
|
6063
6071
|
previous
|
|
@@ -6126,6 +6134,129 @@ var buildRAGAnswerGroundingEvaluationRunDiff = ({
|
|
|
6126
6134
|
unchangedCases
|
|
6127
6135
|
};
|
|
6128
6136
|
};
|
|
6137
|
+
var buildRAGAnswerGroundingCaseSnapshotPresentations = (history) => {
|
|
6138
|
+
if (!history?.caseSnapshots.length) {
|
|
6139
|
+
return [];
|
|
6140
|
+
}
|
|
6141
|
+
return history.caseSnapshots.map((entry) => {
|
|
6142
|
+
const label = entry.label ?? entry.caseId;
|
|
6143
|
+
return {
|
|
6144
|
+
answerChange: entry.answerChange,
|
|
6145
|
+
caseId: entry.caseId,
|
|
6146
|
+
label,
|
|
6147
|
+
rows: [
|
|
6148
|
+
{
|
|
6149
|
+
label: "Query",
|
|
6150
|
+
value: entry.query?.trim().length ? entry.query : "n/a"
|
|
6151
|
+
},
|
|
6152
|
+
{ label: "Answer change", value: entry.answerChange },
|
|
6153
|
+
{ label: "Coverage", value: entry.coverage },
|
|
6154
|
+
{
|
|
6155
|
+
label: "Resolved citations",
|
|
6156
|
+
value: `${entry.resolvedCitationCount}/${entry.citationCount}`
|
|
6157
|
+
},
|
|
6158
|
+
{
|
|
6159
|
+
label: "Resolved citation rate",
|
|
6160
|
+
value: entry.resolvedCitationRate.toFixed(3)
|
|
6161
|
+
},
|
|
6162
|
+
{ label: "Citation F1", value: entry.citationF1.toFixed(3) },
|
|
6163
|
+
{
|
|
6164
|
+
label: "Reference count",
|
|
6165
|
+
value: String(entry.referenceCount)
|
|
6166
|
+
},
|
|
6167
|
+
{
|
|
6168
|
+
label: "Cited IDs",
|
|
6169
|
+
value: entry.citedIds.length > 0 ? entry.citedIds.join(", ") : "none"
|
|
6170
|
+
},
|
|
6171
|
+
{
|
|
6172
|
+
label: "Matched IDs",
|
|
6173
|
+
value: entry.matchedIds.length > 0 ? entry.matchedIds.join(", ") : "none"
|
|
6174
|
+
},
|
|
6175
|
+
{
|
|
6176
|
+
label: "Missing IDs",
|
|
6177
|
+
value: entry.missingIds.length > 0 ? entry.missingIds.join(", ") : "none"
|
|
6178
|
+
},
|
|
6179
|
+
{
|
|
6180
|
+
label: "Extra IDs",
|
|
6181
|
+
value: entry.extraIds.length > 0 ? entry.extraIds.join(", ") : "none"
|
|
6182
|
+
},
|
|
6183
|
+
{
|
|
6184
|
+
label: "Unresolved refs",
|
|
6185
|
+
value: entry.ungroundedReferenceNumbers.length > 0 ? entry.ungroundedReferenceNumbers.join(", ") : "none"
|
|
6186
|
+
},
|
|
6187
|
+
{
|
|
6188
|
+
label: "Answer",
|
|
6189
|
+
value: entry.answer.trim().length > 0 ? entry.answer : "n/a"
|
|
6190
|
+
},
|
|
6191
|
+
{
|
|
6192
|
+
label: "Previous answer",
|
|
6193
|
+
value: entry.previousAnswer && entry.previousAnswer.trim().length > 0 ? entry.previousAnswer : "n/a"
|
|
6194
|
+
}
|
|
6195
|
+
],
|
|
6196
|
+
summary: `${entry.answerChange} \xB7 ${entry.coverage} \xB7 resolved ${entry.resolvedCitationCount}/${entry.citationCount} \xB7 refs ${entry.referenceCount}`
|
|
6197
|
+
};
|
|
6198
|
+
});
|
|
6199
|
+
};
|
|
6200
|
+
var buildRAGAnswerGroundingHistoryRows = (history) => {
|
|
6201
|
+
if (!history?.latestRun) {
|
|
6202
|
+
return [{ label: "History", value: "No persisted provider runs yet." }];
|
|
6203
|
+
}
|
|
6204
|
+
const rows = [
|
|
6205
|
+
{ label: "Runs recorded", value: String(history.runs.length) },
|
|
6206
|
+
{
|
|
6207
|
+
label: "Latest",
|
|
6208
|
+
value: `${history.latestRun.label} \xB7 ${formatGroundingHistorySummaryValue(history.latestRun.response)}`
|
|
6209
|
+
}
|
|
6210
|
+
];
|
|
6211
|
+
if (history.previousRun) {
|
|
6212
|
+
rows.push({
|
|
6213
|
+
label: "Previous",
|
|
6214
|
+
value: `${history.previousRun.label} \xB7 ${formatGroundingHistorySummaryValue(history.previousRun.response)}`
|
|
6215
|
+
});
|
|
6216
|
+
}
|
|
6217
|
+
if (history.leaderboard[0]) {
|
|
6218
|
+
rows.push({
|
|
6219
|
+
label: "Best recorded",
|
|
6220
|
+
value: `#${history.leaderboard[0].rank} \xB7 ${history.leaderboard[0].label} \xB7 passing ${formatEvaluationPassingRate(history.leaderboard[0].passingRate)} \xB7 citation f1 ${history.leaderboard[0].averageCitationF1.toFixed(3)} \xB7 resolved ${formatEvaluationPassingRate(history.leaderboard[0].averageResolvedCitationRate)}`
|
|
6221
|
+
});
|
|
6222
|
+
}
|
|
6223
|
+
if (history.caseSnapshots.length > 0) {
|
|
6224
|
+
const changedAnswers = history.caseSnapshots.filter((entry) => entry.answerChange === "changed").length;
|
|
6225
|
+
rows.push({
|
|
6226
|
+
label: "Answer drift",
|
|
6227
|
+
value: `${changedAnswers}/${history.caseSnapshots.length} changed`
|
|
6228
|
+
});
|
|
6229
|
+
}
|
|
6230
|
+
if (!history.diff) {
|
|
6231
|
+
rows.push({
|
|
6232
|
+
label: "History diff",
|
|
6233
|
+
value: "Run the provider comparison again to diff grounding regressions over time."
|
|
6234
|
+
});
|
|
6235
|
+
return rows;
|
|
6236
|
+
}
|
|
6237
|
+
rows.push({
|
|
6238
|
+
label: "Passing delta",
|
|
6239
|
+
value: formatSignedDelta(history.diff.summaryDelta.passingRate, 1, "%")
|
|
6240
|
+
}, {
|
|
6241
|
+
label: "Citation F1 delta",
|
|
6242
|
+
value: formatSignedDelta(history.diff.summaryDelta.averageCitationF1, 3)
|
|
6243
|
+
}, {
|
|
6244
|
+
label: "Resolved citation delta",
|
|
6245
|
+
value: formatSignedDelta(history.diff.summaryDelta.averageResolvedCitationRate * 100, 1, "%")
|
|
6246
|
+
}, {
|
|
6247
|
+
label: "Improved",
|
|
6248
|
+
value: formatGroundingHistoryCaseLabels(history.diff.improvedCases)
|
|
6249
|
+
}, {
|
|
6250
|
+
label: "Regressed",
|
|
6251
|
+
value: formatGroundingHistoryCaseLabels(history.diff.regressedCases)
|
|
6252
|
+
});
|
|
6253
|
+
return rows;
|
|
6254
|
+
};
|
|
6255
|
+
var buildRAGAnswerGroundingHistoryPresentation = (history) => ({
|
|
6256
|
+
caseSnapshots: buildRAGAnswerGroundingCaseSnapshotPresentations(history),
|
|
6257
|
+
rows: buildRAGAnswerGroundingHistoryRows(history),
|
|
6258
|
+
summary: history?.latestRun ? history.latestRun.label : "No persisted provider runs yet."
|
|
6259
|
+
});
|
|
6129
6260
|
var createRAGFileEvaluationHistoryStore = (path) => ({
|
|
6130
6261
|
listRuns: async ({ limit, suiteId } = {}) => {
|
|
6131
6262
|
let parsed = [];
|
|
@@ -11814,15 +11945,19 @@ export {
|
|
|
11814
11945
|
buildRAGEvaluationResponse,
|
|
11815
11946
|
buildRAGEvaluationLeaderboard,
|
|
11816
11947
|
buildRAGEvaluationHistoryRows,
|
|
11948
|
+
buildRAGEvaluationHistoryPresentation,
|
|
11817
11949
|
buildRAGEvaluationCaseTracePresentations,
|
|
11818
11950
|
buildRAGContext,
|
|
11819
11951
|
buildRAGComparisonTraceSummaryRows,
|
|
11820
11952
|
buildRAGComparisonTraceDiffRows,
|
|
11821
11953
|
buildRAGCitations,
|
|
11822
11954
|
buildRAGCitationReferenceMap,
|
|
11955
|
+
buildRAGAnswerGroundingHistoryRows,
|
|
11956
|
+
buildRAGAnswerGroundingHistoryPresentation,
|
|
11823
11957
|
buildRAGAnswerGroundingEvaluationRunDiff,
|
|
11824
11958
|
buildRAGAnswerGroundingEvaluationResponse,
|
|
11825
11959
|
buildRAGAnswerGroundingEvaluationLeaderboard,
|
|
11960
|
+
buildRAGAnswerGroundingCaseSnapshotPresentations,
|
|
11826
11961
|
buildRAGAnswerGroundingCaseDifficultyRunDiff,
|
|
11827
11962
|
buildRAGAnswerGroundingCaseDifficultyLeaderboard,
|
|
11828
11963
|
applyRAGReranking,
|
|
@@ -11833,5 +11968,5 @@ export {
|
|
|
11833
11968
|
aiChat
|
|
11834
11969
|
};
|
|
11835
11970
|
|
|
11836
|
-
//# debugId=
|
|
11971
|
+
//# debugId=188A5A929B4F9DCA64756E2164756E21
|
|
11837
11972
|
//# sourceMappingURL=index.js.map
|