From bdf03ef978b49e4c6e070ed02b703c3edc901bb9 Mon Sep 17 00:00:00 2001 From: Han Xiao Date: Wed, 12 Feb 2025 09:36:22 +0800 Subject: [PATCH] fix: streaming msg --- src/app.ts | 2 +- src/utils/action-tracker.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app.ts b/src/app.ts index c389672..333cc06 100644 --- a/src/app.ts +++ b/src/app.ts @@ -51,7 +51,7 @@ ${i + 1}. [${ref.exactQuote}](${ref.url})`).join('')} `.trim(); } - return `${answer.answer.replace(/\(REF_(\d+)\)/g, (_, num) => `[^${num}]`)}\n${refStr}`; + return `${answer.answer.replace(/\(REF_(\d+)\)/g, (_, num) => `[^${num}]`)}\n\n${refStr}`; } diff --git a/src/utils/action-tracker.ts b/src/utils/action-tracker.ts index b2643db..e807855 100644 --- a/src/utils/action-tracker.ts +++ b/src/utils/action-tracker.ts @@ -22,8 +22,8 @@ export class ActionTracker extends EventEmitter { } trackThink(think: string) { - // update the think field of the current step - this.trackAction({thisStep: {...this.state.thisStep, think}}); + // only update the think field of the current state + this.state = { ...this.state, thisStep: { ...this.state.thisStep, think } }; this.emit('action', this.state); }