@absolutejs/absolute 0.19.0-beta.528 → 0.19.0-beta.529
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 +18 -3
- package/dist/ai/client/index.js.map +4 -4
- package/dist/ai/index.js +191 -17
- package/dist/ai/index.js.map +6 -6
- package/dist/ai-client/angular/ai/index.js +17 -2
- package/dist/ai-client/react/ai/index.js +17 -2
- package/dist/ai-client/vue/ai/index.js +17 -2
- package/dist/angular/ai/index.js +18 -3
- package/dist/angular/ai/index.js.map +4 -4
- package/dist/react/ai/index.js +18 -3
- package/dist/react/ai/index.js.map +4 -4
- package/dist/src/ai/client/ragClient.d.ts +6 -1
- package/dist/src/ai/rag/chat.d.ts +2 -6
- package/dist/src/ai/rag/presentation.d.ts +2 -1
- package/dist/src/vue/ai/useRAG.d.ts +2 -0
- package/dist/src/vue/ai/useRAGSearch.d.ts +2 -0
- package/dist/svelte/ai/index.js +18 -3
- package/dist/svelte/ai/index.js.map +4 -4
- package/dist/types/ai.d.ts +44 -1
- package/dist/vue/ai/index.js +18 -3
- package/dist/vue/ai/index.js.map +4 -4
- package/package.json +7 -7
package/dist/react/ai/index.js
CHANGED
|
@@ -785,6 +785,13 @@ var buildSourceGroupKey = (source) => source.source ?? source.title ?? source.ch
|
|
|
785
785
|
var buildSourceLabel = (source) => source.source ?? source.title ?? source.chunkId;
|
|
786
786
|
var getContextNumber = (value) => typeof value === "number" && Number.isFinite(value) ? value : undefined;
|
|
787
787
|
var getContextString = (value) => typeof value === "string" && value.trim().length > 0 ? value.trim() : undefined;
|
|
788
|
+
var isRAGRetrievalTrace = (value) => {
|
|
789
|
+
if (!value || typeof value !== "object") {
|
|
790
|
+
return false;
|
|
791
|
+
}
|
|
792
|
+
const candidate = value;
|
|
793
|
+
return typeof candidate.query === "string" && typeof candidate.transformedQuery === "string" && Array.isArray(candidate.variantQueries) && Array.isArray(candidate.steps);
|
|
794
|
+
};
|
|
788
795
|
var formatTimestampLabel = (value) => {
|
|
789
796
|
const timestamp = typeof value === "number" && Number.isFinite(value) ? value : typeof value === "string" ? Date.parse(value) : Number.NaN;
|
|
790
797
|
if (!Number.isFinite(timestamp)) {
|
|
@@ -1052,6 +1059,7 @@ var buildRAGRetrievedState = (messages) => {
|
|
|
1052
1059
|
retrievalDurationMs: message.retrievalDurationMs,
|
|
1053
1060
|
retrievalStartedAt: message.retrievalStartedAt,
|
|
1054
1061
|
retrievedAt: message.retrievedAt,
|
|
1062
|
+
trace: isRAGRetrievalTrace(message.retrievalTrace) ? message.retrievalTrace : undefined,
|
|
1055
1063
|
sourceGroups: buildRAGSourceGroups(sources),
|
|
1056
1064
|
sourceSummaries: buildRAGSourceSummaries(sources),
|
|
1057
1065
|
sources
|
|
@@ -1583,8 +1591,12 @@ var createRAGClient = (options) => {
|
|
|
1583
1591
|
return parseJson(response);
|
|
1584
1592
|
},
|
|
1585
1593
|
async search(input) {
|
|
1594
|
+
const result = await this.searchDetailed(input);
|
|
1595
|
+
return result.results;
|
|
1596
|
+
},
|
|
1597
|
+
async searchDetailed(input) {
|
|
1586
1598
|
const response = await fetchImpl(`${basePath}/search`, {
|
|
1587
|
-
body: JSON.stringify(input),
|
|
1599
|
+
body: JSON.stringify({ ...input, includeTrace: true }),
|
|
1588
1600
|
headers: jsonHeaders,
|
|
1589
1601
|
method: "POST"
|
|
1590
1602
|
});
|
|
@@ -1595,7 +1607,10 @@ var createRAGClient = (options) => {
|
|
|
1595
1607
|
if (!payload.ok) {
|
|
1596
1608
|
throw new Error(payload.error ?? "RAG search failed");
|
|
1597
1609
|
}
|
|
1598
|
-
return
|
|
1610
|
+
return {
|
|
1611
|
+
results: payload.results ?? [],
|
|
1612
|
+
trace: payload.trace
|
|
1613
|
+
};
|
|
1599
1614
|
},
|
|
1600
1615
|
async status() {
|
|
1601
1616
|
const response = await fetchImpl(`${basePath}/status`);
|
|
@@ -3498,5 +3513,5 @@ export {
|
|
|
3498
3513
|
AIStreamProvider
|
|
3499
3514
|
};
|
|
3500
3515
|
|
|
3501
|
-
//# debugId=
|
|
3516
|
+
//# debugId=63CA4B6008DC331A64756E2164756E21
|
|
3502
3517
|
//# sourceMappingURL=index.js.map
|