doomiaichat 7.1.22 → 7.1.24
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 +4 -3
- package/package.json +1 -1
- package/src/corzbot.ts +4 -3
package/dist/corzbot.js
CHANGED
|
@@ -326,7 +326,7 @@ class CorzBot extends gptbase_1.default {
|
|
|
326
326
|
(this.workflowid ? client.workflows.runs.stream(params) :
|
|
327
327
|
client.workflows.chat.stream(params));
|
|
328
328
|
let deltaindex = 0, fullanswer = [], cardfollowup = [], followup = [], cardData = [];
|
|
329
|
-
let deepThinking = '', thinkingStatus = DeepThinkingStatus.None, cardResource =
|
|
329
|
+
let deepThinking = '', thinkingStatus = DeepThinkingStatus.None, cardResource = '', preresponseText = ''; // 是否在深度思考中
|
|
330
330
|
try {
|
|
331
331
|
for (var _g = true, stream_1 = __asyncValues(stream), stream_1_1; stream_1_1 = yield stream_1.next(), _a = stream_1_1.done, !_a;) {
|
|
332
332
|
_c = stream_1_1.value;
|
|
@@ -357,10 +357,11 @@ class CorzBot extends gptbase_1.default {
|
|
|
357
357
|
if (thinking) {
|
|
358
358
|
deepThinking = result.content;
|
|
359
359
|
if (thinking.action === DeepThinkingAction.card) {
|
|
360
|
-
cardResource
|
|
360
|
+
cardResource += result.thinking.text;
|
|
361
361
|
// 卡片流结束,解析卡片资源数据
|
|
362
362
|
if (result.thinking.completed) {
|
|
363
|
-
const allCards = cardResource.
|
|
363
|
+
const allCards = cardResource.replace(/[\x00-\x1F\x7F]/g, '').split('|');
|
|
364
|
+
cardResource = '';
|
|
364
365
|
for (const item of allCards) {
|
|
365
366
|
const cardinfo = (0, querystring_1.parse)(item);
|
|
366
367
|
if (cardinfo.type && cardinfo.tag) {
|
package/package.json
CHANGED
package/src/corzbot.ts
CHANGED
|
@@ -301,7 +301,7 @@ export default class CorzBot extends GptBase {
|
|
|
301
301
|
(this.workflowid ? client.workflows.runs.stream(params as RunWorkflowReq) :
|
|
302
302
|
client.workflows.chat.stream(params as ChatWorkflowReq));
|
|
303
303
|
let deltaindex = 0, fullanswer: string[] = [],cardfollowup: string[] = [], followup: string[] = [], cardData: CardType[] = [];
|
|
304
|
-
let deepThinking = '', thinkingStatus = DeepThinkingStatus.None, cardResource
|
|
304
|
+
let deepThinking = '', thinkingStatus = DeepThinkingStatus.None, cardResource = '', preresponseText=''; // 是否在深度思考中
|
|
305
305
|
for await (const part of stream) {
|
|
306
306
|
if (part.event === ChatEventType.ERROR) return this.emit('chaterror', { successed: false, error: 'call failed' });
|
|
307
307
|
if (part.event === ChatEventType.CONVERSATION_MESSAGE_DELTA ||
|
|
@@ -326,10 +326,11 @@ export default class CorzBot extends GptBase {
|
|
|
326
326
|
if (thinking) {
|
|
327
327
|
deepThinking = result.content;
|
|
328
328
|
if (thinking.action === DeepThinkingAction.card) {
|
|
329
|
-
cardResource
|
|
329
|
+
cardResource += result.thinking.text;
|
|
330
330
|
// 卡片流结束,解析卡片资源数据
|
|
331
331
|
if (result.thinking.completed) {
|
|
332
|
-
const allCards = cardResource.
|
|
332
|
+
const allCards = cardResource.replace(/[\x00-\x1F\x7F]/g, '').split('|')
|
|
333
|
+
cardResource='';
|
|
333
334
|
for (const item of allCards) {
|
|
334
335
|
const cardinfo: any = parse(item);
|
|
335
336
|
if (cardinfo.type && cardinfo.tag) {
|