wechaty-web-panel 1.6.99 → 1.6.101
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/cjs/src/common/index.js +5 -5
- package/dist/cjs/src/package-json.js +1 -1
- package/dist/cjs/src/proxy/bot/dispatch.js +7 -3
- package/dist/cjs/src/service/event-dispatch-service.js +7 -3
- package/dist/esm/src/common/index.js +5 -5
- package/dist/esm/src/package-json.js +1 -1
- package/dist/esm/src/proxy/bot/dispatch.js +7 -3
- package/dist/esm/src/service/event-dispatch-service.js +7 -3
- package/package.json +1 -1
- package/src/common/index.js +5 -5
- package/src/package-json.js +1 -1
- package/src/proxy/bot/dispatch.js +7 -3
- package/src/service/event-dispatch-service.js +7 -3
|
@@ -222,11 +222,11 @@ async function addReplyHistory(that, { content, contact, room }) {
|
|
|
222
222
|
const { role } = config.userInfo;
|
|
223
223
|
if (role !== 'vip')
|
|
224
224
|
return;
|
|
225
|
-
const robotInfo = that?.currentUser
|
|
226
|
-
const userSelfName = robotInfo?.name()
|
|
227
|
-
const userSelfId = robotInfo?.id
|
|
228
|
-
const contactName = contact?.name(); // 接收消息人昵称
|
|
229
|
-
const contactId = contact?.id; // 接收消息人id
|
|
225
|
+
const robotInfo = that ? that?.currentUser : {};
|
|
226
|
+
const userSelfName = robotInfo ? robotInfo?.name() : ''; // 机器人名称
|
|
227
|
+
const userSelfId = robotInfo ? robotInfo?.id : ''; // 机器人名称
|
|
228
|
+
const contactName = contact && contact?.name ? contact?.name() : ''; // 接收消息人昵称
|
|
229
|
+
const contactId = contact ? contact?.id : ''; // 接收消息人id
|
|
230
230
|
const roomName = room ? await room.topic() : '';
|
|
231
231
|
const historyItem = {
|
|
232
232
|
conversionId: room ? room.id : contactId,
|
|
@@ -20,6 +20,10 @@ const userDb_js_1 = require("../../db/userDb.js");
|
|
|
20
20
|
*/
|
|
21
21
|
async function dispatchBot({ botType, isMention, userAlias, userWeixin, content, id, uid, uname, roomId, roomName, adminId, config, file }) {
|
|
22
22
|
console.log('进入定制机器人回复');
|
|
23
|
+
let userId = '';
|
|
24
|
+
if (process.env['CUSTOM_USER_ID']) {
|
|
25
|
+
userId = process.env['CUSTOM_USER_ID'];
|
|
26
|
+
}
|
|
23
27
|
try {
|
|
24
28
|
const contactSelf = await (0, userDb_js_1.getUser)();
|
|
25
29
|
const gptConfig = global_js_1.default.getGptConfigById(adminId);
|
|
@@ -33,13 +37,13 @@ async function dispatchBot({ botType, isMention, userAlias, userWeixin, content,
|
|
|
33
37
|
case 8:
|
|
34
38
|
// dify ai
|
|
35
39
|
console.log('进入Dify聊天');
|
|
36
|
-
res = await (0, dify_js_1.getDifyAiReply)({ content, file, inputs: { isMention: isMention ? 1 : 0, uid, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } }, id, adminId, config);
|
|
40
|
+
res = await (0, dify_js_1.getDifyAiReply)({ content, file, inputs: { userid: userId, isMention: isMention ? 1 : 0, uid, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } }, id, adminId, config);
|
|
37
41
|
replys = res;
|
|
38
42
|
break;
|
|
39
43
|
case 9:
|
|
40
44
|
// fastGPT api
|
|
41
45
|
console.log('进入FastGPT聊天');
|
|
42
|
-
res = await (0, fastgpt_js_1.getFastGPTReply)({ content, file, variables: { isMention: isMention ? 1 : 0, uid, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } }, id, adminId, config);
|
|
46
|
+
res = await (0, fastgpt_js_1.getFastGPTReply)({ content, file, variables: { userid: userId, isMention: isMention ? 1 : 0, uid, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } }, id, adminId, config);
|
|
43
47
|
replys = res;
|
|
44
48
|
break;
|
|
45
49
|
case 11:
|
|
@@ -56,7 +60,7 @@ async function dispatchBot({ botType, isMention, userAlias, userWeixin, content,
|
|
|
56
60
|
case 12:
|
|
57
61
|
// coze v3 api
|
|
58
62
|
console.log('进入Coze V3聊天');
|
|
59
|
-
res = await (0, cozev3_js_1.getCozeV3AiReply)({ content, file, inputs: { isMention: isMention ? '1' : '0', uid, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } }, id, adminId, config);
|
|
63
|
+
res = await (0, cozev3_js_1.getCozeV3AiReply)({ content, file, inputs: { userid: userId, isMention: isMention ? '1' : '0', uid, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } }, id, adminId, config);
|
|
60
64
|
replys = res;
|
|
61
65
|
break;
|
|
62
66
|
case 13:
|
|
@@ -187,6 +187,10 @@ async function dispatchAiBot({ bot, msg, name, id, isMention, uid, uname, roomId
|
|
|
187
187
|
try {
|
|
188
188
|
let res, replys;
|
|
189
189
|
const contactSelf = await (0, userDb_js_1.getUser)();
|
|
190
|
+
let userId = '';
|
|
191
|
+
if (process.env['CUSTOM_USER_ID']) {
|
|
192
|
+
userId = process.env['CUSTOM_USER_ID'];
|
|
193
|
+
}
|
|
190
194
|
switch (bot) {
|
|
191
195
|
case 0:
|
|
192
196
|
if (file) {
|
|
@@ -214,12 +218,12 @@ async function dispatchAiBot({ bot, msg, name, id, isMention, uid, uname, roomId
|
|
|
214
218
|
break;
|
|
215
219
|
case 8:
|
|
216
220
|
// dify ai
|
|
217
|
-
res = await (0, difyAi_js_1.getDifyReply)({ content: msg, file, id, inputs: { isMention: isMention ? 1 : 0, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, uid, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } });
|
|
221
|
+
res = await (0, difyAi_js_1.getDifyReply)({ content: msg, file, id, inputs: { useid: userId, isMention: isMention ? 1 : 0, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, uid, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } });
|
|
218
222
|
replys = res;
|
|
219
223
|
break;
|
|
220
224
|
case 9:
|
|
221
225
|
// fast gpt
|
|
222
|
-
res = await (0, fastgpt_js_1.getFastGPTReply)({ content: msg, file }, id, { isMention: isMention ? 1 : 0, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, uid, uname, ualias: userAlias, uweixin: userWeixin, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name });
|
|
226
|
+
res = await (0, fastgpt_js_1.getFastGPTReply)({ content: msg, file }, id, { useid: userId, isMention: isMention ? 1 : 0, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, uid, uname, ualias: userAlias, uweixin: userWeixin, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name });
|
|
223
227
|
replys = res;
|
|
224
228
|
break;
|
|
225
229
|
case 11:
|
|
@@ -234,7 +238,7 @@ async function dispatchAiBot({ bot, msg, name, id, isMention, uid, uname, roomId
|
|
|
234
238
|
break;
|
|
235
239
|
case 12:
|
|
236
240
|
// coze v3
|
|
237
|
-
res = await (0, cozeV3Ai_js_1.getCozeV3Reply)({ content: msg, file, id, inputs: { isMention: isMention ? '1' : '0', fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, uid, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } });
|
|
241
|
+
res = await (0, cozeV3Ai_js_1.getCozeV3Reply)({ content: msg, file, id, inputs: { useid: userId, isMention: isMention ? '1' : '0', fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, uid, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } });
|
|
238
242
|
replys = res;
|
|
239
243
|
break;
|
|
240
244
|
case 13:
|
|
@@ -202,11 +202,11 @@ async function addReplyHistory(that, { content, contact, room }) {
|
|
|
202
202
|
const { role } = config.userInfo;
|
|
203
203
|
if (role !== 'vip')
|
|
204
204
|
return;
|
|
205
|
-
const robotInfo = that?.currentUser
|
|
206
|
-
const userSelfName = robotInfo?.name()
|
|
207
|
-
const userSelfId = robotInfo?.id
|
|
208
|
-
const contactName = contact?.name(); // 接收消息人昵称
|
|
209
|
-
const contactId = contact?.id; // 接收消息人id
|
|
205
|
+
const robotInfo = that ? that?.currentUser : {};
|
|
206
|
+
const userSelfName = robotInfo ? robotInfo?.name() : ''; // 机器人名称
|
|
207
|
+
const userSelfId = robotInfo ? robotInfo?.id : ''; // 机器人名称
|
|
208
|
+
const contactName = contact && contact?.name ? contact?.name() : ''; // 接收消息人昵称
|
|
209
|
+
const contactId = contact ? contact?.id : ''; // 接收消息人id
|
|
210
210
|
const roomName = room ? await room.topic() : '';
|
|
211
211
|
const historyItem = {
|
|
212
212
|
conversionId: room ? room.id : contactId,
|
|
@@ -14,6 +14,10 @@ import { getUser } from '../../db/userDb.js';
|
|
|
14
14
|
*/
|
|
15
15
|
export async function dispatchBot({ botType, isMention, userAlias, userWeixin, content, id, uid, uname, roomId, roomName, adminId, config, file }) {
|
|
16
16
|
console.log('进入定制机器人回复');
|
|
17
|
+
let userId = '';
|
|
18
|
+
if (process.env['CUSTOM_USER_ID']) {
|
|
19
|
+
userId = process.env['CUSTOM_USER_ID'];
|
|
20
|
+
}
|
|
17
21
|
try {
|
|
18
22
|
const contactSelf = await getUser();
|
|
19
23
|
const gptConfig = globalConfig.getGptConfigById(adminId);
|
|
@@ -27,13 +31,13 @@ export async function dispatchBot({ botType, isMention, userAlias, userWeixin, c
|
|
|
27
31
|
case 8:
|
|
28
32
|
// dify ai
|
|
29
33
|
console.log('进入Dify聊天');
|
|
30
|
-
res = await getDifyAiReply({ content, file, inputs: { isMention: isMention ? 1 : 0, uid, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } }, id, adminId, config);
|
|
34
|
+
res = await getDifyAiReply({ content, file, inputs: { userid: userId, isMention: isMention ? 1 : 0, uid, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } }, id, adminId, config);
|
|
31
35
|
replys = res;
|
|
32
36
|
break;
|
|
33
37
|
case 9:
|
|
34
38
|
// fastGPT api
|
|
35
39
|
console.log('进入FastGPT聊天');
|
|
36
|
-
res = await getFastGPTReply({ content, file, variables: { isMention: isMention ? 1 : 0, uid, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } }, id, adminId, config);
|
|
40
|
+
res = await getFastGPTReply({ content, file, variables: { userid: userId, isMention: isMention ? 1 : 0, uid, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } }, id, adminId, config);
|
|
37
41
|
replys = res;
|
|
38
42
|
break;
|
|
39
43
|
case 11:
|
|
@@ -50,7 +54,7 @@ export async function dispatchBot({ botType, isMention, userAlias, userWeixin, c
|
|
|
50
54
|
case 12:
|
|
51
55
|
// coze v3 api
|
|
52
56
|
console.log('进入Coze V3聊天');
|
|
53
|
-
res = await getCozeV3AiReply({ content, file, inputs: { isMention: isMention ? '1' : '0', uid, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } }, id, adminId, config);
|
|
57
|
+
res = await getCozeV3AiReply({ content, file, inputs: { userid: userId, isMention: isMention ? '1' : '0', uid, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } }, id, adminId, config);
|
|
54
58
|
replys = res;
|
|
55
59
|
break;
|
|
56
60
|
case 13:
|
|
@@ -182,6 +182,10 @@ async function dispatchAiBot({ bot, msg, name, id, isMention, uid, uname, roomId
|
|
|
182
182
|
try {
|
|
183
183
|
let res, replys;
|
|
184
184
|
const contactSelf = await getUser();
|
|
185
|
+
let userId = '';
|
|
186
|
+
if (process.env['CUSTOM_USER_ID']) {
|
|
187
|
+
userId = process.env['CUSTOM_USER_ID'];
|
|
188
|
+
}
|
|
185
189
|
switch (bot) {
|
|
186
190
|
case 0:
|
|
187
191
|
if (file) {
|
|
@@ -209,12 +213,12 @@ async function dispatchAiBot({ bot, msg, name, id, isMention, uid, uname, roomId
|
|
|
209
213
|
break;
|
|
210
214
|
case 8:
|
|
211
215
|
// dify ai
|
|
212
|
-
res = await getDifyReply({ content: msg, file, id, inputs: { isMention: isMention ? 1 : 0, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, uid, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } });
|
|
216
|
+
res = await getDifyReply({ content: msg, file, id, inputs: { useid: userId, isMention: isMention ? 1 : 0, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, uid, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } });
|
|
213
217
|
replys = res;
|
|
214
218
|
break;
|
|
215
219
|
case 9:
|
|
216
220
|
// fast gpt
|
|
217
|
-
res = await getFastGPTReply({ content: msg, file }, id, { isMention: isMention ? 1 : 0, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, uid, uname, ualias: userAlias, uweixin: userWeixin, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name });
|
|
221
|
+
res = await getFastGPTReply({ content: msg, file }, id, { useid: userId, isMention: isMention ? 1 : 0, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, uid, uname, ualias: userAlias, uweixin: userWeixin, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name });
|
|
218
222
|
replys = res;
|
|
219
223
|
break;
|
|
220
224
|
case 11:
|
|
@@ -229,7 +233,7 @@ async function dispatchAiBot({ bot, msg, name, id, isMention, uid, uname, roomId
|
|
|
229
233
|
break;
|
|
230
234
|
case 12:
|
|
231
235
|
// coze v3
|
|
232
|
-
res = await getCozeV3Reply({ content: msg, file, id, inputs: { isMention: isMention ? '1' : '0', fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, uid, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } });
|
|
236
|
+
res = await getCozeV3Reply({ content: msg, file, id, inputs: { useid: userId, isMention: isMention ? '1' : '0', fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, uid, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } });
|
|
233
237
|
replys = res;
|
|
234
238
|
break;
|
|
235
239
|
case 13:
|
package/package.json
CHANGED
package/src/common/index.js
CHANGED
|
@@ -204,12 +204,12 @@ async function addReplyHistory(that, { content, contact, room }) {
|
|
|
204
204
|
const config = await allConfig()
|
|
205
205
|
const { role } = config.userInfo
|
|
206
206
|
if(role!=='vip') return
|
|
207
|
-
const robotInfo = that?.currentUser
|
|
208
|
-
const userSelfName = robotInfo?.name()
|
|
209
|
-
const userSelfId = robotInfo?.id
|
|
207
|
+
const robotInfo = that ? that?.currentUser : {}
|
|
208
|
+
const userSelfName = robotInfo ? robotInfo?.name() : '' // 机器人名称
|
|
209
|
+
const userSelfId = robotInfo ? robotInfo?.id : '' // 机器人名称
|
|
210
210
|
|
|
211
|
-
const contactName = contact?.name() // 接收消息人昵称
|
|
212
|
-
const contactId = contact?.id // 接收消息人id
|
|
211
|
+
const contactName = contact && contact?.name ? contact?.name() : '' // 接收消息人昵称
|
|
212
|
+
const contactId = contact ? contact?.id : '' // 接收消息人id
|
|
213
213
|
const roomName = room ? await room.topic() : '';
|
|
214
214
|
const historyItem = {
|
|
215
215
|
conversionId: room ? room.id : contactId,
|
package/src/package-json.js
CHANGED
|
@@ -15,6 +15,10 @@ import { getUser } from '../../db/userDb.js'
|
|
|
15
15
|
*/
|
|
16
16
|
export async function dispatchBot({ botType, isMention, userAlias, userWeixin, content, id, uid, uname, roomId, roomName, adminId, config, file }) {
|
|
17
17
|
console.log('进入定制机器人回复')
|
|
18
|
+
let userId = ''
|
|
19
|
+
if (process.env['CUSTOM_USER_ID']) {
|
|
20
|
+
userId = process.env['CUSTOM_USER_ID']
|
|
21
|
+
}
|
|
18
22
|
try {
|
|
19
23
|
const contactSelf = await getUser()
|
|
20
24
|
const gptConfig = globalConfig.getGptConfigById(adminId)
|
|
@@ -28,13 +32,13 @@ export async function dispatchBot({ botType, isMention, userAlias, userWeixin, c
|
|
|
28
32
|
case 8:
|
|
29
33
|
// dify ai
|
|
30
34
|
console.log('进入Dify聊天')
|
|
31
|
-
res = await getDifyAiReply({ content, file, inputs: { isMention: isMention ? 1:0, uid, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } }, id, adminId, config)
|
|
35
|
+
res = await getDifyAiReply({ content, file, inputs: { userid: userId, isMention: isMention ? 1:0, uid, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } }, id, adminId, config)
|
|
32
36
|
replys = res
|
|
33
37
|
break
|
|
34
38
|
case 9:
|
|
35
39
|
// fastGPT api
|
|
36
40
|
console.log('进入FastGPT聊天')
|
|
37
|
-
res = await getFastGPTReply({ content, file, variables: { isMention: isMention ? 1:0, uid, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } }, id, adminId, config)
|
|
41
|
+
res = await getFastGPTReply({ content, file, variables: { userid: userId, isMention: isMention ? 1:0, uid, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } }, id, adminId, config)
|
|
38
42
|
replys = res
|
|
39
43
|
break
|
|
40
44
|
case 11:
|
|
@@ -50,7 +54,7 @@ export async function dispatchBot({ botType, isMention, userAlias, userWeixin, c
|
|
|
50
54
|
case 12:
|
|
51
55
|
// coze v3 api
|
|
52
56
|
console.log('进入Coze V3聊天')
|
|
53
|
-
res = await getCozeV3AiReply({ content, file, inputs: { isMention: isMention ? '1':'0', uid, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } }, id, adminId, config)
|
|
57
|
+
res = await getCozeV3AiReply({ content, file, inputs: { userid: userId, isMention: isMention ? '1':'0', uid, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } }, id, adminId, config)
|
|
54
58
|
replys = res
|
|
55
59
|
break
|
|
56
60
|
case 13:
|
|
@@ -182,6 +182,10 @@ async function dispatchAiBot({ bot, msg, name, id, isMention, uid, uname, roomId
|
|
|
182
182
|
try {
|
|
183
183
|
let res, replys
|
|
184
184
|
const contactSelf = await getUser()
|
|
185
|
+
let userId = ''
|
|
186
|
+
if (process.env['CUSTOM_USER_ID']) {
|
|
187
|
+
userId = process.env['CUSTOM_USER_ID']
|
|
188
|
+
}
|
|
185
189
|
switch (bot) {
|
|
186
190
|
case 0:
|
|
187
191
|
if (file) {
|
|
@@ -207,12 +211,12 @@ async function dispatchAiBot({ bot, msg, name, id, isMention, uid, uname, roomId
|
|
|
207
211
|
break
|
|
208
212
|
case 8:
|
|
209
213
|
// dify ai
|
|
210
|
-
res = await getDifyReply({ content: msg, file, id, inputs: { isMention: isMention ? 1:0, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, uid, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } })
|
|
214
|
+
res = await getDifyReply({ content: msg, file, id, inputs: { useid: userId, isMention: isMention ? 1:0, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, uid, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } })
|
|
211
215
|
replys = res
|
|
212
216
|
break
|
|
213
217
|
case 9:
|
|
214
218
|
// fast gpt
|
|
215
|
-
res = await getFastGPTReply({ content: msg, file }, id, { isMention: isMention ? 1:0, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, uid, uname, ualias: userAlias, uweixin: userWeixin, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name })
|
|
219
|
+
res = await getFastGPTReply({ content: msg, file }, id, { useid: userId, isMention: isMention ? 1:0, fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, uid, uname, ualias: userAlias, uweixin: userWeixin, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name })
|
|
216
220
|
replys = res
|
|
217
221
|
break
|
|
218
222
|
case 11:
|
|
@@ -226,7 +230,7 @@ async function dispatchAiBot({ bot, msg, name, id, isMention, uid, uname, roomId
|
|
|
226
230
|
break
|
|
227
231
|
case 12:
|
|
228
232
|
// coze v3
|
|
229
|
-
res = await getCozeV3Reply({ content: msg, file, id, inputs: { isMention: isMention ? '1':'0', fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, uid, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } })
|
|
233
|
+
res = await getCozeV3Reply({ content: msg, file, id, inputs: { useid: userId, isMention: isMention ? '1':'0', fileUrl: file?.fileUrl, fileExtname: file?.fileExtname, uid, ualias: userAlias, uweixin: userWeixin, uname, roomId, roomName, robotId: contactSelf.robotId, robotName: contactSelf.name } })
|
|
230
234
|
replys = res
|
|
231
235
|
break
|
|
232
236
|
case 13:
|