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); }