diff --git a/.config/ags/services/gpt.js b/.config/ags/services/gpt.js index 5d48e67be..d0cc8ac15 100644 --- a/.config/ags/services/gpt.js +++ b/.config/ags/services/gpt.js @@ -248,8 +248,6 @@ class GPTService extends Service { this._messages.push(new GPTMessage('user', msg)); this.emit('newMsg', this._messages.length - 1); const aiResponse = new GPTMessage('assistant', 'thinking...', true, false) - this._messages.push(aiResponse); - this.emit('newMsg', this._messages.length - 1); const body = { model: CHAT_MODELS[this._modelIndex], @@ -274,6 +272,8 @@ class GPTService extends Service { base_stream: stream }), aiResponse); }); + this._messages.push(aiResponse); + this.emit('newMsg', this._messages.length - 1); if (this._cycleModels) { this._requestCount++;