@absolutejs/absolute 0.19.0-beta.536 → 0.19.0-beta.538

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.
@@ -1133,6 +1133,13 @@ export type RAGAnswerGroundingEvaluationHistory = {
1133
1133
  caseSnapshots: RAGAnswerGroundingEvaluationCaseSnapshot[];
1134
1134
  diff?: RAGAnswerGroundingEvaluationRunDiff;
1135
1135
  };
1136
+ export type RAGAnswerGroundingCaseSnapshotPresentation = {
1137
+ caseId: string;
1138
+ label: string;
1139
+ summary: string;
1140
+ answerChange: RAGAnswerGroundingEvaluationCaseSnapshot['answerChange'];
1141
+ rows: RAGLabelValueRow[];
1142
+ };
1136
1143
  export type RAGEvaluationInput = {
1137
1144
  cases: RAGEvaluationCase[];
1138
1145
  topK?: number;
@@ -1297,6 +1304,13 @@ export type RAGRetrievalTracePresentation = {
1297
1304
  details: RAGLabelValueRow[];
1298
1305
  steps: RAGRetrievalTraceStepPresentation[];
1299
1306
  };
1307
+ export type RAGEvaluationCaseTracePresentation = {
1308
+ caseId: string;
1309
+ label: string;
1310
+ summary: string;
1311
+ traceChange: RAGEvaluationCaseTraceSnapshot['traceChange'];
1312
+ rows: RAGLabelValueRow[];
1313
+ };
1300
1314
  export type RAGEvaluationLeaderboardEntry = {
1301
1315
  runId: string;
1302
1316
  suiteId: string;
@@ -2477,6 +2477,64 @@ var buildRAGEvaluationHistoryRows = (history) => {
2477
2477
  }
2478
2478
  return rows;
2479
2479
  };
2480
+ var buildRAGEvaluationCaseTracePresentations = (history) => {
2481
+ if (!history?.caseTraceSnapshots.length) {
2482
+ return [];
2483
+ }
2484
+ return history.caseTraceSnapshots.map((entry) => {
2485
+ const label = entry.label ?? entry.caseId;
2486
+ const currentMode = entry.traceMode ?? "no-trace";
2487
+ const previousMode = entry.previousTraceMode ?? "n/a";
2488
+ const currentVariants = entry.variantQueries.length > 0 ? entry.variantQueries.join(", ") : "none";
2489
+ const previousVariants = entry.previousVariantQueries.length > 0 ? entry.previousVariantQueries.join(", ") : "none";
2490
+ const currentStages = Object.keys(entry.stageCounts).length > 0 ? Object.entries(entry.stageCounts).map(([stage, count]) => `${stage} ${count}`).join(", ") : "none";
2491
+ const previousStages = Object.keys(entry.previousStageCounts).length > 0 ? Object.entries(entry.previousStageCounts).map(([stage, count]) => `${stage} ${count}`).join(", ") : "none";
2492
+ return {
2493
+ caseId: entry.caseId,
2494
+ label,
2495
+ summary: `${entry.traceChange} \xB7 ${previousMode}\u2192${currentMode} \xB7 final ${entry.previousFinalCount ?? 0}\u2192${entry.finalCount}`,
2496
+ traceChange: entry.traceChange,
2497
+ rows: [
2498
+ { label: "Query", value: entry.query },
2499
+ { label: "Trace change", value: entry.traceChange },
2500
+ { label: "Mode", value: `${previousMode}\u2192${currentMode}` },
2501
+ {
2502
+ label: "Transformed query",
2503
+ value: `${entry.previousTransformedQuery?.trim() || "n/a"}\u2192${entry.transformedQuery?.trim() || "n/a"}`
2504
+ },
2505
+ {
2506
+ label: "Final",
2507
+ value: `${entry.previousFinalCount ?? 0}\u2192${entry.finalCount}`
2508
+ },
2509
+ {
2510
+ label: "Vector",
2511
+ value: `${entry.previousVectorCount ?? 0}\u2192${entry.vectorCount}`
2512
+ },
2513
+ {
2514
+ label: "Lexical",
2515
+ value: `${entry.previousLexicalCount ?? 0}\u2192${entry.lexicalCount}`
2516
+ },
2517
+ {
2518
+ label: "Candidate topK",
2519
+ value: `${entry.previousCandidateTopK ?? 0}\u2192${entry.candidateTopK}`
2520
+ },
2521
+ {
2522
+ label: "Lexical topK",
2523
+ value: `${entry.previousLexicalTopK ?? 0}\u2192${entry.lexicalTopK}`
2524
+ },
2525
+ {
2526
+ label: "Variants",
2527
+ value: `${previousVariants}\u2192${currentVariants}`
2528
+ },
2529
+ {
2530
+ label: "Stages",
2531
+ value: `${previousStages}\u2192${currentStages}`
2532
+ },
2533
+ { label: "Status", value: entry.status }
2534
+ ]
2535
+ };
2536
+ });
2537
+ };
2480
2538
  var buildRAGEvaluationRunDiff = ({
2481
2539
  current,
2482
2540
  previous
@@ -2545,6 +2603,69 @@ var buildRAGAnswerGroundingEvaluationRunDiff = ({
2545
2603
  unchangedCases
2546
2604
  };
2547
2605
  };
2606
+ var buildRAGAnswerGroundingCaseSnapshotPresentations = (history) => {
2607
+ if (!history?.caseSnapshots.length) {
2608
+ return [];
2609
+ }
2610
+ return history.caseSnapshots.map((entry) => {
2611
+ const label = entry.label ?? entry.caseId;
2612
+ return {
2613
+ answerChange: entry.answerChange,
2614
+ caseId: entry.caseId,
2615
+ label,
2616
+ rows: [
2617
+ {
2618
+ label: "Query",
2619
+ value: entry.query?.trim().length ? entry.query : "n/a"
2620
+ },
2621
+ { label: "Answer change", value: entry.answerChange },
2622
+ { label: "Coverage", value: entry.coverage },
2623
+ {
2624
+ label: "Resolved citations",
2625
+ value: `${entry.resolvedCitationCount}/${entry.citationCount}`
2626
+ },
2627
+ {
2628
+ label: "Resolved citation rate",
2629
+ value: entry.resolvedCitationRate.toFixed(3)
2630
+ },
2631
+ { label: "Citation F1", value: entry.citationF1.toFixed(3) },
2632
+ {
2633
+ label: "Reference count",
2634
+ value: String(entry.referenceCount)
2635
+ },
2636
+ {
2637
+ label: "Cited IDs",
2638
+ value: entry.citedIds.length > 0 ? entry.citedIds.join(", ") : "none"
2639
+ },
2640
+ {
2641
+ label: "Matched IDs",
2642
+ value: entry.matchedIds.length > 0 ? entry.matchedIds.join(", ") : "none"
2643
+ },
2644
+ {
2645
+ label: "Missing IDs",
2646
+ value: entry.missingIds.length > 0 ? entry.missingIds.join(", ") : "none"
2647
+ },
2648
+ {
2649
+ label: "Extra IDs",
2650
+ value: entry.extraIds.length > 0 ? entry.extraIds.join(", ") : "none"
2651
+ },
2652
+ {
2653
+ label: "Unresolved refs",
2654
+ value: entry.ungroundedReferenceNumbers.length > 0 ? entry.ungroundedReferenceNumbers.join(", ") : "none"
2655
+ },
2656
+ {
2657
+ label: "Answer",
2658
+ value: entry.answer.trim().length > 0 ? entry.answer : "n/a"
2659
+ },
2660
+ {
2661
+ label: "Previous answer",
2662
+ value: entry.previousAnswer && entry.previousAnswer.trim().length > 0 ? entry.previousAnswer : "n/a"
2663
+ }
2664
+ ],
2665
+ summary: `${entry.answerChange} \xB7 ${entry.coverage} \xB7 resolved ${entry.resolvedCitationCount}/${entry.citationCount} \xB7 refs ${entry.referenceCount}`
2666
+ };
2667
+ });
2668
+ };
2548
2669
  var createRAGFileEvaluationHistoryStore = (path) => ({
2549
2670
  listRuns: async ({ limit, suiteId } = {}) => {
2550
2671
  let parsed = [];
@@ -3768,5 +3889,5 @@ export {
3768
3889
  AIStreamKey
3769
3890
  };
3770
3891
 
3771
- //# debugId=302ACD06C95EFA1364756E2164756E21
3892
+ //# debugId=69A98548515264F064756E2164756E21
3772
3893
  //# sourceMappingURL=index.js.map