@ibiz-template/runtime 0.7.41-alpha.150 → 0.7.41-alpha.152
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/index.esm.js +61 -7
- package/dist/index.system.min.js +1 -1
- package/out/interface/service/service/i-app-de.service.d.ts +11 -0
- package/out/interface/service/service/i-app-de.service.d.ts.map +1 -1
- package/out/service/service/entity/de.service.d.ts +11 -0
- package/out/service/service/entity/de.service.d.ts.map +1 -1
- package/out/service/service/entity/de.service.js +39 -0
- package/out/service/service/util/ai-util.service.d.ts.map +1 -1
- package/out/service/service/util/ai-util.service.js +11 -3
- package/package.json +3 -3
- package/src/interface/service/service/i-app-de.service.ts +18 -0
- package/src/service/service/entity/de.service.ts +50 -0
- package/src/service/service/util/ai-util.service.ts +19 -7
package/dist/index.esm.js
CHANGED
|
@@ -73069,6 +73069,49 @@ var DEService = class {
|
|
|
73069
73069
|
);
|
|
73070
73070
|
});
|
|
73071
73071
|
}
|
|
73072
|
+
/**
|
|
73073
|
+
* @description 实体级别 AI 恢复会话
|
|
73074
|
+
* @param {(data: IPortalAsyncAction) => void} onmessage
|
|
73075
|
+
* @param {AbortController} controller
|
|
73076
|
+
* @param {IContext} context
|
|
73077
|
+
* @param {IParams} [params={}]
|
|
73078
|
+
* @param {IData} [data={}]
|
|
73079
|
+
* @returns {*} {Promise<void>}
|
|
73080
|
+
* @memberof DEService
|
|
73081
|
+
*/
|
|
73082
|
+
aiResumeSse(onmessage, controller, context, params = {}, data = {}) {
|
|
73083
|
+
const { signal } = controller;
|
|
73084
|
+
const app = ibiz.hub.getApp(this.model.appId);
|
|
73085
|
+
const srfkey = context[this.model.codeName.toLowerCase()];
|
|
73086
|
+
const curPath = "/".concat(this.model.deapicodeName2, "/ssechatcompletion/resume").concat(srfkey ? "/".concat(srfkey) : "");
|
|
73087
|
+
const resPath = calcResPath(context, this.model);
|
|
73088
|
+
const path2 = resPath ? "/".concat(resPath).concat(curPath) : "".concat(curPath);
|
|
73089
|
+
return new Promise((resolve, reject) => {
|
|
73090
|
+
app.net.sse(
|
|
73091
|
+
"".concat(path2),
|
|
73092
|
+
{ srfactag: "AIChat", ...params },
|
|
73093
|
+
{
|
|
73094
|
+
headers: {
|
|
73095
|
+
"Content-Type": "application/json"
|
|
73096
|
+
},
|
|
73097
|
+
body: JSON.stringify(data),
|
|
73098
|
+
onmessage: (e) => {
|
|
73099
|
+
if (e.data) {
|
|
73100
|
+
const json = JSON.parse(e.data);
|
|
73101
|
+
onmessage(json);
|
|
73102
|
+
}
|
|
73103
|
+
},
|
|
73104
|
+
onclose: () => {
|
|
73105
|
+
resolve();
|
|
73106
|
+
},
|
|
73107
|
+
onerror: (e) => {
|
|
73108
|
+
reject(e);
|
|
73109
|
+
},
|
|
73110
|
+
signal
|
|
73111
|
+
}
|
|
73112
|
+
);
|
|
73113
|
+
});
|
|
73114
|
+
}
|
|
73072
73115
|
/**
|
|
73073
73116
|
* 获取 AI 聊天会话推荐提示
|
|
73074
73117
|
*
|
|
@@ -76339,14 +76382,25 @@ var AIUtilService = class {
|
|
|
76339
76382
|
return !!message;
|
|
76340
76383
|
});
|
|
76341
76384
|
const tempContext = context.clone();
|
|
76342
|
-
|
|
76343
|
-
|
|
76344
|
-
|
|
76345
|
-
|
|
76385
|
+
if (messageIDs.length > 1) {
|
|
76386
|
+
tempContext[this.messageAppEntityName.toLowerCase()] = messageIDs.join(";");
|
|
76387
|
+
const batchData = messageIDs.map((id) => {
|
|
76388
|
+
return { id };
|
|
76389
|
+
});
|
|
76390
|
+
await messageService.exec(
|
|
76391
|
+
deleteMessageAppDEActionId,
|
|
76392
|
+
tempContext,
|
|
76393
|
+
batchData,
|
|
76394
|
+
{
|
|
76346
76395
|
...params
|
|
76347
|
-
}
|
|
76348
|
-
|
|
76349
|
-
)
|
|
76396
|
+
}
|
|
76397
|
+
);
|
|
76398
|
+
} else if (messageIDs[0]) {
|
|
76399
|
+
tempContext[this.messageAppEntityName.toLowerCase()] = messageIDs[0];
|
|
76400
|
+
await messageService.exec(deleteMessageAppDEActionId, tempContext, {
|
|
76401
|
+
...params
|
|
76402
|
+
});
|
|
76403
|
+
}
|
|
76350
76404
|
return true;
|
|
76351
76405
|
}
|
|
76352
76406
|
/**
|