Skip to content

Commit

Permalink
fix(streaming): fixing issues with streamed responses
Browse files Browse the repository at this point in the history
  • Loading branch information
massi-ang authored and bigadsoleiman committed Mar 5, 2024
1 parent e3dd01a commit 4bf20ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/user-interface/react-app/src/components/chatbot/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ export function updateMessageHistoryRef(
metadata = lastMessage.metadata;
}

if (hasContent) {
if (hasContent || lastMessage.content.length > 0) {
messageHistory[messageHistory.length - 1] = {
...lastMessage,
type: ChatBotMessageType.AI,
content,
content: content ?? lastMessage.content,
metadata,
tokens: lastMessage.tokens,
};
Expand Down

0 comments on commit 4bf20ba

Please sign in to comment.