@absolutejs/absolute 0.19.0-beta.615 → 0.19.0-beta.617
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 +93 -46
- package/dist/ai/client/index.js.map +7 -7
- package/dist/ai/client/ui.js +5 -1
- package/dist/ai/client/ui.js.map +3 -3
- package/dist/ai/index.js +1544 -253
- package/dist/ai/index.js.map +14 -12
- package/dist/ai/rag/quality.js +49 -6
- package/dist/ai/rag/quality.js.map +4 -4
- package/dist/ai/rag/ui.js +5 -1
- package/dist/ai/rag/ui.js.map +3 -3
- package/dist/ai-client/angular/ai/index.js +44 -40
- package/dist/ai-client/react/ai/index.js +46 -42
- package/dist/ai-client/vue/ai/index.js +44 -40
- package/dist/angular/ai/index.js +46 -42
- package/dist/angular/ai/index.js.map +6 -6
- package/dist/angular/index.js +2 -2
- package/dist/angular/index.js.map +1 -1
- package/dist/angular/server.js +2 -2
- package/dist/angular/server.js.map +1 -1
- package/dist/build.js +2 -2
- package/dist/build.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/react/ai/index.js +97 -50
- package/dist/react/ai/index.js.map +9 -9
- package/dist/src/ai/client/actions.d.ts +1 -1
- package/dist/src/ai/index.d.ts +2 -2
- package/dist/src/ai/protocol.d.ts +1 -1
- package/dist/src/ai/rag/accessControl.d.ts +2 -0
- package/dist/src/ai/rag/chat.d.ts +21 -23
- package/dist/src/ai/rag/index.d.ts +4 -2
- package/dist/src/ai/rag/ingestion.d.ts +12 -3
- package/dist/src/ai/rag/jobState.d.ts +2 -0
- package/dist/src/ai/rag/quality.d.ts +20 -10
- package/dist/src/vue/ai/useRAG.d.ts +26 -0
- package/dist/src/vue/ai/useRAGChunkPreview.d.ts +4 -0
- package/dist/src/vue/ai/useRAGDocuments.d.ts +4 -0
- package/dist/src/vue/ai/useRAGEvaluate.d.ts +14 -0
- package/dist/src/vue/ai/useRAGIndexAdmin.d.ts +2 -0
- package/dist/src/vue/ai/useRAGSearch.d.ts +2 -0
- package/dist/svelte/ai/index.js +93 -46
- package/dist/svelte/ai/index.js.map +7 -7
- package/dist/types/ai.d.ts +190 -0
- package/dist/vue/ai/index.js +93 -46
- package/dist/vue/ai/index.js.map +7 -7
- package/package.json +7 -7
package/dist/ai/rag/quality.js
CHANGED
|
@@ -179,7 +179,7 @@ var parseAIMessage = (raw) => {
|
|
|
179
179
|
return null;
|
|
180
180
|
}
|
|
181
181
|
};
|
|
182
|
-
var serializeAIMessage = (
|
|
182
|
+
var serializeAIMessage = (message) => JSON.stringify(message);
|
|
183
183
|
|
|
184
184
|
// src/ai/rag/grounding.ts
|
|
185
185
|
var getContextString = (value) => typeof value === "string" && value.trim().length > 0 ? value.trim() : undefined;
|
|
@@ -1267,7 +1267,10 @@ var evaluateRAGCollectionCases = async ({
|
|
|
1267
1267
|
const expectedIds = normalizeExpectedIds(mode === "chunkId" ? caseInput.expectedChunkIds ?? [] : mode === "source" ? caseInput.expectedSources ?? [] : caseInput.expectedDocumentIds ?? []);
|
|
1268
1268
|
const topK = typeof caseInput.topK === "number" ? caseInput.topK : typeof input.topK === "number" ? input.topK : defaultTopK;
|
|
1269
1269
|
const searchInput = {
|
|
1270
|
-
filter:
|
|
1270
|
+
filter: caseInput.corpusKey ? {
|
|
1271
|
+
...(typeof caseInput.filter === "object" ? caseInput.filter : input.filter) ?? {},
|
|
1272
|
+
corpusKey: caseInput.corpusKey
|
|
1273
|
+
} : typeof caseInput.filter === "object" ? caseInput.filter : input.filter,
|
|
1271
1274
|
model: caseInput.model ?? input.model,
|
|
1272
1275
|
query,
|
|
1273
1276
|
rerank,
|
|
@@ -1669,6 +1672,7 @@ var buildEvaluationCaseTraceSnapshot = ({
|
|
|
1669
1672
|
return {
|
|
1670
1673
|
candidateTopK: currentTrace?.candidateTopK ?? 0,
|
|
1671
1674
|
caseId: caseResult.caseId,
|
|
1675
|
+
corpusKey: caseResult.corpusKey,
|
|
1672
1676
|
inputFilter: filter,
|
|
1673
1677
|
finalCount: currentTrace?.resultCounts.final ?? 0,
|
|
1674
1678
|
label: caseResult.label,
|
|
@@ -2983,16 +2987,32 @@ var loadRAGRetrievalComparisonHistory = async ({
|
|
|
2983
2987
|
suiteId,
|
|
2984
2988
|
label,
|
|
2985
2989
|
winnerId,
|
|
2990
|
+
corpusGroupKey,
|
|
2986
2991
|
groupKey,
|
|
2987
2992
|
tag
|
|
2988
|
-
}) => normalizeRetrievalComparisonRuns(await Promise.resolve(store.listRuns({
|
|
2993
|
+
}) => normalizeRetrievalComparisonRuns(await Promise.resolve(store.listRuns({
|
|
2994
|
+
corpusGroupKey,
|
|
2995
|
+
groupKey,
|
|
2996
|
+
label,
|
|
2997
|
+
limit,
|
|
2998
|
+
suiteId,
|
|
2999
|
+
tag,
|
|
3000
|
+
winnerId
|
|
3001
|
+
})));
|
|
2989
3002
|
var loadRAGRetrievalBaselines = async ({
|
|
2990
3003
|
store,
|
|
3004
|
+
corpusGroupKey,
|
|
2991
3005
|
groupKey,
|
|
2992
3006
|
tag,
|
|
2993
3007
|
limit,
|
|
2994
3008
|
status
|
|
2995
|
-
}) => normalizeRetrievalBaselineRecords(await Promise.resolve(store.listBaselines({
|
|
3009
|
+
}) => normalizeRetrievalBaselineRecords(await Promise.resolve(store.listBaselines({
|
|
3010
|
+
corpusGroupKey,
|
|
3011
|
+
groupKey,
|
|
3012
|
+
limit,
|
|
3013
|
+
status,
|
|
3014
|
+
tag
|
|
3015
|
+
})));
|
|
2996
3016
|
var persistRAGRetrievalBaseline = async ({
|
|
2997
3017
|
store,
|
|
2998
3018
|
record
|
|
@@ -3002,18 +3022,21 @@ var persistRAGRetrievalBaseline = async ({
|
|
|
3002
3022
|
};
|
|
3003
3023
|
var loadRAGRetrievalReleaseDecisions = async ({
|
|
3004
3024
|
store,
|
|
3025
|
+
corpusGroupKey,
|
|
3005
3026
|
groupKey,
|
|
3006
3027
|
limit,
|
|
3007
3028
|
kind
|
|
3008
|
-
}) => normalizeRetrievalReleaseDecisionRecords(await Promise.resolve(store.listDecisions({ groupKey, kind, limit })));
|
|
3029
|
+
}) => normalizeRetrievalReleaseDecisionRecords(await Promise.resolve(store.listDecisions({ corpusGroupKey, groupKey, kind, limit })));
|
|
3009
3030
|
var loadRAGRetrievalLaneHandoffDecisions = async ({
|
|
3010
3031
|
store,
|
|
3032
|
+
corpusGroupKey,
|
|
3011
3033
|
groupKey,
|
|
3012
3034
|
limit,
|
|
3013
3035
|
kind,
|
|
3014
3036
|
sourceRolloutLabel,
|
|
3015
3037
|
targetRolloutLabel
|
|
3016
3038
|
}) => normalizeRetrievalLaneHandoffDecisionRecords(await Promise.resolve(store.listDecisions({
|
|
3039
|
+
corpusGroupKey,
|
|
3017
3040
|
groupKey,
|
|
3018
3041
|
kind,
|
|
3019
3042
|
limit,
|
|
@@ -3036,12 +3059,14 @@ var loadRAGRetrievalReleaseIncidents = async ({
|
|
|
3036
3059
|
})));
|
|
3037
3060
|
var loadRAGRetrievalLaneHandoffIncidents = async ({
|
|
3038
3061
|
store,
|
|
3062
|
+
corpusGroupKey,
|
|
3039
3063
|
groupKey,
|
|
3040
3064
|
limit,
|
|
3041
3065
|
targetRolloutLabel,
|
|
3042
3066
|
status,
|
|
3043
3067
|
severity
|
|
3044
3068
|
}) => normalizeRetrievalReleaseIncidentRecords(await Promise.resolve(store.listIncidents({
|
|
3069
|
+
corpusGroupKey,
|
|
3045
3070
|
groupKey,
|
|
3046
3071
|
limit,
|
|
3047
3072
|
severity,
|
|
@@ -3050,12 +3075,14 @@ var loadRAGRetrievalLaneHandoffIncidents = async ({
|
|
|
3050
3075
|
})));
|
|
3051
3076
|
var loadRAGRetrievalLaneHandoffIncidentHistory = async ({
|
|
3052
3077
|
store,
|
|
3078
|
+
corpusGroupKey,
|
|
3053
3079
|
action,
|
|
3054
3080
|
groupKey,
|
|
3055
3081
|
incidentId,
|
|
3056
3082
|
limit,
|
|
3057
3083
|
targetRolloutLabel
|
|
3058
3084
|
}) => await Promise.resolve(store.listRecords({
|
|
3085
|
+
corpusGroupKey,
|
|
3059
3086
|
action,
|
|
3060
3087
|
groupKey,
|
|
3061
3088
|
incidentId,
|
|
@@ -3100,21 +3127,25 @@ var loadRAGRetrievalIncidentRemediationExecutionHistory = async ({
|
|
|
3100
3127
|
})));
|
|
3101
3128
|
var loadRAGRetrievalLaneHandoffAutoCompletePolicyHistory = async ({
|
|
3102
3129
|
store,
|
|
3130
|
+
corpusGroupKey,
|
|
3103
3131
|
groupKey,
|
|
3104
3132
|
limit,
|
|
3105
3133
|
targetRolloutLabel
|
|
3106
3134
|
}) => await Promise.resolve(store.listRecords({
|
|
3135
|
+
corpusGroupKey,
|
|
3107
3136
|
groupKey,
|
|
3108
3137
|
limit,
|
|
3109
3138
|
targetRolloutLabel
|
|
3110
3139
|
}));
|
|
3111
3140
|
var loadRAGRetrievalReleaseLanePolicyHistory = async ({
|
|
3112
3141
|
store,
|
|
3142
|
+
corpusGroupKey,
|
|
3113
3143
|
groupKey,
|
|
3114
3144
|
limit,
|
|
3115
3145
|
rolloutLabel,
|
|
3116
3146
|
scope
|
|
3117
3147
|
}) => await Promise.resolve(store.listRecords({
|
|
3148
|
+
corpusGroupKey,
|
|
3118
3149
|
groupKey,
|
|
3119
3150
|
limit,
|
|
3120
3151
|
rolloutLabel,
|
|
@@ -3122,11 +3153,13 @@ var loadRAGRetrievalReleaseLanePolicyHistory = async ({
|
|
|
3122
3153
|
}));
|
|
3123
3154
|
var loadRAGRetrievalBaselineGatePolicyHistory = async ({
|
|
3124
3155
|
store,
|
|
3156
|
+
corpusGroupKey,
|
|
3125
3157
|
groupKey,
|
|
3126
3158
|
limit,
|
|
3127
3159
|
rolloutLabel,
|
|
3128
3160
|
scope
|
|
3129
3161
|
}) => await Promise.resolve(store.listRecords({
|
|
3162
|
+
corpusGroupKey,
|
|
3130
3163
|
groupKey,
|
|
3131
3164
|
limit,
|
|
3132
3165
|
rolloutLabel,
|
|
@@ -3134,6 +3167,7 @@ var loadRAGRetrievalBaselineGatePolicyHistory = async ({
|
|
|
3134
3167
|
}));
|
|
3135
3168
|
var loadRAGRetrievalReleaseLaneEscalationPolicyHistory = async ({
|
|
3136
3169
|
store,
|
|
3170
|
+
corpusGroupKey,
|
|
3137
3171
|
groupKey,
|
|
3138
3172
|
limit,
|
|
3139
3173
|
targetRolloutLabel
|
|
@@ -3221,11 +3255,15 @@ var persistRAGRetrievalReleaseLaneEscalationPolicyHistory = async ({
|
|
|
3221
3255
|
};
|
|
3222
3256
|
var buildRAGEvaluationResponse = (cases) => {
|
|
3223
3257
|
const totalCases = cases.length;
|
|
3258
|
+
const corpusKeys = [
|
|
3259
|
+
...new Set(cases.flatMap((entry) => entry.corpusKey ?? []))
|
|
3260
|
+
];
|
|
3224
3261
|
const passedCases = cases.filter((entry) => entry.status === "pass").length;
|
|
3225
3262
|
const partialCases = cases.filter((entry) => entry.status === "partial").length;
|
|
3226
3263
|
const failedCases = cases.filter((entry) => entry.status === "fail").length;
|
|
3227
3264
|
return {
|
|
3228
3265
|
cases,
|
|
3266
|
+
...corpusKeys.length > 0 ? { corpusKeys } : {},
|
|
3229
3267
|
elapsedMs: cases.reduce((sum, result) => sum + result.elapsedMs, 0),
|
|
3230
3268
|
ok: true,
|
|
3231
3269
|
passingRate: totalCases > 0 ? passedCases / totalCases * 100 : 0,
|
|
@@ -3451,6 +3489,9 @@ var compareRAGRetrievalStrategies = async ({
|
|
|
3451
3489
|
traceSummary: entry.traceSummary
|
|
3452
3490
|
})));
|
|
3453
3491
|
return {
|
|
3492
|
+
corpusKeys: [
|
|
3493
|
+
...new Set(entries.flatMap((entry) => entry.response.corpusKeys ?? []))
|
|
3494
|
+
],
|
|
3454
3495
|
entries,
|
|
3455
3496
|
leaderboard,
|
|
3456
3497
|
summary: summarizeRAGRetrievalComparison(entries),
|
|
@@ -3483,6 +3524,7 @@ var compareRAGRetrievalTraceSummaries = (current, previous) => ({
|
|
|
3483
3524
|
});
|
|
3484
3525
|
var buildSearchTraceResultSnapshots = (results) => results.map((result) => ({
|
|
3485
3526
|
chunkId: result.chunkId,
|
|
3527
|
+
corpusKey: result.corpusKey ?? (typeof result.metadata?.corpusKey === "string" ? result.metadata.corpusKey : undefined),
|
|
3486
3528
|
documentId: typeof result.metadata?.documentId === "string" ? result.metadata.documentId : undefined,
|
|
3487
3529
|
score: result.score,
|
|
3488
3530
|
source: result.source,
|
|
@@ -3682,6 +3724,7 @@ var summarizeRAGEvaluationCase = ({
|
|
|
3682
3724
|
const status = expectedCount === 0 ? "partial" : matchedCount === expectedCount ? "pass" : matchedCount > 0 ? "partial" : "fail";
|
|
3683
3725
|
return {
|
|
3684
3726
|
caseId: caseInput.id ?? `case-${caseIndex + 1}`,
|
|
3727
|
+
corpusKey: caseInput.corpusKey,
|
|
3685
3728
|
elapsedMs,
|
|
3686
3729
|
expectedCount,
|
|
3687
3730
|
expectedIds,
|
|
@@ -3793,5 +3836,5 @@ export {
|
|
|
3793
3836
|
buildRAGAnswerGroundingCaseDifficultyLeaderboard
|
|
3794
3837
|
};
|
|
3795
3838
|
|
|
3796
|
-
//# debugId=
|
|
3839
|
+
//# debugId=6A5C3ED0012F395064756E2164756E21
|
|
3797
3840
|
//# sourceMappingURL=quality.js.map
|