@absolutejs/absolute 0.19.0-beta.604 → 0.19.0-beta.605
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 +186 -6
- package/dist/ai/client/index.js.map +4 -4
- package/dist/ai/client/ui.js +190 -6
- package/dist/ai/client/ui.js.map +4 -4
- package/dist/ai/index.js +289 -36
- package/dist/ai/index.js.map +7 -7
- package/dist/ai/rag/quality.js +17 -6
- package/dist/ai/rag/quality.js.map +3 -3
- package/dist/ai/rag/ui.js +190 -6
- package/dist/ai/rag/ui.js.map +4 -4
- package/dist/ai-client/angular/ai/index.js +185 -5
- package/dist/ai-client/react/ai/index.js +200 -6
- package/dist/ai-client/vue/ai/index.js +289 -97
- package/dist/angular/ai/index.js +186 -6
- package/dist/angular/ai/index.js.map +4 -4
- 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 +201 -7
- package/dist/react/ai/index.js.map +6 -6
- package/dist/src/ai/client/ui.d.ts +1 -1
- package/dist/src/ai/rag/index.d.ts +1 -1
- package/dist/src/ai/rag/presentation.d.ts +7 -1
- package/dist/src/ai/rag/ui.d.ts +1 -1
- package/dist/src/react/ai/useRAG.d.ts +5 -0
- package/dist/src/react/ai/useRAGChunkPreview.d.ts +4 -0
- package/dist/src/react/ai/useRAGSources.d.ts +1 -0
- package/dist/src/svelte/ai/createRAG.d.ts +5 -0
- package/dist/src/svelte/ai/createRAGChunkPreview.d.ts +4 -0
- package/dist/src/svelte/ai/createRAGSources.d.ts +1 -0
- package/dist/src/vue/ai/useRAG.d.ts +65 -0
- package/dist/src/vue/ai/useRAGChunkPreview.d.ts +34 -0
- package/dist/src/vue/ai/useRAGSearch.d.ts +30 -0
- package/dist/src/vue/ai/useRAGSources.d.ts +1 -0
- package/dist/svelte/ai/index.js +247 -53
- package/dist/svelte/ai/index.js.map +6 -6
- package/dist/types/ai.d.ts +60 -0
- package/dist/vue/ai/index.js +253 -59
- package/dist/vue/ai/index.js.map +6 -6
- package/package.json +1 -1
package/dist/ai/rag/quality.js
CHANGED
|
@@ -235,6 +235,11 @@ var buildContextLabel = (metadata) => {
|
|
|
235
235
|
if (speaker) {
|
|
236
236
|
return `Speaker ${speaker}`;
|
|
237
237
|
}
|
|
238
|
+
const sectionPath = Array.isArray(metadata.sectionPath) ? metadata.sectionPath.map((value) => getContextString(value)).filter((value) => typeof value === "string") : [];
|
|
239
|
+
const sectionTitle = getContextString(metadata.sectionTitle) ?? sectionPath.at(-1);
|
|
240
|
+
if (sectionTitle) {
|
|
241
|
+
return `Section ${sectionTitle}`;
|
|
242
|
+
}
|
|
238
243
|
return;
|
|
239
244
|
};
|
|
240
245
|
var formatMediaTimestamp = (value) => {
|
|
@@ -284,6 +289,10 @@ var buildLocatorLabel = (metadata, source, title) => {
|
|
|
284
289
|
if (mediaStart) {
|
|
285
290
|
return `Timestamp ${mediaStart}`;
|
|
286
291
|
}
|
|
292
|
+
const sectionPath = Array.isArray(metadata.sectionPath) ? metadata.sectionPath.map((value) => getContextString(value)).filter((value) => typeof value === "string") : [];
|
|
293
|
+
if (sectionPath.length > 0) {
|
|
294
|
+
return `Section ${sectionPath.join(" > ")}`;
|
|
295
|
+
}
|
|
287
296
|
return;
|
|
288
297
|
};
|
|
289
298
|
var formatTimestampLabel = (value) => {
|
|
@@ -333,8 +342,10 @@ var buildExcerpt = (text, maxLength = 160) => {
|
|
|
333
342
|
var buildGroundingReferenceEvidenceLabel = (reference) => [reference.label, reference.locatorLabel, reference.contextLabel].filter((value) => Boolean(value && value.length > 0)).filter((value, index, values) => values.findIndex((entry) => entry === value) === index).join(" \xB7 ");
|
|
334
343
|
var buildGroundingReferenceEvidenceSummary = (reference) => [
|
|
335
344
|
reference.source ?? reference.title ?? reference.chunkId,
|
|
345
|
+
reference.locatorLabel,
|
|
346
|
+
reference.contextLabel,
|
|
336
347
|
reference.provenanceLabel
|
|
337
|
-
].filter((value) => Boolean(value && value.length > 0)).join(" \xB7 ");
|
|
348
|
+
].filter((value) => Boolean(value && value.length > 0)).filter((value, index, values) => values.findIndex((entry) => entry === value) === index).join(" \xB7 ");
|
|
338
349
|
var buildGroundedAnswerCitationDetail = (reference) => ({
|
|
339
350
|
contextLabel: reference.contextLabel,
|
|
340
351
|
evidenceLabel: buildGroundingReferenceEvidenceLabel(reference),
|
|
@@ -358,12 +369,12 @@ var buildRAGCitations = (sources) => {
|
|
|
358
369
|
continue;
|
|
359
370
|
unique.set(key, {
|
|
360
371
|
chunkId: source.chunkId,
|
|
361
|
-
contextLabel: buildContextLabel(source.metadata),
|
|
372
|
+
contextLabel: source.labels?.contextLabel ?? buildContextLabel(source.metadata),
|
|
362
373
|
key,
|
|
363
374
|
label: buildSourceLabel(source),
|
|
364
|
-
locatorLabel: buildLocatorLabel(source.metadata, source.source, source.title),
|
|
375
|
+
locatorLabel: source.labels?.locatorLabel ?? buildLocatorLabel(source.metadata, source.source, source.title),
|
|
365
376
|
metadata: source.metadata,
|
|
366
|
-
provenanceLabel: buildProvenanceLabel(source.metadata),
|
|
377
|
+
provenanceLabel: source.labels?.provenanceLabel ?? buildProvenanceLabel(source.metadata),
|
|
367
378
|
score: source.score,
|
|
368
379
|
source: source.source,
|
|
369
380
|
text: source.text,
|
|
@@ -433,7 +444,7 @@ var buildRAGGroundingReferences = (sources) => {
|
|
|
433
444
|
const citationReferenceMap = buildRAGCitationReferenceMap(citations);
|
|
434
445
|
return citations.map((citation) => ({
|
|
435
446
|
chunkId: citation.chunkId,
|
|
436
|
-
contextLabel: buildContextLabel(citation.metadata),
|
|
447
|
+
contextLabel: citation.contextLabel ?? buildContextLabel(citation.metadata),
|
|
437
448
|
excerpt: buildExcerpt(citation.text),
|
|
438
449
|
label: citation.label,
|
|
439
450
|
locatorLabel: citation.locatorLabel ?? buildLocatorLabel(citation.metadata, citation.source, citation.title),
|
|
@@ -3605,5 +3616,5 @@ export {
|
|
|
3605
3616
|
buildRAGAnswerGroundingCaseDifficultyLeaderboard
|
|
3606
3617
|
};
|
|
3607
3618
|
|
|
3608
|
-
//# debugId=
|
|
3619
|
+
//# debugId=50C4C7F0681DF85664756E2164756E21
|
|
3609
3620
|
//# sourceMappingURL=quality.js.map
|