Skip to content

Commit

Permalink
[Fix] Blank between generating message and assistant (#619)
Browse files Browse the repository at this point in the history
Co-authored-by: Ian Seabock (Centific Technologies Inc) <[email protected]>
  • Loading branch information
iseabock and Ian Seabock (Centific Technologies Inc) committed Feb 15, 2024
1 parent 5f0192b commit 8c4ab56
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 34 deletions.
8 changes: 6 additions & 2 deletions frontend/src/pages/chat/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ const Chat = () => {
msg.id = result.id;
msg.date = new Date().toISOString();
})
setShowLoadingMessage(false);
if (result.choices[0].messages?.some(m => m.role === ASSISTANT)) {
setShowLoadingMessage(false);
}
result.choices[0].messages.forEach((resultObj) => {
processResultMessage(resultObj, userMessage, conversationId);
})
Expand Down Expand Up @@ -359,7 +361,9 @@ const Chat = () => {
msg.id = result.id;
msg.date = new Date().toISOString();
})
setShowLoadingMessage(false);
if (result.choices[0].messages?.some(m => m.role === ASSISTANT)) {
setShowLoadingMessage(false);
}
result.choices[0].messages.forEach((resultObj) => {
processResultMessage(resultObj, userMessage, conversationId);
})
Expand Down
Loading

0 comments on commit 8c4ab56

Please sign in to comment.