File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -103,8 +103,11 @@ export default function handleChat(
103
103
chatId,
104
104
metrics,
105
105
} ;
106
- setLoadingResponse ( false ) ;
106
+
107
+ _chatHistory [ chatIdx - 1 ] = { ..._chatHistory [ chatIdx - 1 ] , chatId } ; // update prompt with chatID
108
+
107
109
emitAssistantMessageCompleteEvent ( chatId ) ;
110
+ setLoadingResponse ( false ) ;
108
111
} else {
109
112
updatedHistory = {
110
113
...existingHistory ,
@@ -136,15 +139,6 @@ export default function handleChat(
136
139
setChatHistory ( [ ..._chatHistory ] ) ;
137
140
} else if ( type === "agentInitWebsocketConnection" ) {
138
141
setWebsocket ( chatResult . websocketUUID ) ;
139
- } else if ( type === "finalizeResponseStream" ) {
140
- const chatIdx = _chatHistory . findIndex ( ( chat ) => chat . uuid === uuid ) ;
141
- if ( chatIdx !== - 1 ) {
142
- _chatHistory [ chatIdx - 1 ] = { ..._chatHistory [ chatIdx - 1 ] , chatId } ; // update prompt with chatID
143
- _chatHistory [ chatIdx ] = { ..._chatHistory [ chatIdx ] , chatId } ; // update response with chatID
144
- }
145
-
146
- setChatHistory ( [ ..._chatHistory ] ) ;
147
- setLoadingResponse ( false ) ;
148
142
} else if ( type === "stopGeneration" ) {
149
143
const chatIdx = _chatHistory . length - 1 ;
150
144
const existingHistory = { ..._chatHistory [ chatIdx ] } ;
You can’t perform that action at this time.
0 commit comments