@absolutejs/absolute 0.19.0-beta.615 → 0.19.0-beta.616
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 +60 -43
- 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 +1101 -196
- package/dist/ai/index.js.map +14 -12
- package/dist/ai/rag/quality.js +16 -3
- 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/react/ai/index.js +64 -47
- 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/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 +60 -43
- package/dist/svelte/ai/index.js.map +7 -7
- package/dist/types/ai.d.ts +147 -0
- package/dist/vue/ai/index.js +60 -43
- package/dist/vue/ai/index.js.map +7 -7
- package/package.json +7 -7
|
@@ -8,6 +8,7 @@ export declare const useRAGEvaluate: (path: string) => {
|
|
|
8
8
|
cases: {
|
|
9
9
|
id: string;
|
|
10
10
|
query: string;
|
|
11
|
+
corpusKey?: string | undefined;
|
|
11
12
|
topK?: number | undefined;
|
|
12
13
|
model?: string | undefined;
|
|
13
14
|
scoreThreshold?: number | undefined;
|
|
@@ -51,6 +52,7 @@ export declare const useRAGEvaluate: (path: string) => {
|
|
|
51
52
|
cases: {
|
|
52
53
|
id: string;
|
|
53
54
|
query: string;
|
|
55
|
+
corpusKey?: string | undefined;
|
|
54
56
|
topK?: number | undefined;
|
|
55
57
|
model?: string | undefined;
|
|
56
58
|
scoreThreshold?: number | undefined;
|
|
@@ -93,8 +95,10 @@ export declare const useRAGEvaluate: (path: string) => {
|
|
|
93
95
|
} | null>;
|
|
94
96
|
lastResponse: import("vue").Ref<{
|
|
95
97
|
ok: true;
|
|
98
|
+
corpusKeys?: string[] | undefined;
|
|
96
99
|
cases: {
|
|
97
100
|
caseId: string;
|
|
101
|
+
corpusKey?: string | undefined;
|
|
98
102
|
query: string;
|
|
99
103
|
label?: string | undefined;
|
|
100
104
|
status: "pass" | "partial" | "fail";
|
|
@@ -128,8 +132,10 @@ export declare const useRAGEvaluate: (path: string) => {
|
|
|
128
132
|
passingRate: number;
|
|
129
133
|
} | null, RAGEvaluationResponse | {
|
|
130
134
|
ok: true;
|
|
135
|
+
corpusKeys?: string[] | undefined;
|
|
131
136
|
cases: {
|
|
132
137
|
caseId: string;
|
|
138
|
+
corpusKey?: string | undefined;
|
|
133
139
|
query: string;
|
|
134
140
|
label?: string | undefined;
|
|
135
141
|
status: "pass" | "partial" | "fail";
|
|
@@ -187,8 +193,10 @@ export declare const useRAGEvaluate: (path: string) => {
|
|
|
187
193
|
elapsedMs: number;
|
|
188
194
|
response: {
|
|
189
195
|
ok: true;
|
|
196
|
+
corpusKeys?: string[] | undefined;
|
|
190
197
|
cases: {
|
|
191
198
|
caseId: string;
|
|
199
|
+
corpusKey?: string | undefined;
|
|
192
200
|
query: string;
|
|
193
201
|
label?: string | undefined;
|
|
194
202
|
status: "pass" | "partial" | "fail";
|
|
@@ -253,6 +261,7 @@ export declare const useRAGEvaluate: (path: string) => {
|
|
|
253
261
|
} | undefined;
|
|
254
262
|
caseTraceSnapshots?: {
|
|
255
263
|
caseId: string;
|
|
264
|
+
corpusKey?: string | undefined;
|
|
256
265
|
label?: string | undefined;
|
|
257
266
|
query: string;
|
|
258
267
|
status: import("../..").RAGEvaluationCaseResult["status"];
|
|
@@ -340,8 +349,10 @@ export declare const useRAGEvaluate: (path: string) => {
|
|
|
340
349
|
elapsedMs: number;
|
|
341
350
|
response: {
|
|
342
351
|
ok: true;
|
|
352
|
+
corpusKeys?: string[] | undefined;
|
|
343
353
|
cases: {
|
|
344
354
|
caseId: string;
|
|
355
|
+
corpusKey?: string | undefined;
|
|
345
356
|
query: string;
|
|
346
357
|
label?: string | undefined;
|
|
347
358
|
status: "pass" | "partial" | "fail";
|
|
@@ -406,6 +417,7 @@ export declare const useRAGEvaluate: (path: string) => {
|
|
|
406
417
|
} | undefined;
|
|
407
418
|
caseTraceSnapshots?: {
|
|
408
419
|
caseId: string;
|
|
420
|
+
corpusKey?: string | undefined;
|
|
409
421
|
label?: string | undefined;
|
|
410
422
|
query: string;
|
|
411
423
|
status: import("../..").RAGEvaluationCaseResult["status"];
|
|
@@ -493,6 +505,7 @@ export declare const useRAGEvaluate: (path: string) => {
|
|
|
493
505
|
cases: {
|
|
494
506
|
id: string;
|
|
495
507
|
query: string;
|
|
508
|
+
corpusKey?: string | undefined;
|
|
496
509
|
topK?: number | undefined;
|
|
497
510
|
model?: string | undefined;
|
|
498
511
|
scoreThreshold?: number | undefined;
|
|
@@ -542,6 +555,7 @@ export declare const useRAGEvaluate: (path: string) => {
|
|
|
542
555
|
cases: {
|
|
543
556
|
id: string;
|
|
544
557
|
query: string;
|
|
558
|
+
corpusKey?: string | undefined;
|
|
545
559
|
topK?: number | undefined;
|
|
546
560
|
model?: string | undefined;
|
|
547
561
|
scoreThreshold?: number | undefined;
|
|
@@ -159,6 +159,7 @@ export declare const useRAGIndexAdmin: (path: string) => {
|
|
|
159
159
|
elapsedMs: number;
|
|
160
160
|
}> | undefined;
|
|
161
161
|
document?: {
|
|
162
|
+
corpusKey?: string | undefined;
|
|
162
163
|
id: string;
|
|
163
164
|
title: string;
|
|
164
165
|
source: string;
|
|
@@ -191,6 +192,7 @@ export declare const useRAGIndexAdmin: (path: string) => {
|
|
|
191
192
|
elapsedMs: number;
|
|
192
193
|
}> | undefined;
|
|
193
194
|
document?: {
|
|
195
|
+
corpusKey?: string | undefined;
|
|
194
196
|
id: string;
|
|
195
197
|
title: string;
|
|
196
198
|
source: string;
|
|
@@ -75,6 +75,7 @@ export declare const useRAGSearch: (path: string) => {
|
|
|
75
75
|
reset: () => void;
|
|
76
76
|
results: import("vue").Ref<{
|
|
77
77
|
chunkId: string;
|
|
78
|
+
corpusKey?: string | undefined;
|
|
78
79
|
score: number;
|
|
79
80
|
text: string;
|
|
80
81
|
title?: string | undefined;
|
|
@@ -102,6 +103,7 @@ export declare const useRAGSearch: (path: string) => {
|
|
|
102
103
|
} | undefined;
|
|
103
104
|
}[], RAGSource[] | {
|
|
104
105
|
chunkId: string;
|
|
106
|
+
corpusKey?: string | undefined;
|
|
105
107
|
score: number;
|
|
106
108
|
text: string;
|
|
107
109
|
title?: string | undefined;
|
package/dist/svelte/ai/index.js
CHANGED
|
@@ -187,7 +187,7 @@ var parseAIMessage = (raw) => {
|
|
|
187
187
|
return null;
|
|
188
188
|
}
|
|
189
189
|
};
|
|
190
|
-
var serializeAIMessage = (
|
|
190
|
+
var serializeAIMessage = (message) => JSON.stringify(message);
|
|
191
191
|
|
|
192
192
|
// src/ai/rag/grounding.ts
|
|
193
193
|
var getContextString = (value) => typeof value === "string" && value.trim().length > 0 ? value.trim() : undefined;
|
|
@@ -1275,7 +1275,10 @@ var evaluateRAGCollectionCases = async ({
|
|
|
1275
1275
|
const expectedIds = normalizeExpectedIds(mode === "chunkId" ? caseInput.expectedChunkIds ?? [] : mode === "source" ? caseInput.expectedSources ?? [] : caseInput.expectedDocumentIds ?? []);
|
|
1276
1276
|
const topK = typeof caseInput.topK === "number" ? caseInput.topK : typeof input.topK === "number" ? input.topK : defaultTopK;
|
|
1277
1277
|
const searchInput = {
|
|
1278
|
-
filter:
|
|
1278
|
+
filter: caseInput.corpusKey ? {
|
|
1279
|
+
...(typeof caseInput.filter === "object" ? caseInput.filter : input.filter) ?? {},
|
|
1280
|
+
corpusKey: caseInput.corpusKey
|
|
1281
|
+
} : typeof caseInput.filter === "object" ? caseInput.filter : input.filter,
|
|
1279
1282
|
model: caseInput.model ?? input.model,
|
|
1280
1283
|
query,
|
|
1281
1284
|
rerank,
|
|
@@ -1677,6 +1680,7 @@ var buildEvaluationCaseTraceSnapshot = ({
|
|
|
1677
1680
|
return {
|
|
1678
1681
|
candidateTopK: currentTrace?.candidateTopK ?? 0,
|
|
1679
1682
|
caseId: caseResult.caseId,
|
|
1683
|
+
corpusKey: caseResult.corpusKey,
|
|
1680
1684
|
inputFilter: filter,
|
|
1681
1685
|
finalCount: currentTrace?.resultCounts.final ?? 0,
|
|
1682
1686
|
label: caseResult.label,
|
|
@@ -3229,11 +3233,15 @@ var persistRAGRetrievalReleaseLaneEscalationPolicyHistory = async ({
|
|
|
3229
3233
|
};
|
|
3230
3234
|
var buildRAGEvaluationResponse = (cases) => {
|
|
3231
3235
|
const totalCases = cases.length;
|
|
3236
|
+
const corpusKeys = [
|
|
3237
|
+
...new Set(cases.flatMap((entry) => entry.corpusKey ?? []))
|
|
3238
|
+
];
|
|
3232
3239
|
const passedCases = cases.filter((entry) => entry.status === "pass").length;
|
|
3233
3240
|
const partialCases = cases.filter((entry) => entry.status === "partial").length;
|
|
3234
3241
|
const failedCases = cases.filter((entry) => entry.status === "fail").length;
|
|
3235
3242
|
return {
|
|
3236
3243
|
cases,
|
|
3244
|
+
...corpusKeys.length > 0 ? { corpusKeys } : {},
|
|
3237
3245
|
elapsedMs: cases.reduce((sum, result) => sum + result.elapsedMs, 0),
|
|
3238
3246
|
ok: true,
|
|
3239
3247
|
passingRate: totalCases > 0 ? passedCases / totalCases * 100 : 0,
|
|
@@ -3459,6 +3467,9 @@ var compareRAGRetrievalStrategies = async ({
|
|
|
3459
3467
|
traceSummary: entry.traceSummary
|
|
3460
3468
|
})));
|
|
3461
3469
|
return {
|
|
3470
|
+
corpusKeys: [
|
|
3471
|
+
...new Set(entries.flatMap((entry) => entry.response.corpusKeys ?? []))
|
|
3472
|
+
],
|
|
3462
3473
|
entries,
|
|
3463
3474
|
leaderboard,
|
|
3464
3475
|
summary: summarizeRAGRetrievalComparison(entries),
|
|
@@ -3491,6 +3502,7 @@ var compareRAGRetrievalTraceSummaries = (current, previous) => ({
|
|
|
3491
3502
|
});
|
|
3492
3503
|
var buildSearchTraceResultSnapshots = (results) => results.map((result) => ({
|
|
3493
3504
|
chunkId: result.chunkId,
|
|
3505
|
+
corpusKey: result.corpusKey ?? (typeof result.metadata?.corpusKey === "string" ? result.metadata.corpusKey : undefined),
|
|
3494
3506
|
documentId: typeof result.metadata?.documentId === "string" ? result.metadata.documentId : undefined,
|
|
3495
3507
|
score: result.score,
|
|
3496
3508
|
source: result.source,
|
|
@@ -3690,6 +3702,7 @@ var summarizeRAGEvaluationCase = ({
|
|
|
3690
3702
|
const status = expectedCount === 0 ? "partial" : matchedCount === expectedCount ? "pass" : matchedCount > 0 ? "partial" : "fail";
|
|
3691
3703
|
return {
|
|
3692
3704
|
caseId: caseInput.id ?? `case-${caseIndex + 1}`,
|
|
3705
|
+
corpusKey: caseInput.corpusKey,
|
|
3693
3706
|
elapsedMs,
|
|
3694
3707
|
expectedCount,
|
|
3695
3708
|
expectedIds,
|
|
@@ -4289,10 +4302,14 @@ var buildProvenanceLabel2 = (metadata) => {
|
|
|
4289
4302
|
const transcriptSource = getContextString2(metadata.transcriptSource);
|
|
4290
4303
|
const pdfTextMode = getContextString2(metadata.pdfTextMode);
|
|
4291
4304
|
const ocrEngine = getContextString2(metadata.ocrEngine);
|
|
4305
|
+
const extractorRegistryMatch = getContextString2(metadata.extractorRegistryMatch);
|
|
4306
|
+
const chunkingProfile = getContextString2(metadata.chunkingProfile);
|
|
4292
4307
|
const ocrConfidence = getContextNumber2(metadata.ocrRegionConfidence) ?? getContextNumber2(metadata.ocrConfidence);
|
|
4293
4308
|
const labels = [
|
|
4294
4309
|
pdfTextMode ? `PDF ${pdfTextMode}` : "",
|
|
4295
4310
|
ocrEngine ? `OCR ${ocrEngine}` : "",
|
|
4311
|
+
extractorRegistryMatch ? `Extractor ${extractorRegistryMatch}` : "",
|
|
4312
|
+
chunkingProfile ? `Chunking ${chunkingProfile}` : "",
|
|
4296
4313
|
typeof ocrConfidence === "number" ? `Confidence ${ocrConfidence.toFixed(2)}` : "",
|
|
4297
4314
|
mediaKind ? `Media ${mediaKind}` : "",
|
|
4298
4315
|
transcriptSource ? `Transcript ${transcriptSource}` : "",
|
|
@@ -5718,73 +5735,73 @@ var buildRAGAnswerGroundingHistoryPresentation = (history) => ({
|
|
|
5718
5735
|
summary: history?.latestRun ? history.latestRun.label : "No persisted provider runs yet."
|
|
5719
5736
|
});
|
|
5720
5737
|
// src/ai/client/actions.ts
|
|
5721
|
-
var serverMessageToAction = (
|
|
5722
|
-
switch (
|
|
5738
|
+
var serverMessageToAction = (message) => {
|
|
5739
|
+
switch (message.type) {
|
|
5723
5740
|
case "chunk":
|
|
5724
5741
|
return {
|
|
5725
|
-
content:
|
|
5726
|
-
conversationId:
|
|
5727
|
-
messageId:
|
|
5742
|
+
content: message.content,
|
|
5743
|
+
conversationId: message.conversationId,
|
|
5744
|
+
messageId: message.messageId,
|
|
5728
5745
|
type: "chunk"
|
|
5729
5746
|
};
|
|
5730
5747
|
case "thinking":
|
|
5731
5748
|
return {
|
|
5732
|
-
content:
|
|
5733
|
-
conversationId:
|
|
5734
|
-
messageId:
|
|
5749
|
+
content: message.content,
|
|
5750
|
+
conversationId: message.conversationId,
|
|
5751
|
+
messageId: message.messageId,
|
|
5735
5752
|
type: "thinking"
|
|
5736
5753
|
};
|
|
5737
5754
|
case "tool_status":
|
|
5738
5755
|
return {
|
|
5739
|
-
conversationId:
|
|
5740
|
-
input:
|
|
5741
|
-
messageId:
|
|
5742
|
-
name:
|
|
5743
|
-
result:
|
|
5744
|
-
status:
|
|
5756
|
+
conversationId: message.conversationId,
|
|
5757
|
+
input: message.input,
|
|
5758
|
+
messageId: message.messageId,
|
|
5759
|
+
name: message.name,
|
|
5760
|
+
result: message.result,
|
|
5761
|
+
status: message.status,
|
|
5745
5762
|
type: "tool_status"
|
|
5746
5763
|
};
|
|
5747
5764
|
case "image":
|
|
5748
5765
|
return {
|
|
5749
|
-
conversationId:
|
|
5750
|
-
data:
|
|
5751
|
-
format:
|
|
5752
|
-
imageId:
|
|
5753
|
-
isPartial:
|
|
5754
|
-
messageId:
|
|
5755
|
-
revisedPrompt:
|
|
5766
|
+
conversationId: message.conversationId,
|
|
5767
|
+
data: message.data,
|
|
5768
|
+
format: message.format,
|
|
5769
|
+
imageId: message.imageId,
|
|
5770
|
+
isPartial: message.isPartial,
|
|
5771
|
+
messageId: message.messageId,
|
|
5772
|
+
revisedPrompt: message.revisedPrompt,
|
|
5756
5773
|
type: "image"
|
|
5757
5774
|
};
|
|
5758
5775
|
case "complete":
|
|
5759
5776
|
return {
|
|
5760
|
-
conversationId:
|
|
5761
|
-
durationMs:
|
|
5762
|
-
messageId:
|
|
5763
|
-
model:
|
|
5764
|
-
sources:
|
|
5777
|
+
conversationId: message.conversationId,
|
|
5778
|
+
durationMs: message.durationMs,
|
|
5779
|
+
messageId: message.messageId,
|
|
5780
|
+
model: message.model,
|
|
5781
|
+
sources: message.sources,
|
|
5765
5782
|
type: "complete",
|
|
5766
|
-
usage:
|
|
5783
|
+
usage: message.usage
|
|
5767
5784
|
};
|
|
5768
5785
|
case "rag_retrieving":
|
|
5769
5786
|
return {
|
|
5770
|
-
conversationId:
|
|
5771
|
-
messageId:
|
|
5772
|
-
retrievalStartedAt:
|
|
5787
|
+
conversationId: message.conversationId,
|
|
5788
|
+
messageId: message.messageId,
|
|
5789
|
+
retrievalStartedAt: message.retrievalStartedAt,
|
|
5773
5790
|
type: "rag_retrieving"
|
|
5774
5791
|
};
|
|
5775
5792
|
case "rag_retrieved":
|
|
5776
5793
|
return {
|
|
5777
|
-
conversationId:
|
|
5778
|
-
messageId:
|
|
5779
|
-
retrievalDurationMs:
|
|
5780
|
-
retrievalStartedAt:
|
|
5781
|
-
retrievedAt:
|
|
5782
|
-
sources:
|
|
5783
|
-
trace:
|
|
5794
|
+
conversationId: message.conversationId,
|
|
5795
|
+
messageId: message.messageId,
|
|
5796
|
+
retrievalDurationMs: message.retrievalDurationMs,
|
|
5797
|
+
retrievalStartedAt: message.retrievalStartedAt,
|
|
5798
|
+
retrievedAt: message.retrievedAt,
|
|
5799
|
+
sources: message.sources,
|
|
5800
|
+
trace: message.trace,
|
|
5784
5801
|
type: "rag_retrieved"
|
|
5785
5802
|
};
|
|
5786
5803
|
case "error":
|
|
5787
|
-
return { message:
|
|
5804
|
+
return { message: message.message, type: "error" };
|
|
5788
5805
|
default:
|
|
5789
5806
|
return null;
|
|
5790
5807
|
}
|
|
@@ -6243,8 +6260,8 @@ var createAIStream = (path, conversationId) => {
|
|
|
6243
6260
|
subscribers.forEach((callback) => callback());
|
|
6244
6261
|
};
|
|
6245
6262
|
const unsubscribeStore = store.subscribe(syncState);
|
|
6246
|
-
const unsubscribeConnection = connection.subscribe((
|
|
6247
|
-
const action = serverMessageToAction(
|
|
6263
|
+
const unsubscribeConnection = connection.subscribe((message) => {
|
|
6264
|
+
const action = serverMessageToAction(message);
|
|
6248
6265
|
if (action) {
|
|
6249
6266
|
store.dispatch(action);
|
|
6250
6267
|
}
|
|
@@ -8252,5 +8269,5 @@ export {
|
|
|
8252
8269
|
createAIStream
|
|
8253
8270
|
};
|
|
8254
8271
|
|
|
8255
|
-
//# debugId=
|
|
8272
|
+
//# debugId=AD777B7B327AA3C964756E2164756E21
|
|
8256
8273
|
//# sourceMappingURL=index.js.map
|