@absolutejs/absolute 0.19.0-beta.445 → 0.19.0-beta.447
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/index.js +18 -7
- package/dist/ai/index.js.map +4 -4
- package/dist/index.js +6 -6
- package/dist/index.js.map +3 -3
- package/dist/src/ai/index.d.ts +1 -1
- package/dist/src/ai/rag/index.d.ts +1 -1
- package/dist/src/ai/rag/types.d.ts +1 -1
- package/dist/src/core/pageHandlers.d.ts +6 -2
- package/package.json +2 -2
package/dist/ai/index.js
CHANGED
|
@@ -2701,8 +2701,11 @@ var ragChat = (config) => {
|
|
|
2701
2701
|
const includeCompleteSources = config.ragCompleteSources === true;
|
|
2702
2702
|
const indexManager = config.indexManager;
|
|
2703
2703
|
const workflowRenderers = resolveRAGWorkflowRenderers(typeof config.htmx === "object" ? config.htmx.workflow?.render : undefined);
|
|
2704
|
-
const toHTMXResponse = (html, status) => new Response(html, {
|
|
2705
|
-
headers:
|
|
2704
|
+
const toHTMXResponse = (html, status, extraHeaders) => new Response(html, {
|
|
2705
|
+
headers: {
|
|
2706
|
+
...HTML_HEADERS,
|
|
2707
|
+
...extraHeaders
|
|
2708
|
+
},
|
|
2706
2709
|
status: typeof status === "number" ? status : 200
|
|
2707
2710
|
});
|
|
2708
2711
|
const appendMessage2 = (conversation, message) => {
|
|
@@ -3140,7 +3143,9 @@ var ragChat = (config) => {
|
|
|
3140
3143
|
}
|
|
3141
3144
|
if (config.htmx && isHTMXRequest(request)) {
|
|
3142
3145
|
const html = result.ok ? workflowRenderers.mutationResult(result) : workflowRenderers.error(result.error ?? "Failed to create document");
|
|
3143
|
-
return toHTMXResponse(html, set.status
|
|
3146
|
+
return toHTMXResponse(html, set.status, {
|
|
3147
|
+
"HX-Trigger": "rag:mutated"
|
|
3148
|
+
});
|
|
3144
3149
|
}
|
|
3145
3150
|
return result;
|
|
3146
3151
|
}).get(`${path}/documents/:id/chunks`, async ({ params, request, set }) => {
|
|
@@ -3174,7 +3179,9 @@ var ragChat = (config) => {
|
|
|
3174
3179
|
}
|
|
3175
3180
|
if (config.htmx && isHTMXRequest(request)) {
|
|
3176
3181
|
const html = result.ok ? workflowRenderers.mutationResult(result) : workflowRenderers.error(result.error ?? "Failed to delete document");
|
|
3177
|
-
return toHTMXResponse(html, set.status
|
|
3182
|
+
return toHTMXResponse(html, set.status, {
|
|
3183
|
+
"HX-Trigger": "rag:mutated"
|
|
3184
|
+
});
|
|
3178
3185
|
}
|
|
3179
3186
|
return result;
|
|
3180
3187
|
}).post(`${path}/reseed`, async ({ request, set }) => {
|
|
@@ -3184,7 +3191,9 @@ var ragChat = (config) => {
|
|
|
3184
3191
|
}
|
|
3185
3192
|
if (config.htmx && isHTMXRequest(request)) {
|
|
3186
3193
|
const html = result.ok ? workflowRenderers.mutationResult(result) : workflowRenderers.error(result.error ?? "Failed to reseed index");
|
|
3187
|
-
return toHTMXResponse(html, set.status
|
|
3194
|
+
return toHTMXResponse(html, set.status, {
|
|
3195
|
+
"HX-Trigger": "rag:mutated"
|
|
3196
|
+
});
|
|
3188
3197
|
}
|
|
3189
3198
|
return result;
|
|
3190
3199
|
}).post(`${path}/reset`, async ({ request, set }) => {
|
|
@@ -3194,7 +3203,9 @@ var ragChat = (config) => {
|
|
|
3194
3203
|
}
|
|
3195
3204
|
if (config.htmx && isHTMXRequest(request)) {
|
|
3196
3205
|
const html = result.ok ? workflowRenderers.mutationResult(result) : workflowRenderers.error(result.error ?? "Failed to reset index");
|
|
3197
|
-
return toHTMXResponse(html, set.status
|
|
3206
|
+
return toHTMXResponse(html, set.status, {
|
|
3207
|
+
"HX-Trigger": "rag:mutated"
|
|
3208
|
+
});
|
|
3198
3209
|
}
|
|
3199
3210
|
return result;
|
|
3200
3211
|
}).get(`${path}/conversations`, () => store.list()).get(`${path}/conversations/:id`, async ({ params }) => {
|
|
@@ -4307,5 +4318,5 @@ export {
|
|
|
4307
4318
|
aiChat
|
|
4308
4319
|
};
|
|
4309
4320
|
|
|
4310
|
-
//# debugId=
|
|
4321
|
+
//# debugId=8FF738CEBD89B6A864756E2164756E21
|
|
4311
4322
|
//# sourceMappingURL=index.js.map
|