doomiaichat 7.1.19 → 7.1.21
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 +8 -6
- package/package.json +3 -3
- package/src/corzbot.ts +7 -5
package/dist/corzbot.js
CHANGED
|
@@ -215,13 +215,11 @@ class CorzBot extends gptbase_1.default {
|
|
|
215
215
|
const response = this.botid ? yield client.chat.create(params) : yield client.workflows.runs.create(params);
|
|
216
216
|
if (this.workflowid) {
|
|
217
217
|
const workflowResp = response;
|
|
218
|
-
if (workflowResp.msg === 'Success') {
|
|
218
|
+
if (workflowResp.msg === 'Success' || (!workflowResp.msg && workflowResp.data)) {
|
|
219
219
|
const resp = workflowResp.data;
|
|
220
220
|
return { successed: true, message: [{ role: 'assistant', type: 'answer', content: resp }] };
|
|
221
221
|
}
|
|
222
|
-
|
|
223
|
-
console.error('workflow run failed', workflowResp.msg, workflowResp);
|
|
224
|
-
}
|
|
222
|
+
console.error('workflow run failed', workflowResp.msg, workflowResp);
|
|
225
223
|
// try {
|
|
226
224
|
// return { successed: true, message: [{ role: 'assistant', type: 'answer', content: JSON.parse(resp).data }] };
|
|
227
225
|
// } catch (error) {
|
|
@@ -368,8 +366,12 @@ class CorzBot extends gptbase_1.default {
|
|
|
368
366
|
if (cardinfo.type && cardinfo.tag) {
|
|
369
367
|
if (cardinfo.type === 'follow_up')
|
|
370
368
|
cardfollowup.push(cardinfo.tag);
|
|
371
|
-
else
|
|
372
|
-
|
|
369
|
+
else {
|
|
370
|
+
const tags = cardinfo.tag.split(',');
|
|
371
|
+
for (const tag of tags)
|
|
372
|
+
cardData.push({ type: cardinfo.type, tag });
|
|
373
|
+
//cardData.push({ ...cardinfo })
|
|
374
|
+
}
|
|
373
375
|
}
|
|
374
376
|
}
|
|
375
377
|
// 将卡片资源返回给客户端
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "doomiaichat",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.21",
|
|
4
4
|
"description": "Doomisoft OpenAI",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@azure/openai": "^1.0.0-beta.11",
|
|
20
|
-
"@coze/api": "^1.3.
|
|
20
|
+
"@coze/api": "^1.3.6",
|
|
21
21
|
"axios": "^1.8.4",
|
|
22
|
-
"openai": "^
|
|
22
|
+
"openai": "^5.19.1"
|
|
23
23
|
}
|
|
24
24
|
}
|
package/src/corzbot.ts
CHANGED
|
@@ -197,12 +197,11 @@ export default class CorzBot extends GptBase {
|
|
|
197
197
|
const response = this.botid ? await client.chat.create(params as CreateChatReq) : await client.workflows.runs.create(params as RunWorkflowReq);
|
|
198
198
|
if (this.workflowid) {
|
|
199
199
|
const workflowResp = response as RunWorkflowData;
|
|
200
|
-
if (workflowResp.msg === 'Success'){
|
|
200
|
+
if (workflowResp.msg === 'Success' || (!workflowResp.msg && workflowResp.data)){
|
|
201
201
|
const resp = workflowResp.data;
|
|
202
202
|
return { successed: true, message: [{ role: 'assistant', type: 'answer', content: resp }] };
|
|
203
|
-
}else{
|
|
204
|
-
console.error('workflow run failed', workflowResp.msg, workflowResp)
|
|
205
203
|
}
|
|
204
|
+
console.error('workflow run failed', workflowResp.msg, workflowResp)
|
|
206
205
|
// try {
|
|
207
206
|
// return { successed: true, message: [{ role: 'assistant', type: 'answer', content: JSON.parse(resp).data }] };
|
|
208
207
|
// } catch (error) {
|
|
@@ -336,8 +335,11 @@ export default class CorzBot extends GptBase {
|
|
|
336
335
|
if (cardinfo.type && cardinfo.tag) {
|
|
337
336
|
if (cardinfo.type === 'follow_up')
|
|
338
337
|
cardfollowup.push(cardinfo.tag);
|
|
339
|
-
else
|
|
340
|
-
|
|
338
|
+
else{
|
|
339
|
+
const tags = cardinfo.tag.split(',');
|
|
340
|
+
for (const tag of tags) cardData.push({ type: cardinfo.type, tag })
|
|
341
|
+
//cardData.push({ ...cardinfo })
|
|
342
|
+
}
|
|
341
343
|
}
|
|
342
344
|
}
|
|
343
345
|
// 将卡片资源返回给客户端
|