@absolutejs/absolute 0.19.0-beta.611 → 0.19.0-beta.612
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 +40 -1
- package/dist/ai/client/index.js.map +3 -3
- package/dist/ai/client/ui.js +40 -1
- package/dist/ai/client/ui.js.map +3 -3
- package/dist/ai/index.js +41 -2
- package/dist/ai/index.js.map +4 -4
- package/dist/ai/rag/ui.js +40 -1
- package/dist/ai/rag/ui.js.map +3 -3
- package/dist/ai-client/angular/ai/index.js +39 -0
- package/dist/ai-client/react/ai/index.js +39 -0
- package/dist/ai-client/vue/ai/index.js +39 -0
- package/dist/angular/ai/index.js +40 -1
- package/dist/angular/ai/index.js.map +3 -3
- package/dist/react/ai/index.js +40 -1
- package/dist/react/ai/index.js.map +3 -3
- package/dist/svelte/ai/index.js +40 -1
- package/dist/svelte/ai/index.js.map +3 -3
- package/dist/types/ai.d.ts +12 -0
- package/dist/vue/ai/index.js +40 -1
- package/dist/vue/ai/index.js.map +3 -3
- package/package.json +1 -1
package/dist/ai/client/index.js
CHANGED
|
@@ -5299,6 +5299,8 @@ var buildRAGSectionRetrievalDiagnostics = (sources, trace) => {
|
|
|
5299
5299
|
}
|
|
5300
5300
|
const diagnostics = [...sections.values()];
|
|
5301
5301
|
const strongestBestHit = diagnostics.reduce((highest, section) => Math.max(highest, section.bestScore), 0);
|
|
5302
|
+
const parentLabelByKey = new Map(diagnostics.map((section) => [section.key, section.parentLabel]));
|
|
5303
|
+
const stageSectionCounts = new Map((trace?.steps ?? []).filter((step) => Array.isArray(step.sectionCounts) && step.sectionCounts.length > 0).map((step) => [step.stage, step.sectionCounts ?? []]));
|
|
5302
5304
|
return diagnostics.map((section) => {
|
|
5303
5305
|
const siblingPool = diagnostics.filter((entry) => entry.parentLabel === section.parentLabel);
|
|
5304
5306
|
const siblings = siblingPool.filter((entry) => entry.key !== section.key);
|
|
@@ -5319,6 +5321,42 @@ var buildRAGSectionRetrievalDiagnostics = (sources, trace) => {
|
|
|
5319
5321
|
count: step.sectionCounts?.find((entry) => entry.key === section.key)?.count ?? 0,
|
|
5320
5322
|
stage: step.stage
|
|
5321
5323
|
})).filter((entry) => entry.count > 0) ?? [];
|
|
5324
|
+
const stageWeights = stageCounts.map((entry) => {
|
|
5325
|
+
const stageEntries = stageSectionCounts.get(entry.stage)?.filter((candidate) => candidate.count > 0) ?? [];
|
|
5326
|
+
const stageTotal = stageEntries.reduce((sum, candidate) => sum + candidate.count, 0);
|
|
5327
|
+
const siblingStageEntries = stageEntries.filter((candidate) => candidate.key !== section.key && parentLabelByKey.get(candidate.key) === section.parentLabel);
|
|
5328
|
+
const parentStageEntries = stageEntries.filter((candidate) => parentLabelByKey.get(candidate.key) === section.parentLabel);
|
|
5329
|
+
const strongestStageSibling = siblingStageEntries.slice().sort((left, right) => right.count - left.count)[0];
|
|
5330
|
+
const parentStageTotal = parentStageEntries.reduce((sum, candidate) => sum + candidate.count, 0);
|
|
5331
|
+
const stageShare = stageTotal > 0 ? entry.count / stageTotal : 0;
|
|
5332
|
+
const parentStageShare = parentStageTotal > 0 ? entry.count / parentStageTotal : undefined;
|
|
5333
|
+
const stageShareGap = stageTotal > 0 && strongestStageSibling ? entry.count / stageTotal - strongestStageSibling.count / stageTotal : undefined;
|
|
5334
|
+
const parentStageShareGap = parentStageTotal > 0 && strongestStageSibling ? entry.count / parentStageTotal - strongestStageSibling.count / parentStageTotal : undefined;
|
|
5335
|
+
const reasons2 = [];
|
|
5336
|
+
if (entry.stage === "rerank" && stageShare > 0.5 && (typeof stageShareGap !== "number" || stageShareGap > 0)) {
|
|
5337
|
+
reasons2.push("rerank_preserved_lead");
|
|
5338
|
+
}
|
|
5339
|
+
if (entry.stage === "finalize" && stageShare >= 0.5) {
|
|
5340
|
+
reasons2.push("final_stage_concentration");
|
|
5341
|
+
}
|
|
5342
|
+
if (entry.stage === "finalize" && typeof parentStageShare === "number" && parentStageShare >= 0.6 && (typeof parentStageShareGap !== "number" || parentStageShareGap > 0)) {
|
|
5343
|
+
reasons2.push("final_stage_dominant_within_parent");
|
|
5344
|
+
}
|
|
5345
|
+
if (strongestStageSibling && (typeof stageShareGap === "number" && stageShareGap <= 0.1 || typeof parentStageShareGap === "number" && parentStageShareGap <= 0.1)) {
|
|
5346
|
+
reasons2.push("stage_runner_up_pressure");
|
|
5347
|
+
}
|
|
5348
|
+
return {
|
|
5349
|
+
count: entry.count,
|
|
5350
|
+
parentStageShare,
|
|
5351
|
+
parentStageShareGap,
|
|
5352
|
+
reasons: reasons2,
|
|
5353
|
+
stage: entry.stage,
|
|
5354
|
+
stageShare,
|
|
5355
|
+
stageShareGap,
|
|
5356
|
+
strongestSiblingCount: strongestStageSibling?.count,
|
|
5357
|
+
strongestSiblingLabel: strongestStageSibling ? diagnostics.find((candidate) => candidate.key === strongestStageSibling.key)?.label ?? strongestStageSibling.key : undefined
|
|
5358
|
+
};
|
|
5359
|
+
});
|
|
5322
5360
|
const firstSeenStage = stageCounts[0]?.stage;
|
|
5323
5361
|
const lastSeenStage = stageCounts.at(-1)?.stage;
|
|
5324
5362
|
if (section.bestScore >= strongestBestHit) {
|
|
@@ -5361,6 +5399,7 @@ var buildRAGSectionRetrievalDiagnostics = (sources, trace) => {
|
|
|
5361
5399
|
scoreShare,
|
|
5362
5400
|
scoreThresholdApplied: trace?.steps.some((step) => step.stage === "score_filter"),
|
|
5363
5401
|
stageCounts,
|
|
5402
|
+
stageWeights,
|
|
5364
5403
|
siblingCount: siblings.length,
|
|
5365
5404
|
siblingScoreGap: strongestSibling ? section.totalScore - strongestSibling.totalScore : undefined,
|
|
5366
5405
|
sourceCount: section.sourceSet.size,
|
|
@@ -7315,5 +7354,5 @@ export {
|
|
|
7315
7354
|
buildRAGEvaluationLeaderboard
|
|
7316
7355
|
};
|
|
7317
7356
|
|
|
7318
|
-
//# debugId=
|
|
7357
|
+
//# debugId=6DDF41CB2B08D94664756E2164756E21
|
|
7319
7358
|
//# sourceMappingURL=index.js.map
|