wechaty-web-panel 1.6.97 → 1.6.99

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.
@@ -29,6 +29,7 @@ class FastGPTAPI {
29
29
  },
30
30
  ],
31
31
  stream: false,
32
+ customUid: `${variables?.uname || ''}${variables?.ualias ? `(${variables?.ualias})` : ''}`,
32
33
  detail: false,
33
34
  };
34
35
  if (file && file.fileType === '图片') {
@@ -123,11 +123,6 @@ class OfficialOpenAi {
123
123
  return [{ type: 1, content: '上下文已重置' }];
124
124
  }
125
125
  }
126
- if (isFastGPT && !this.chatOption[uid]) {
127
- this.chatOption[uid] = {
128
- chatId: (0, uuid_1.v4)()
129
- };
130
- }
131
126
  const sendParams = { ...this.chatOption[uid], timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000 };
132
127
  if (systemMessage) {
133
128
  sendParams.systemMessage = systemMessage;
@@ -6,7 +6,7 @@ exports.packageJson = void 0;
6
6
  */
7
7
  exports.packageJson = {
8
8
  "name": "wechaty-web-panel",
9
- "version": "1.6.97",
9
+ "version": "1.6.99",
10
10
  "exports": {
11
11
  ".": {
12
12
  "import": "./dist/esm/src/index.js",
@@ -4,7 +4,7 @@ export function getChatGPTReply({ content, variables, file }: {
4
4
  content: any;
5
5
  variables: any;
6
6
  file: any;
7
- }, uid: any, adminId: any, config: {
7
+ }, uid: any, adminId: any, config?: {
8
8
  token: string;
9
9
  debug: boolean;
10
10
  proxyPass: string;
@@ -14,5 +14,5 @@ export function getChatGPTReply({ content, variables, file }: {
14
14
  model: string;
15
15
  systemMessage: string;
16
16
  keywordSystemMessages: never[];
17
- } | undefined, isFastGPT: any): Promise<any>;
17
+ }): Promise<any>;
18
18
  //# sourceMappingURL=chatgpt.d.ts.map
@@ -23,7 +23,7 @@ function resetAll() {
23
23
  });
24
24
  chatGPT = {};
25
25
  }
26
- async function getChatGPTReply({ content, variables, file }, uid, adminId, config = { token: "", debug: false, proxyPass: "", proxyUrl: "", showQuestion: false, timeoutMs: 80, model: "", systemMessage: "", keywordSystemMessages: [] }, isFastGPT) {
26
+ async function getChatGPTReply({ content, variables, file }, uid, adminId, config = { token: "", debug: false, proxyPass: "", proxyUrl: "", showQuestion: false, timeoutMs: 80, model: "", systemMessage: "", keywordSystemMessages: [] }) {
27
27
  if (!config.token) {
28
28
  console.log('请到智能微秘书平台配置Openai apikey参数方可使用');
29
29
  return [{ type: 1, content: '请到平台配置Openai apikey参数方可使用' }];
@@ -280,7 +280,7 @@ async function dispatchSummerBot({ content, id, uid, uname, roomId, roomName, us
280
280
  break;
281
281
  case 11:
282
282
  // coze
283
- res = await (0, cozeAi_js_1.getCozeSimpleReply)({ content, uid: id, config, isFastGPT: true });
283
+ res = await (0, cozeAi_js_1.getCozeSimpleReply)({ content, uid: id, config });
284
284
  replys = res;
285
285
  break;
286
286
  case 12:
@@ -23,6 +23,7 @@ export class FastGPTAPI {
23
23
  },
24
24
  ],
25
25
  stream: false,
26
+ customUid: `${variables?.uname || ''}${variables?.ualias ? `(${variables?.ualias})` : ''}`,
26
27
  detail: false,
27
28
  };
28
29
  if (file && file.fileType === '图片') {
@@ -118,11 +118,6 @@ class OfficialOpenAi {
118
118
  return [{ type: 1, content: '上下文已重置' }];
119
119
  }
120
120
  }
121
- if (isFastGPT && !this.chatOption[uid]) {
122
- this.chatOption[uid] = {
123
- chatId: uuidv4()
124
- };
125
- }
126
121
  const sendParams = { ...this.chatOption[uid], timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000 };
127
122
  if (systemMessage) {
128
123
  sendParams.systemMessage = systemMessage;
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const packageJson = {
5
5
  "name": "wechaty-web-panel",
6
- "version": "1.6.97",
6
+ "version": "1.6.99",
7
7
  "exports": {
8
8
  ".": {
9
9
  "import": "./dist/esm/src/index.js",
@@ -4,7 +4,7 @@ export function getChatGPTReply({ content, variables, file }: {
4
4
  content: any;
5
5
  variables: any;
6
6
  file: any;
7
- }, uid: any, adminId: any, config: {
7
+ }, uid: any, adminId: any, config?: {
8
8
  token: string;
9
9
  debug: boolean;
10
10
  proxyPass: string;
@@ -14,5 +14,5 @@ export function getChatGPTReply({ content, variables, file }: {
14
14
  model: string;
15
15
  systemMessage: string;
16
16
  keywordSystemMessages: never[];
17
- } | undefined, isFastGPT: any): Promise<any>;
17
+ }): Promise<any>;
18
18
  //# sourceMappingURL=chatgpt.d.ts.map
@@ -15,7 +15,7 @@ export function resetAll() {
15
15
  });
16
16
  chatGPT = {};
17
17
  }
18
- export async function getChatGPTReply({ content, variables, file }, uid, adminId, config = { token: "", debug: false, proxyPass: "", proxyUrl: "", showQuestion: false, timeoutMs: 80, model: "", systemMessage: "", keywordSystemMessages: [] }, isFastGPT) {
18
+ export async function getChatGPTReply({ content, variables, file }, uid, adminId, config = { token: "", debug: false, proxyPass: "", proxyUrl: "", showQuestion: false, timeoutMs: 80, model: "", systemMessage: "", keywordSystemMessages: [] }) {
19
19
  if (!config.token) {
20
20
  console.log('请到智能微秘书平台配置Openai apikey参数方可使用');
21
21
  return [{ type: 1, content: '请到平台配置Openai apikey参数方可使用' }];
@@ -275,7 +275,7 @@ async function dispatchSummerBot({ content, id, uid, uname, roomId, roomName, us
275
275
  break;
276
276
  case 11:
277
277
  // coze
278
- res = await getCozeSimpleReply({ content, uid: id, config, isFastGPT: true });
278
+ res = await getCozeSimpleReply({ content, uid: id, config });
279
279
  replys = res;
280
280
  break;
281
281
  case 12:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wechaty-web-panel",
3
- "version": "1.6.97",
3
+ "version": "1.6.99",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./dist/esm/src/index.js",
@@ -26,6 +26,7 @@ export class FastGPTAPI {
26
26
  },
27
27
  ],
28
28
  stream: false,
29
+ customUid: `${variables?.uname||''}${variables?.ualias ? `(${variables?.ualias})`:''}`,
29
30
  detail: false,
30
31
  }
31
32
  if (file && file.fileType === '图片') {
@@ -126,12 +126,6 @@ class OfficialOpenAi {
126
126
  }
127
127
  }
128
128
 
129
- if(isFastGPT && !this.chatOption[uid]) {
130
- this.chatOption[uid] = {
131
- chatId: uuidv4()
132
- }
133
- }
134
-
135
129
 
136
130
  const sendParams = { ...this.chatOption[uid], timeoutMs: this.config.timeoutMs * 1000 || 80 * 1000 }
137
131
  if(systemMessage) {
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const packageJson = {
5
5
  "name": "wechaty-web-panel",
6
- "version": "1.6.97",
6
+ "version": "1.6.99",
7
7
  "exports": {
8
8
  ".": {
9
9
  "import": "./dist/esm/src/index.js",
@@ -17,7 +17,7 @@ export function resetAll() {
17
17
  })
18
18
  chatGPT = {}
19
19
  }
20
- export async function getChatGPTReply({ content, variables, file }, uid, adminId, config = { token: "", debug: false, proxyPass: "", proxyUrl: "", showQuestion: false, timeoutMs: 80, model: "", systemMessage: "", keywordSystemMessages: [] }, isFastGPT) {
20
+ export async function getChatGPTReply({ content, variables, file }, uid, adminId, config = { token: "", debug: false, proxyPass: "", proxyUrl: "", showQuestion: false, timeoutMs: 80, model: "", systemMessage: "", keywordSystemMessages: [] }) {
21
21
  if (!config.token) {
22
22
  console.log('请到智能微秘书平台配置Openai apikey参数方可使用')
23
23
  return [{ type: 1, content: '请到平台配置Openai apikey参数方可使用' }]
@@ -271,7 +271,7 @@ async function dispatchSummerBot({ content, id, uid, uname, roomId, roomName, us
271
271
  break
272
272
  case 11:
273
273
  // coze
274
- res = await getCozeSimpleReply({ content, uid: id, config, isFastGPT: true })
274
+ res = await getCozeSimpleReply({ content, uid: id, config })
275
275
  replys = res
276
276
  break
277
277
  case 12: