Skip to content

Commit

Permalink
Update index.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
serefyarar committed Jun 25, 2024
1 parent 4fb8d54 commit a77d855
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions web-app/src/components/site/indexes/AskIndexes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,23 @@ const AskIndexes: FC<AskIndexesProps> = ({ sources }) => {
return;
}

if (p.channel === "update") {
const newMessage: Message = {
id: p.data.messageId,
role: p.data.payload.role,
name: p.data.payload.name,
content: p.data.payload.content,
};
console.log(newMessage);
setStreamingMessages((prevMessages: any) => {
const updated = [...prevMessages, newMessage];
dispatch(setMessages(updated));
return updated;
});

return;
}

if (p.channel === "chunk") {
setStreamingMessages((prevMessages: any) => {
let streamingMessage = prevMessages.find(
Expand Down

0 comments on commit a77d855

Please sign in to comment.