@ibiz-template/vue3-components 0.7.41-alpha.133 → 0.7.41-alpha.134
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-BM8C9Ga1.js → index-scbUG9yD.js} +28 -28
- package/dist/{index.es-NUyPCh3r.js → index.es-Cg7SaUZt.js} +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{wang-editor-CQJ-i0FI.js → wang-editor-DpxK_csh.js} +1 -1
- package/dist/{xlsx-util-CJC7nYyf.js → xlsx-util-CNqFg89T.js} +1 -1
- package/es/control/drtab/drtab-control.util.mjs +1 -1
- package/es/editor/ai-chat/embed-ai-chat/embed-ai-chat.mjs +11 -5
- package/es/util/ai-chat-util/ai-chat-util.mjs +50 -9
- package/es/util/app-util/app-util.mjs +8 -0
- package/es/util/fullscreen/fullscreen-util.mjs +1 -1
- package/lib/control/drtab/drtab-control.util.cjs +1 -1
- package/lib/editor/ai-chat/embed-ai-chat/embed-ai-chat.cjs +11 -5
- package/lib/util/ai-chat-util/ai-chat-util.cjs +50 -9
- package/lib/util/app-util/app-util.cjs +8 -0
- package/lib/util/fullscreen/fullscreen-util.cjs +1 -1
- package/package.json +7 -7
- package/src/editor/ai-chat/embed-ai-chat/embed-ai-chat.tsx +10 -5
- package/src/util/ai-chat-util/ai-chat-util.ts +51 -10
- package/src/util/app-util/app-util.ts +10 -1
- /package/es/node_modules/.pnpm/{@ibiz-template_core@0.7.41-alpha.119_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.41-alpha.138_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.mjs +0 -0
- /package/lib/node_modules/.pnpm/{@ibiz-template_core@0.7.41-alpha.119_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.41-alpha.138_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref, watch, watchEffect, onUnmounted } from 'vue';
|
|
2
|
-
import { defaultNamespace } from '../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.
|
|
2
|
+
import { defaultNamespace } from '../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.138_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1/node_modules/@ibiz-template/core/out/utils/namespace/namespace.mjs';
|
|
3
3
|
|
|
4
4
|
"use strict";
|
|
5
5
|
function useAppDRTab(c, controlRef, counterData) {
|
|
@@ -80,7 +80,6 @@ const IBizEmbedAIChat = /* @__PURE__ */ defineComponent({
|
|
|
80
80
|
}
|
|
81
81
|
const chatInstanceOptions = {
|
|
82
82
|
mode: editorParams.srfaimode || "TOPIC",
|
|
83
|
-
placeholder: c.placeHolder,
|
|
84
83
|
resourceOptions,
|
|
85
84
|
containerOptions: {
|
|
86
85
|
container: aiChatElementRef.value
|
|
@@ -105,6 +104,7 @@ const IBizEmbedAIChat = /* @__PURE__ */ defineComponent({
|
|
|
105
104
|
...chatOptions,
|
|
106
105
|
sessionid,
|
|
107
106
|
isSimple: c.isSimple,
|
|
107
|
+
placeholder: c.placeHolder || ibiz.config.common.aiInputPlaceholder,
|
|
108
108
|
fetchAgentList: async (args) => {
|
|
109
109
|
const {
|
|
110
110
|
query
|
|
@@ -116,12 +116,18 @@ const IBizEmbedAIChat = /* @__PURE__ */ defineComponent({
|
|
|
116
116
|
agentMap.set(query, agent);
|
|
117
117
|
return agent;
|
|
118
118
|
},
|
|
119
|
-
fetchKnowledgeBaseList: async (
|
|
120
|
-
|
|
119
|
+
fetchKnowledgeBaseList: async (args) => {
|
|
120
|
+
const {
|
|
121
|
+
query,
|
|
122
|
+
knowledgebases
|
|
123
|
+
} = args || {};
|
|
124
|
+
const key = "".concat(query, "@").concat(knowledgebases);
|
|
125
|
+
let knowledge = knowledgeMap.get(key);
|
|
121
126
|
if (knowledge == null ? void 0 : knowledge.length)
|
|
122
127
|
return knowledge;
|
|
123
|
-
knowledge = await chatOptions.fetchKnowledgeBaseList(
|
|
124
|
-
|
|
128
|
+
knowledge = await chatOptions.fetchKnowledgeBaseList(args);
|
|
129
|
+
if (knowledge)
|
|
130
|
+
knowledgeMap.set(key, knowledge);
|
|
125
131
|
return knowledge;
|
|
126
132
|
},
|
|
127
133
|
action: (action, message) => {
|
|
@@ -189,6 +189,11 @@ class AIChatUtil {
|
|
|
189
189
|
} else {
|
|
190
190
|
chatOptions.captionComputedMode = ibiz.config.common.aiChatTopicCaptionComputedMode;
|
|
191
191
|
}
|
|
192
|
+
if (editorParams.srfaiinputplaceholder) {
|
|
193
|
+
chatOptions.placeholder = editorParams.srfaiinputplaceholder;
|
|
194
|
+
} else {
|
|
195
|
+
chatOptions.placeholder = ibiz.config.common.aiInputPlaceholder;
|
|
196
|
+
}
|
|
192
197
|
chatOptions.fetchAgentList = (args2 = {}) => {
|
|
193
198
|
const { query, agentid } = args2;
|
|
194
199
|
return this.getAIAgentList(
|
|
@@ -197,8 +202,8 @@ class AIChatUtil {
|
|
|
197
202
|
editorParams
|
|
198
203
|
);
|
|
199
204
|
};
|
|
200
|
-
chatOptions.fetchKnowledgeBaseList = (
|
|
201
|
-
return this.getKnowledgeBaseList(context, params, editorParams,
|
|
205
|
+
chatOptions.fetchKnowledgeBaseList = (args2 = {}) => {
|
|
206
|
+
return this.getKnowledgeBaseList(context, params, editorParams, args2);
|
|
202
207
|
};
|
|
203
208
|
if (deACMode) {
|
|
204
209
|
const {
|
|
@@ -398,6 +403,11 @@ class AIChatUtil {
|
|
|
398
403
|
sessionid: other.sessionid
|
|
399
404
|
});
|
|
400
405
|
}
|
|
406
|
+
if (other.srfaiagent) {
|
|
407
|
+
Object.assign(abortRequestData, {
|
|
408
|
+
srfaiagent: other.srfaiagent
|
|
409
|
+
});
|
|
410
|
+
}
|
|
401
411
|
await deService.aiChatCancel(ctx, param, abortRequestData);
|
|
402
412
|
asyncacitonid = "";
|
|
403
413
|
}
|
|
@@ -420,6 +430,11 @@ class AIChatUtil {
|
|
|
420
430
|
sessionid: other.sessionid
|
|
421
431
|
});
|
|
422
432
|
}
|
|
433
|
+
if (other.srfaiagent) {
|
|
434
|
+
Object.assign(supplementRequestData, {
|
|
435
|
+
srfaiagent: other.srfaiagent
|
|
436
|
+
});
|
|
437
|
+
}
|
|
423
438
|
if (other.messages) {
|
|
424
439
|
Object.assign(supplementRequestData, {
|
|
425
440
|
messages: other.messages
|
|
@@ -811,6 +826,12 @@ class AIChatUtil {
|
|
|
811
826
|
} else {
|
|
812
827
|
chatOptions.captionComputedMode = ibiz.config.common.aiChatTopicCaptionComputedMode;
|
|
813
828
|
}
|
|
829
|
+
if (params.hasOwnProperty("srfaiinputplaceholder")) {
|
|
830
|
+
chatOptions.placeholder = params.srfaiinputplaceholder;
|
|
831
|
+
delete params.srfaiinputplaceholder;
|
|
832
|
+
} else {
|
|
833
|
+
chatOptions.placeholder = ibiz.config.common.aiInputPlaceholder;
|
|
834
|
+
}
|
|
814
835
|
chatOptions.fetchAgentList = (args2 = {}) => {
|
|
815
836
|
const { query, agentid } = args2;
|
|
816
837
|
return this.getAIAgentList(context, {
|
|
@@ -819,8 +840,8 @@ class AIChatUtil {
|
|
|
819
840
|
srfaiagent: agentid
|
|
820
841
|
});
|
|
821
842
|
};
|
|
822
|
-
chatOptions.fetchKnowledgeBaseList = (
|
|
823
|
-
return this.getKnowledgeBaseList(context, params, void 0,
|
|
843
|
+
chatOptions.fetchKnowledgeBaseList = (args2 = {}) => {
|
|
844
|
+
return this.getKnowledgeBaseList(context, params, void 0, args2);
|
|
824
845
|
};
|
|
825
846
|
if (deACMode) {
|
|
826
847
|
const {
|
|
@@ -1016,6 +1037,11 @@ class AIChatUtil {
|
|
|
1016
1037
|
sessionid: other.sessionid
|
|
1017
1038
|
});
|
|
1018
1039
|
}
|
|
1040
|
+
if (other.srfaiagent) {
|
|
1041
|
+
Object.assign(abortRequestData, {
|
|
1042
|
+
srfaiagent: other.srfaiagent
|
|
1043
|
+
});
|
|
1044
|
+
}
|
|
1019
1045
|
await deService.aiChatCancel(ctx, param, abortRequestData);
|
|
1020
1046
|
asyncacitonid = "";
|
|
1021
1047
|
}
|
|
@@ -1038,6 +1064,11 @@ class AIChatUtil {
|
|
|
1038
1064
|
sessionid: other.sessionid
|
|
1039
1065
|
});
|
|
1040
1066
|
}
|
|
1067
|
+
if (other.srfaiagent) {
|
|
1068
|
+
Object.assign(supplementRequestData, {
|
|
1069
|
+
srfaiagent: other.srfaiagent
|
|
1070
|
+
});
|
|
1071
|
+
}
|
|
1041
1072
|
if (other.messages) {
|
|
1042
1073
|
Object.assign(supplementRequestData, {
|
|
1043
1074
|
messages: other.messages
|
|
@@ -1300,11 +1331,12 @@ class AIChatUtil {
|
|
|
1300
1331
|
* @param {IContext} context
|
|
1301
1332
|
* @param {IParams} params
|
|
1302
1333
|
* @param {IData} [editorParams]
|
|
1303
|
-
* @param {
|
|
1334
|
+
* @param {IParams} [args]
|
|
1304
1335
|
* @returns {*} {Promise<IData[]>}
|
|
1305
1336
|
* @memberof AIChatUtil
|
|
1306
1337
|
*/
|
|
1307
|
-
async getKnowledgeBaseList(context, params, editorParams,
|
|
1338
|
+
async getKnowledgeBaseList(context, params, editorParams, args) {
|
|
1339
|
+
var _a;
|
|
1308
1340
|
let items = [];
|
|
1309
1341
|
const app = ibiz.hub.getApp(context.srfappid || ibiz.env.appId);
|
|
1310
1342
|
const aiAgentUtil = app.getAppUtil("DYNAMICAIGENT", "CUSTOM");
|
|
@@ -1314,14 +1346,23 @@ class AIChatUtil {
|
|
|
1314
1346
|
if (!utilDE2Name || !(utilParams == null ? void 0 : utilParams.getKnowledgeBaseId))
|
|
1315
1347
|
return items;
|
|
1316
1348
|
const resultParams = { ...params, page: 0, size: 1e3 };
|
|
1317
|
-
if (query) {
|
|
1318
|
-
Object.assign(resultParams, { query });
|
|
1319
|
-
}
|
|
1320
1349
|
if (editorParams && editorParams.knowledgebases) {
|
|
1321
1350
|
Object.assign(resultParams, {
|
|
1322
1351
|
knowledgebases: editorParams.knowledgebases
|
|
1323
1352
|
});
|
|
1324
1353
|
}
|
|
1354
|
+
const { query, knowledgebases } = args || {};
|
|
1355
|
+
if (query)
|
|
1356
|
+
Object.assign(resultParams, { query });
|
|
1357
|
+
if (knowledgebases) {
|
|
1358
|
+
const knowledge = /* @__PURE__ */ new Set([
|
|
1359
|
+
...knowledgebases.split(","),
|
|
1360
|
+
...((_a = resultParams.knowledgebases) == null ? void 0 : _a.split(",")) || []
|
|
1361
|
+
]);
|
|
1362
|
+
Object.assign(resultParams, {
|
|
1363
|
+
knowledgebases: Array.from(knowledge).join(",")
|
|
1364
|
+
});
|
|
1365
|
+
}
|
|
1325
1366
|
const result = await app.deService.exec(
|
|
1326
1367
|
utilDE2Name,
|
|
1327
1368
|
utilParams.getKnowledgeBaseId,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createUUID } from 'qx-util';
|
|
2
2
|
import { RouteConst, getAppFuncBlockProvider, getDeACMode, calcDeCodeNameById, ScriptFactory } from '@ibiz-template/runtime';
|
|
3
3
|
import { route2routePath, useUIStore, routePath2string } from '@ibiz-template/vue3-util';
|
|
4
|
+
import { getDevToolConfig } from '@ibiz-template/devtool';
|
|
4
5
|
|
|
5
6
|
"use strict";
|
|
6
7
|
var __defProp = Object.defineProperty;
|
|
@@ -351,6 +352,13 @@ class AppUtil {
|
|
|
351
352
|
}
|
|
352
353
|
return text;
|
|
353
354
|
}
|
|
355
|
+
/**
|
|
356
|
+
* 获取运行时开发工具配置
|
|
357
|
+
* @returns 运行时开发工具配置
|
|
358
|
+
*/
|
|
359
|
+
getRuntimeDevToolConfig() {
|
|
360
|
+
return getDevToolConfig();
|
|
361
|
+
}
|
|
354
362
|
}
|
|
355
363
|
|
|
356
364
|
export { AppUtil };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createApp } from 'vue';
|
|
2
2
|
import ElementPlus from 'element-plus';
|
|
3
|
-
import { defaultNamespace } from '../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.
|
|
3
|
+
import { defaultNamespace } from '../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.138_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1/node_modules/@ibiz-template/core/out/utils/namespace/namespace.mjs';
|
|
4
4
|
import { IBizFullscreenToolbar } from '../../common/fullscreen-toolbar/fullscreen-toolbar.mjs';
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var vue = require('vue');
|
|
4
|
-
var namespace = require('../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.
|
|
4
|
+
var namespace = require('../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.138_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs');
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
7
7
|
function useAppDRTab(c, controlRef, counterData) {
|
|
@@ -82,7 +82,6 @@ const IBizEmbedAIChat = /* @__PURE__ */ vue.defineComponent({
|
|
|
82
82
|
}
|
|
83
83
|
const chatInstanceOptions = {
|
|
84
84
|
mode: editorParams.srfaimode || "TOPIC",
|
|
85
|
-
placeholder: c.placeHolder,
|
|
86
85
|
resourceOptions,
|
|
87
86
|
containerOptions: {
|
|
88
87
|
container: aiChatElementRef.value
|
|
@@ -107,6 +106,7 @@ const IBizEmbedAIChat = /* @__PURE__ */ vue.defineComponent({
|
|
|
107
106
|
...chatOptions,
|
|
108
107
|
sessionid,
|
|
109
108
|
isSimple: c.isSimple,
|
|
109
|
+
placeholder: c.placeHolder || ibiz.config.common.aiInputPlaceholder,
|
|
110
110
|
fetchAgentList: async (args) => {
|
|
111
111
|
const {
|
|
112
112
|
query
|
|
@@ -118,12 +118,18 @@ const IBizEmbedAIChat = /* @__PURE__ */ vue.defineComponent({
|
|
|
118
118
|
agentMap.set(query, agent);
|
|
119
119
|
return agent;
|
|
120
120
|
},
|
|
121
|
-
fetchKnowledgeBaseList: async (
|
|
122
|
-
|
|
121
|
+
fetchKnowledgeBaseList: async (args) => {
|
|
122
|
+
const {
|
|
123
|
+
query,
|
|
124
|
+
knowledgebases
|
|
125
|
+
} = args || {};
|
|
126
|
+
const key = "".concat(query, "@").concat(knowledgebases);
|
|
127
|
+
let knowledge = knowledgeMap.get(key);
|
|
123
128
|
if (knowledge == null ? void 0 : knowledge.length)
|
|
124
129
|
return knowledge;
|
|
125
|
-
knowledge = await chatOptions.fetchKnowledgeBaseList(
|
|
126
|
-
|
|
130
|
+
knowledge = await chatOptions.fetchKnowledgeBaseList(args);
|
|
131
|
+
if (knowledge)
|
|
132
|
+
knowledgeMap.set(key, knowledge);
|
|
127
133
|
return knowledge;
|
|
128
134
|
},
|
|
129
135
|
action: (action, message) => {
|
|
@@ -191,6 +191,11 @@ class AIChatUtil {
|
|
|
191
191
|
} else {
|
|
192
192
|
chatOptions.captionComputedMode = ibiz.config.common.aiChatTopicCaptionComputedMode;
|
|
193
193
|
}
|
|
194
|
+
if (editorParams.srfaiinputplaceholder) {
|
|
195
|
+
chatOptions.placeholder = editorParams.srfaiinputplaceholder;
|
|
196
|
+
} else {
|
|
197
|
+
chatOptions.placeholder = ibiz.config.common.aiInputPlaceholder;
|
|
198
|
+
}
|
|
194
199
|
chatOptions.fetchAgentList = (args2 = {}) => {
|
|
195
200
|
const { query, agentid } = args2;
|
|
196
201
|
return this.getAIAgentList(
|
|
@@ -199,8 +204,8 @@ class AIChatUtil {
|
|
|
199
204
|
editorParams
|
|
200
205
|
);
|
|
201
206
|
};
|
|
202
|
-
chatOptions.fetchKnowledgeBaseList = (
|
|
203
|
-
return this.getKnowledgeBaseList(context, params, editorParams,
|
|
207
|
+
chatOptions.fetchKnowledgeBaseList = (args2 = {}) => {
|
|
208
|
+
return this.getKnowledgeBaseList(context, params, editorParams, args2);
|
|
204
209
|
};
|
|
205
210
|
if (deACMode) {
|
|
206
211
|
const {
|
|
@@ -400,6 +405,11 @@ class AIChatUtil {
|
|
|
400
405
|
sessionid: other.sessionid
|
|
401
406
|
});
|
|
402
407
|
}
|
|
408
|
+
if (other.srfaiagent) {
|
|
409
|
+
Object.assign(abortRequestData, {
|
|
410
|
+
srfaiagent: other.srfaiagent
|
|
411
|
+
});
|
|
412
|
+
}
|
|
403
413
|
await deService.aiChatCancel(ctx, param, abortRequestData);
|
|
404
414
|
asyncacitonid = "";
|
|
405
415
|
}
|
|
@@ -422,6 +432,11 @@ class AIChatUtil {
|
|
|
422
432
|
sessionid: other.sessionid
|
|
423
433
|
});
|
|
424
434
|
}
|
|
435
|
+
if (other.srfaiagent) {
|
|
436
|
+
Object.assign(supplementRequestData, {
|
|
437
|
+
srfaiagent: other.srfaiagent
|
|
438
|
+
});
|
|
439
|
+
}
|
|
425
440
|
if (other.messages) {
|
|
426
441
|
Object.assign(supplementRequestData, {
|
|
427
442
|
messages: other.messages
|
|
@@ -813,6 +828,12 @@ class AIChatUtil {
|
|
|
813
828
|
} else {
|
|
814
829
|
chatOptions.captionComputedMode = ibiz.config.common.aiChatTopicCaptionComputedMode;
|
|
815
830
|
}
|
|
831
|
+
if (params.hasOwnProperty("srfaiinputplaceholder")) {
|
|
832
|
+
chatOptions.placeholder = params.srfaiinputplaceholder;
|
|
833
|
+
delete params.srfaiinputplaceholder;
|
|
834
|
+
} else {
|
|
835
|
+
chatOptions.placeholder = ibiz.config.common.aiInputPlaceholder;
|
|
836
|
+
}
|
|
816
837
|
chatOptions.fetchAgentList = (args2 = {}) => {
|
|
817
838
|
const { query, agentid } = args2;
|
|
818
839
|
return this.getAIAgentList(context, {
|
|
@@ -821,8 +842,8 @@ class AIChatUtil {
|
|
|
821
842
|
srfaiagent: agentid
|
|
822
843
|
});
|
|
823
844
|
};
|
|
824
|
-
chatOptions.fetchKnowledgeBaseList = (
|
|
825
|
-
return this.getKnowledgeBaseList(context, params, void 0,
|
|
845
|
+
chatOptions.fetchKnowledgeBaseList = (args2 = {}) => {
|
|
846
|
+
return this.getKnowledgeBaseList(context, params, void 0, args2);
|
|
826
847
|
};
|
|
827
848
|
if (deACMode) {
|
|
828
849
|
const {
|
|
@@ -1018,6 +1039,11 @@ class AIChatUtil {
|
|
|
1018
1039
|
sessionid: other.sessionid
|
|
1019
1040
|
});
|
|
1020
1041
|
}
|
|
1042
|
+
if (other.srfaiagent) {
|
|
1043
|
+
Object.assign(abortRequestData, {
|
|
1044
|
+
srfaiagent: other.srfaiagent
|
|
1045
|
+
});
|
|
1046
|
+
}
|
|
1021
1047
|
await deService.aiChatCancel(ctx, param, abortRequestData);
|
|
1022
1048
|
asyncacitonid = "";
|
|
1023
1049
|
}
|
|
@@ -1040,6 +1066,11 @@ class AIChatUtil {
|
|
|
1040
1066
|
sessionid: other.sessionid
|
|
1041
1067
|
});
|
|
1042
1068
|
}
|
|
1069
|
+
if (other.srfaiagent) {
|
|
1070
|
+
Object.assign(supplementRequestData, {
|
|
1071
|
+
srfaiagent: other.srfaiagent
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1043
1074
|
if (other.messages) {
|
|
1044
1075
|
Object.assign(supplementRequestData, {
|
|
1045
1076
|
messages: other.messages
|
|
@@ -1302,11 +1333,12 @@ class AIChatUtil {
|
|
|
1302
1333
|
* @param {IContext} context
|
|
1303
1334
|
* @param {IParams} params
|
|
1304
1335
|
* @param {IData} [editorParams]
|
|
1305
|
-
* @param {
|
|
1336
|
+
* @param {IParams} [args]
|
|
1306
1337
|
* @returns {*} {Promise<IData[]>}
|
|
1307
1338
|
* @memberof AIChatUtil
|
|
1308
1339
|
*/
|
|
1309
|
-
async getKnowledgeBaseList(context, params, editorParams,
|
|
1340
|
+
async getKnowledgeBaseList(context, params, editorParams, args) {
|
|
1341
|
+
var _a;
|
|
1310
1342
|
let items = [];
|
|
1311
1343
|
const app = ibiz.hub.getApp(context.srfappid || ibiz.env.appId);
|
|
1312
1344
|
const aiAgentUtil = app.getAppUtil("DYNAMICAIGENT", "CUSTOM");
|
|
@@ -1316,14 +1348,23 @@ class AIChatUtil {
|
|
|
1316
1348
|
if (!utilDE2Name || !(utilParams == null ? void 0 : utilParams.getKnowledgeBaseId))
|
|
1317
1349
|
return items;
|
|
1318
1350
|
const resultParams = { ...params, page: 0, size: 1e3 };
|
|
1319
|
-
if (query) {
|
|
1320
|
-
Object.assign(resultParams, { query });
|
|
1321
|
-
}
|
|
1322
1351
|
if (editorParams && editorParams.knowledgebases) {
|
|
1323
1352
|
Object.assign(resultParams, {
|
|
1324
1353
|
knowledgebases: editorParams.knowledgebases
|
|
1325
1354
|
});
|
|
1326
1355
|
}
|
|
1356
|
+
const { query, knowledgebases } = args || {};
|
|
1357
|
+
if (query)
|
|
1358
|
+
Object.assign(resultParams, { query });
|
|
1359
|
+
if (knowledgebases) {
|
|
1360
|
+
const knowledge = /* @__PURE__ */ new Set([
|
|
1361
|
+
...knowledgebases.split(","),
|
|
1362
|
+
...((_a = resultParams.knowledgebases) == null ? void 0 : _a.split(",")) || []
|
|
1363
|
+
]);
|
|
1364
|
+
Object.assign(resultParams, {
|
|
1365
|
+
knowledgebases: Array.from(knowledge).join(",")
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1327
1368
|
const result = await app.deService.exec(
|
|
1328
1369
|
utilDE2Name,
|
|
1329
1370
|
utilParams.getKnowledgeBaseId,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var qxUtil = require('qx-util');
|
|
4
4
|
var runtime = require('@ibiz-template/runtime');
|
|
5
5
|
var vue3Util = require('@ibiz-template/vue3-util');
|
|
6
|
+
var devtool = require('@ibiz-template/devtool');
|
|
6
7
|
|
|
7
8
|
"use strict";
|
|
8
9
|
var __defProp = Object.defineProperty;
|
|
@@ -353,6 +354,13 @@ class AppUtil {
|
|
|
353
354
|
}
|
|
354
355
|
return text;
|
|
355
356
|
}
|
|
357
|
+
/**
|
|
358
|
+
* 获取运行时开发工具配置
|
|
359
|
+
* @returns 运行时开发工具配置
|
|
360
|
+
*/
|
|
361
|
+
getRuntimeDevToolConfig() {
|
|
362
|
+
return devtool.getDevToolConfig();
|
|
363
|
+
}
|
|
356
364
|
}
|
|
357
365
|
|
|
358
366
|
exports.AppUtil = AppUtil;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var vue = require('vue');
|
|
4
4
|
var ElementPlus = require('element-plus');
|
|
5
|
-
var namespace = require('../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.
|
|
5
|
+
var namespace = require('../../node_modules/.pnpm/@ibiz-template_core@0.7.41-alpha.138_axios@1.12.2_lodash-es@4.17.21_qs@6.14.0_qx-util@0.4.8_ramda@0.29.1/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs');
|
|
6
6
|
var fullscreenToolbar = require('../../common/fullscreen-toolbar/fullscreen-toolbar.cjs');
|
|
7
7
|
|
|
8
8
|
"use strict";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/vue3-components",
|
|
3
|
-
"version": "0.7.41-alpha.
|
|
3
|
+
"version": "0.7.41-alpha.134",
|
|
4
4
|
"description": "web端组件库(vue3)",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -31,16 +31,16 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@amap/amap-jsapi-loader": "^1.0.1",
|
|
33
33
|
"@floating-ui/dom": "^1.5.3",
|
|
34
|
-
"@ibiz-template-plugin/ai-chat": "^0.0.
|
|
34
|
+
"@ibiz-template-plugin/ai-chat": "^0.0.101",
|
|
35
35
|
"@ibiz-template-plugin/gantt": "0.1.8-alpha.468",
|
|
36
36
|
"@ibiz-template-plugin/bi-report": "0.0.32",
|
|
37
37
|
"@ibiz-template-plugin/data-view": "0.0.8",
|
|
38
|
-
"@ibiz-template/core": "0.7.41-alpha.
|
|
39
|
-
"@ibiz-template/devtool": "0.0.
|
|
40
|
-
"@ibiz-template/model-helper": "0.7.41-alpha.
|
|
41
|
-
"@ibiz-template/runtime": "0.7.41-alpha.
|
|
38
|
+
"@ibiz-template/core": "0.7.41-alpha.138",
|
|
39
|
+
"@ibiz-template/devtool": "0.0.17",
|
|
40
|
+
"@ibiz-template/model-helper": "0.7.41-alpha.138",
|
|
41
|
+
"@ibiz-template/runtime": "0.7.41-alpha.138",
|
|
42
42
|
"@ibiz-template/theme": "0.7.39",
|
|
43
|
-
"@ibiz-template/vue3-util": "0.7.41-alpha.
|
|
43
|
+
"@ibiz-template/vue3-util": "0.7.41-alpha.138",
|
|
44
44
|
"@ibiz-template/web-theme": "3.16.0",
|
|
45
45
|
"@ibiz/model-core": "^0.1.89",
|
|
46
46
|
"@imengyu/vue3-context-menu": "^1.3.5",
|
|
@@ -117,7 +117,6 @@ export const IBizEmbedAIChat = defineComponent({
|
|
|
117
117
|
}
|
|
118
118
|
const chatInstanceOptions: IData = {
|
|
119
119
|
mode: editorParams.srfaimode || 'TOPIC',
|
|
120
|
-
placeholder: c.placeHolder,
|
|
121
120
|
resourceOptions,
|
|
122
121
|
containerOptions: {
|
|
123
122
|
container: aiChatElementRef.value,
|
|
@@ -140,6 +139,7 @@ export const IBizEmbedAIChat = defineComponent({
|
|
|
140
139
|
...chatOptions,
|
|
141
140
|
sessionid,
|
|
142
141
|
isSimple: c.isSimple,
|
|
142
|
+
placeholder: c.placeHolder || ibiz.config.common.aiInputPlaceholder,
|
|
143
143
|
fetchAgentList: async (args?: {
|
|
144
144
|
query?: string;
|
|
145
145
|
agentid?: string;
|
|
@@ -151,11 +151,16 @@ export const IBizEmbedAIChat = defineComponent({
|
|
|
151
151
|
agentMap.set(query, agent as IData[]);
|
|
152
152
|
return agent;
|
|
153
153
|
},
|
|
154
|
-
fetchKnowledgeBaseList: async (
|
|
155
|
-
|
|
154
|
+
fetchKnowledgeBaseList: async (args?: {
|
|
155
|
+
query?: string;
|
|
156
|
+
knowledgebases?: string;
|
|
157
|
+
}) => {
|
|
158
|
+
const { query, knowledgebases } = args || {};
|
|
159
|
+
const key = `${query}@${knowledgebases}`;
|
|
160
|
+
let knowledge = knowledgeMap.get(key);
|
|
156
161
|
if (knowledge?.length) return knowledge;
|
|
157
|
-
knowledge = await chatOptions.fetchKnowledgeBaseList(
|
|
158
|
-
knowledgeMap.set(
|
|
162
|
+
knowledge = await chatOptions.fetchKnowledgeBaseList(args);
|
|
163
|
+
if (knowledge) knowledgeMap.set(key, knowledge);
|
|
159
164
|
return knowledge;
|
|
160
165
|
},
|
|
161
166
|
action: (action: string, message: IData) => {
|
|
@@ -297,6 +297,12 @@ export class AIChatUtil implements IApiAIChatUtil {
|
|
|
297
297
|
chatOptions.captionComputedMode =
|
|
298
298
|
ibiz.config.common.aiChatTopicCaptionComputedMode;
|
|
299
299
|
}
|
|
300
|
+
// 输入框空白占位
|
|
301
|
+
if (editorParams.srfaiinputplaceholder) {
|
|
302
|
+
chatOptions.placeholder = editorParams.srfaiinputplaceholder;
|
|
303
|
+
} else {
|
|
304
|
+
chatOptions.placeholder = ibiz.config.common.aiInputPlaceholder;
|
|
305
|
+
}
|
|
300
306
|
|
|
301
307
|
// 智能体选项(由内部获取,优化打开速度)
|
|
302
308
|
chatOptions.fetchAgentList = (args: IParams = {}) => {
|
|
@@ -308,8 +314,8 @@ export class AIChatUtil implements IApiAIChatUtil {
|
|
|
308
314
|
);
|
|
309
315
|
};
|
|
310
316
|
// 知识库
|
|
311
|
-
chatOptions.fetchKnowledgeBaseList = (
|
|
312
|
-
return this.getKnowledgeBaseList(context, params, editorParams,
|
|
317
|
+
chatOptions.fetchKnowledgeBaseList = (args: IParams = {}) => {
|
|
318
|
+
return this.getKnowledgeBaseList(context, params, editorParams, args);
|
|
313
319
|
};
|
|
314
320
|
// 扩展工具栏
|
|
315
321
|
if (deACMode) {
|
|
@@ -550,6 +556,11 @@ export class AIChatUtil implements IApiAIChatUtil {
|
|
|
550
556
|
sessionid: other.sessionid,
|
|
551
557
|
});
|
|
552
558
|
}
|
|
559
|
+
if (other.srfaiagent) {
|
|
560
|
+
Object.assign(abortRequestData, {
|
|
561
|
+
srfaiagent: other.srfaiagent,
|
|
562
|
+
});
|
|
563
|
+
}
|
|
553
564
|
await deService.aiChatCancel(ctx, param, abortRequestData);
|
|
554
565
|
asyncacitonid = '';
|
|
555
566
|
}
|
|
@@ -581,6 +592,11 @@ export class AIChatUtil implements IApiAIChatUtil {
|
|
|
581
592
|
sessionid: other.sessionid,
|
|
582
593
|
});
|
|
583
594
|
}
|
|
595
|
+
if (other.srfaiagent) {
|
|
596
|
+
Object.assign(supplementRequestData, {
|
|
597
|
+
srfaiagent: other.srfaiagent,
|
|
598
|
+
});
|
|
599
|
+
}
|
|
584
600
|
if (other.messages) {
|
|
585
601
|
Object.assign(supplementRequestData, {
|
|
586
602
|
messages: other.messages,
|
|
@@ -1081,6 +1097,13 @@ export class AIChatUtil implements IApiAIChatUtil {
|
|
|
1081
1097
|
chatOptions.captionComputedMode =
|
|
1082
1098
|
ibiz.config.common.aiChatTopicCaptionComputedMode;
|
|
1083
1099
|
}
|
|
1100
|
+
// 输入框空白占位
|
|
1101
|
+
if (params.hasOwnProperty('srfaiinputplaceholder')) {
|
|
1102
|
+
chatOptions.placeholder = params.srfaiinputplaceholder;
|
|
1103
|
+
delete params.srfaiinputplaceholder;
|
|
1104
|
+
} else {
|
|
1105
|
+
chatOptions.placeholder = ibiz.config.common.aiInputPlaceholder;
|
|
1106
|
+
}
|
|
1084
1107
|
|
|
1085
1108
|
// 智能体选项(由内部获取,优化打开速度)
|
|
1086
1109
|
chatOptions.fetchAgentList = (args: IParams = {}) => {
|
|
@@ -1092,8 +1115,8 @@ export class AIChatUtil implements IApiAIChatUtil {
|
|
|
1092
1115
|
});
|
|
1093
1116
|
};
|
|
1094
1117
|
// 知识库
|
|
1095
|
-
chatOptions.fetchKnowledgeBaseList = (
|
|
1096
|
-
return this.getKnowledgeBaseList(context, params, undefined,
|
|
1118
|
+
chatOptions.fetchKnowledgeBaseList = (args: IParams = {}) => {
|
|
1119
|
+
return this.getKnowledgeBaseList(context, params, undefined, args);
|
|
1097
1120
|
};
|
|
1098
1121
|
// 扩展工具栏
|
|
1099
1122
|
if (deACMode) {
|
|
@@ -1328,6 +1351,11 @@ export class AIChatUtil implements IApiAIChatUtil {
|
|
|
1328
1351
|
sessionid: other.sessionid,
|
|
1329
1352
|
});
|
|
1330
1353
|
}
|
|
1354
|
+
if (other.srfaiagent) {
|
|
1355
|
+
Object.assign(abortRequestData, {
|
|
1356
|
+
srfaiagent: other.srfaiagent,
|
|
1357
|
+
});
|
|
1358
|
+
}
|
|
1331
1359
|
await deService.aiChatCancel(ctx, param, abortRequestData);
|
|
1332
1360
|
asyncacitonid = '';
|
|
1333
1361
|
}
|
|
@@ -1359,6 +1387,11 @@ export class AIChatUtil implements IApiAIChatUtil {
|
|
|
1359
1387
|
sessionid: other.sessionid,
|
|
1360
1388
|
});
|
|
1361
1389
|
}
|
|
1390
|
+
if (other.srfaiagent) {
|
|
1391
|
+
Object.assign(supplementRequestData, {
|
|
1392
|
+
srfaiagent: other.srfaiagent,
|
|
1393
|
+
});
|
|
1394
|
+
}
|
|
1362
1395
|
if (other.messages) {
|
|
1363
1396
|
Object.assign(supplementRequestData, {
|
|
1364
1397
|
messages: other.messages,
|
|
@@ -1678,7 +1711,7 @@ export class AIChatUtil implements IApiAIChatUtil {
|
|
|
1678
1711
|
* @param {IContext} context
|
|
1679
1712
|
* @param {IParams} params
|
|
1680
1713
|
* @param {IData} [editorParams]
|
|
1681
|
-
* @param {
|
|
1714
|
+
* @param {IParams} [args]
|
|
1682
1715
|
* @returns {*} {Promise<IData[]>}
|
|
1683
1716
|
* @memberof AIChatUtil
|
|
1684
1717
|
*/
|
|
@@ -1686,7 +1719,7 @@ export class AIChatUtil implements IApiAIChatUtil {
|
|
|
1686
1719
|
context: IContext,
|
|
1687
1720
|
params: IParams,
|
|
1688
1721
|
editorParams?: IData,
|
|
1689
|
-
|
|
1722
|
+
args?: IParams,
|
|
1690
1723
|
): Promise<IData[]> {
|
|
1691
1724
|
let items: IData[] = [];
|
|
1692
1725
|
const app = ibiz.hub.getApp(context.srfappid || ibiz.env.appId);
|
|
@@ -1695,15 +1728,23 @@ export class AIChatUtil implements IApiAIChatUtil {
|
|
|
1695
1728
|
const { utilParams, utilDE2Name } = aiAgentUtil;
|
|
1696
1729
|
if (!utilDE2Name || !utilParams?.getKnowledgeBaseId) return items;
|
|
1697
1730
|
const resultParams: IData = { ...params, page: 0, size: 1000 };
|
|
1698
|
-
// 附加快速查询字符串
|
|
1699
|
-
if (query) {
|
|
1700
|
-
Object.assign(resultParams, { query });
|
|
1701
|
-
}
|
|
1702
1731
|
if (editorParams && editorParams.knowledgebases) {
|
|
1703
1732
|
Object.assign(resultParams, {
|
|
1704
1733
|
knowledgebases: editorParams.knowledgebases,
|
|
1705
1734
|
});
|
|
1706
1735
|
}
|
|
1736
|
+
// 附加参数
|
|
1737
|
+
const { query, knowledgebases } = args || {};
|
|
1738
|
+
if (query) Object.assign(resultParams, { query });
|
|
1739
|
+
if (knowledgebases) {
|
|
1740
|
+
const knowledge = new Set([
|
|
1741
|
+
...knowledgebases.split(','),
|
|
1742
|
+
...(resultParams.knowledgebases?.split(',') || []),
|
|
1743
|
+
]);
|
|
1744
|
+
Object.assign(resultParams, {
|
|
1745
|
+
knowledgebases: Array.from(knowledge).join(','),
|
|
1746
|
+
});
|
|
1747
|
+
}
|
|
1707
1748
|
const result = await app.deService.exec(
|
|
1708
1749
|
utilDE2Name,
|
|
1709
1750
|
utilParams.getKnowledgeBaseId,
|
|
@@ -18,12 +18,13 @@ import {
|
|
|
18
18
|
ScriptFactory,
|
|
19
19
|
getAppFuncBlockProvider,
|
|
20
20
|
} from '@ibiz-template/runtime';
|
|
21
|
-
import { IChatMessage } from '@ibiz-template/core';
|
|
21
|
+
import { IChatMessage, IDevToolConfig } from '@ibiz-template/core';
|
|
22
22
|
import {
|
|
23
23
|
route2routePath,
|
|
24
24
|
routePath2string,
|
|
25
25
|
useUIStore,
|
|
26
26
|
} from '@ibiz-template/vue3-util';
|
|
27
|
+
import { getDevToolConfig } from '@ibiz-template/devtool';
|
|
27
28
|
|
|
28
29
|
export class AppUtil implements IAppUtil {
|
|
29
30
|
/**
|
|
@@ -444,4 +445,12 @@ export class AppUtil implements IAppUtil {
|
|
|
444
445
|
}
|
|
445
446
|
return text;
|
|
446
447
|
}
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* 获取运行时开发工具配置
|
|
451
|
+
* @returns 运行时开发工具配置
|
|
452
|
+
*/
|
|
453
|
+
getRuntimeDevToolConfig(): IDevToolConfig {
|
|
454
|
+
return getDevToolConfig();
|
|
455
|
+
}
|
|
447
456
|
}
|