@absolutejs/absolute 0.19.0-beta.535 → 0.19.0-beta.537
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 +122 -1
- package/dist/ai/client/index.js.map +4 -4
- package/dist/ai/index.js +125 -1
- package/dist/ai/index.js.map +4 -4
- package/dist/angular/ai/index.js +64 -1
- package/dist/angular/ai/index.js.map +3 -3
- package/dist/react/ai/index.js +122 -1
- package/dist/react/ai/index.js.map +4 -4
- package/dist/src/ai/index.d.ts +1 -1
- package/dist/src/ai/rag/index.d.ts +2 -2
- package/dist/src/ai/rag/presentation.d.ts +3 -1
- package/dist/src/ai/rag/quality.d.ts +2 -1
- package/dist/svelte/ai/index.js +122 -1
- package/dist/svelte/ai/index.js.map +4 -4
- package/dist/types/ai.d.ts +18 -0
- package/dist/vue/ai/index.js +122 -1
- package/dist/vue/ai/index.js.map +4 -4
- package/package.json +7 -7
package/dist/ai/index.js
CHANGED
|
@@ -4718,6 +4718,69 @@ var formatTimestampLabel = (value) => {
|
|
|
4718
4718
|
timeStyle: "short"
|
|
4719
4719
|
});
|
|
4720
4720
|
};
|
|
4721
|
+
var formatRAGTraceValue = (value) => {
|
|
4722
|
+
if (typeof value === "string")
|
|
4723
|
+
return value;
|
|
4724
|
+
if (typeof value === "number" || typeof value === "boolean") {
|
|
4725
|
+
return String(value);
|
|
4726
|
+
}
|
|
4727
|
+
if (Array.isArray(value)) {
|
|
4728
|
+
return value.join(", ");
|
|
4729
|
+
}
|
|
4730
|
+
if (value && typeof value === "object") {
|
|
4731
|
+
return JSON.stringify(value);
|
|
4732
|
+
}
|
|
4733
|
+
return "n/a";
|
|
4734
|
+
};
|
|
4735
|
+
var buildRAGRetrievalTracePresentation = (trace) => {
|
|
4736
|
+
if (!trace) {
|
|
4737
|
+
return {
|
|
4738
|
+
details: [],
|
|
4739
|
+
stats: [],
|
|
4740
|
+
steps: []
|
|
4741
|
+
};
|
|
4742
|
+
}
|
|
4743
|
+
const stats = [
|
|
4744
|
+
{ label: "Mode", value: trace.mode },
|
|
4745
|
+
{ label: "Final Results", value: String(trace.resultCounts.final) },
|
|
4746
|
+
{
|
|
4747
|
+
label: "Vector Candidates",
|
|
4748
|
+
value: String(trace.resultCounts.vector)
|
|
4749
|
+
},
|
|
4750
|
+
{
|
|
4751
|
+
label: "Lexical Candidates",
|
|
4752
|
+
value: String(trace.resultCounts.lexical)
|
|
4753
|
+
}
|
|
4754
|
+
];
|
|
4755
|
+
const details = [
|
|
4756
|
+
{ label: "Transformed query", value: trace.transformedQuery },
|
|
4757
|
+
{
|
|
4758
|
+
label: "Variant queries",
|
|
4759
|
+
value: trace.variantQueries.length > 0 ? trace.variantQueries.join(" \xB7 ") : "none"
|
|
4760
|
+
},
|
|
4761
|
+
{ label: "Candidate topK", value: String(trace.candidateTopK) },
|
|
4762
|
+
{ label: "Lexical topK", value: String(trace.lexicalTopK) }
|
|
4763
|
+
];
|
|
4764
|
+
const steps = trace.steps.map((step) => ({
|
|
4765
|
+
count: step.count,
|
|
4766
|
+
label: step.label,
|
|
4767
|
+
rows: [
|
|
4768
|
+
{ label: "stage", value: step.stage },
|
|
4769
|
+
...typeof step.count === "number" ? [{ label: "count", value: String(step.count) }] : [],
|
|
4770
|
+
...typeof step.durationMs === "number" ? [{ label: "durationMs", value: String(step.durationMs) }] : [],
|
|
4771
|
+
...Object.entries(step.metadata ?? {}).map(([key, value]) => ({
|
|
4772
|
+
label: key,
|
|
4773
|
+
value: formatRAGTraceValue(value)
|
|
4774
|
+
}))
|
|
4775
|
+
],
|
|
4776
|
+
stage: step.stage
|
|
4777
|
+
}));
|
|
4778
|
+
return {
|
|
4779
|
+
details,
|
|
4780
|
+
stats,
|
|
4781
|
+
steps
|
|
4782
|
+
};
|
|
4783
|
+
};
|
|
4721
4784
|
var formatMediaTimestamp = (value) => {
|
|
4722
4785
|
if (typeof value !== "number" || !Number.isFinite(value) || value < 0) {
|
|
4723
4786
|
return;
|
|
@@ -5937,6 +6000,64 @@ var buildRAGEvaluationHistoryRows = (history) => {
|
|
|
5937
6000
|
}
|
|
5938
6001
|
return rows;
|
|
5939
6002
|
};
|
|
6003
|
+
var buildRAGEvaluationCaseTracePresentations = (history) => {
|
|
6004
|
+
if (!history?.caseTraceSnapshots.length) {
|
|
6005
|
+
return [];
|
|
6006
|
+
}
|
|
6007
|
+
return history.caseTraceSnapshots.map((entry) => {
|
|
6008
|
+
const label = entry.label ?? entry.caseId;
|
|
6009
|
+
const currentMode = entry.traceMode ?? "no-trace";
|
|
6010
|
+
const previousMode = entry.previousTraceMode ?? "n/a";
|
|
6011
|
+
const currentVariants = entry.variantQueries.length > 0 ? entry.variantQueries.join(", ") : "none";
|
|
6012
|
+
const previousVariants = entry.previousVariantQueries.length > 0 ? entry.previousVariantQueries.join(", ") : "none";
|
|
6013
|
+
const currentStages = Object.keys(entry.stageCounts).length > 0 ? Object.entries(entry.stageCounts).map(([stage, count]) => `${stage} ${count}`).join(", ") : "none";
|
|
6014
|
+
const previousStages = Object.keys(entry.previousStageCounts).length > 0 ? Object.entries(entry.previousStageCounts).map(([stage, count]) => `${stage} ${count}`).join(", ") : "none";
|
|
6015
|
+
return {
|
|
6016
|
+
caseId: entry.caseId,
|
|
6017
|
+
label,
|
|
6018
|
+
summary: `${entry.traceChange} \xB7 ${previousMode}\u2192${currentMode} \xB7 final ${entry.previousFinalCount ?? 0}\u2192${entry.finalCount}`,
|
|
6019
|
+
traceChange: entry.traceChange,
|
|
6020
|
+
rows: [
|
|
6021
|
+
{ label: "Query", value: entry.query },
|
|
6022
|
+
{ label: "Trace change", value: entry.traceChange },
|
|
6023
|
+
{ label: "Mode", value: `${previousMode}\u2192${currentMode}` },
|
|
6024
|
+
{
|
|
6025
|
+
label: "Transformed query",
|
|
6026
|
+
value: `${entry.previousTransformedQuery?.trim() || "n/a"}\u2192${entry.transformedQuery?.trim() || "n/a"}`
|
|
6027
|
+
},
|
|
6028
|
+
{
|
|
6029
|
+
label: "Final",
|
|
6030
|
+
value: `${entry.previousFinalCount ?? 0}\u2192${entry.finalCount}`
|
|
6031
|
+
},
|
|
6032
|
+
{
|
|
6033
|
+
label: "Vector",
|
|
6034
|
+
value: `${entry.previousVectorCount ?? 0}\u2192${entry.vectorCount}`
|
|
6035
|
+
},
|
|
6036
|
+
{
|
|
6037
|
+
label: "Lexical",
|
|
6038
|
+
value: `${entry.previousLexicalCount ?? 0}\u2192${entry.lexicalCount}`
|
|
6039
|
+
},
|
|
6040
|
+
{
|
|
6041
|
+
label: "Candidate topK",
|
|
6042
|
+
value: `${entry.previousCandidateTopK ?? 0}\u2192${entry.candidateTopK}`
|
|
6043
|
+
},
|
|
6044
|
+
{
|
|
6045
|
+
label: "Lexical topK",
|
|
6046
|
+
value: `${entry.previousLexicalTopK ?? 0}\u2192${entry.lexicalTopK}`
|
|
6047
|
+
},
|
|
6048
|
+
{
|
|
6049
|
+
label: "Variants",
|
|
6050
|
+
value: `${previousVariants}\u2192${currentVariants}`
|
|
6051
|
+
},
|
|
6052
|
+
{
|
|
6053
|
+
label: "Stages",
|
|
6054
|
+
value: `${previousStages}\u2192${currentStages}`
|
|
6055
|
+
},
|
|
6056
|
+
{ label: "Status", value: entry.status }
|
|
6057
|
+
]
|
|
6058
|
+
};
|
|
6059
|
+
});
|
|
6060
|
+
};
|
|
5940
6061
|
var buildRAGEvaluationRunDiff = ({
|
|
5941
6062
|
current,
|
|
5942
6063
|
previous
|
|
@@ -11622,6 +11743,7 @@ export {
|
|
|
11622
11743
|
geminiEmbeddings,
|
|
11623
11744
|
gemini,
|
|
11624
11745
|
fuseRAGQueryResults,
|
|
11746
|
+
formatRAGTraceValue,
|
|
11625
11747
|
executeDryRunRAGEvaluation,
|
|
11626
11748
|
evaluateRAGCollection,
|
|
11627
11749
|
evaluateRAGAnswerGroundingCase,
|
|
@@ -11684,6 +11806,7 @@ export {
|
|
|
11684
11806
|
buildRAGStreamProgress,
|
|
11685
11807
|
buildRAGSourceSummaries,
|
|
11686
11808
|
buildRAGSourceGroups,
|
|
11809
|
+
buildRAGRetrievalTracePresentation,
|
|
11687
11810
|
buildRAGLexicalHaystack,
|
|
11688
11811
|
buildRAGGroundingReferences,
|
|
11689
11812
|
buildRAGGroundedAnswer,
|
|
@@ -11691,6 +11814,7 @@ export {
|
|
|
11691
11814
|
buildRAGEvaluationResponse,
|
|
11692
11815
|
buildRAGEvaluationLeaderboard,
|
|
11693
11816
|
buildRAGEvaluationHistoryRows,
|
|
11817
|
+
buildRAGEvaluationCaseTracePresentations,
|
|
11694
11818
|
buildRAGContext,
|
|
11695
11819
|
buildRAGComparisonTraceSummaryRows,
|
|
11696
11820
|
buildRAGComparisonTraceDiffRows,
|
|
@@ -11709,5 +11833,5 @@ export {
|
|
|
11709
11833
|
aiChat
|
|
11710
11834
|
};
|
|
11711
11835
|
|
|
11712
|
-
//# debugId=
|
|
11836
|
+
//# debugId=BBC0B1F804D3DF1E64756E2164756E21
|
|
11713
11837
|
//# sourceMappingURL=index.js.map
|