doomiaichat 7.1.11 → 7.1.13

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/corzbot.js CHANGED
@@ -209,12 +209,12 @@ class CorzBot extends gptbase_1.default {
209
209
  const response = this.botid ? yield client.chat.create(params) : yield client.workflows.runs.create(params);
210
210
  if (this.workflowid && response.msg === 'Success') {
211
211
  const resp = response.data;
212
- try {
213
- return { successed: true, message: [{ role: 'assistant', type: 'answer', content: JSON.parse(resp).data }] };
214
- }
215
- catch (error) {
216
- return { successed: true, message: [{ role: 'assistant', type: 'answer', content: resp }] };
217
- }
212
+ return { successed: true, message: [{ role: 'assistant', type: 'answer', content: resp }] };
213
+ // try {
214
+ // return { successed: true, message: [{ role: 'assistant', type: 'answer', content: JSON.parse(resp).data }] };
215
+ // } catch (error) {
216
+ // return { successed: true, message: [{ role: 'assistant', type: 'answer', content: resp }] };
217
+ // }
218
218
  }
219
219
  if (!this.workflowid && response.conversation_id && response.id) {
220
220
  const ccd = response;
@@ -351,7 +351,7 @@ class CorzBot extends gptbase_1.default {
351
351
  for (const item of allCards) {
352
352
  const cardinfo = (0, querystring_1.parse)(item);
353
353
  if (cardinfo.type && cardinfo.tag)
354
- cardData.push({ type: Number(cardinfo.type), tag: cardinfo.tag });
354
+ cardData.push(Object.assign({}, cardinfo));
355
355
  }
356
356
  // 将卡片资源返回给客户端
357
357
  this.emit('chatcard', cardData);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doomiaichat",
3
- "version": "7.1.11",
3
+ "version": "7.1.13",
4
4
  "description": "Doomisoft OpenAI",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/corzbot.ts CHANGED
@@ -191,11 +191,12 @@ export default class CorzBot extends GptBase {
191
191
  const response = this.botid ? await client.chat.create(params as CreateChatReq) :await client.workflows.runs.create(params as RunWorkflowReq);
192
192
  if (this.workflowid && (response as RunWorkflowData).msg === 'Success') {
193
193
  const resp = (response as RunWorkflowData).data;
194
- try {
195
- return { successed: true, message: [{ role: 'assistant', type: 'answer', content: JSON.parse(resp).data }] };
196
- } catch (error) {
197
- return { successed: true, message: [{ role: 'assistant', type: 'answer', content: resp }] };
198
- }
194
+ return { successed: true, message: [{ role: 'assistant', type: 'answer', content: resp }] };
195
+ // try {
196
+ // return { successed: true, message: [{ role: 'assistant', type: 'answer', content: JSON.parse(resp).data }] };
197
+ // } catch (error) {
198
+ // return { successed: true, message: [{ role: 'assistant', type: 'answer', content: resp }] };
199
+ // }
199
200
  }
200
201
  if (!this.workflowid && (response as CreateChatData).conversation_id && (response as CreateChatData).id) {
201
202
  const ccd = response as CreateChatData;
@@ -318,7 +319,7 @@ export default class CorzBot extends GptBase {
318
319
  const allCards = cardResource.replace(/[\x00-\x1F\x7F]/g, '').split('|')
319
320
  for (const item of allCards) {
320
321
  const cardinfo: any = parse(item);
321
- if (cardinfo.type && cardinfo.tag) cardData.push({ type: Number(cardinfo.type), tag: cardinfo.tag })
322
+ if (cardinfo.type && cardinfo.tag) cardData.push({ ...cardinfo })
322
323
  }
323
324
  // 将卡片资源返回给客户端
324
325
  this.emit('chatcard', cardData);