mirror of https://github.com/buster-so/buster.git
Update useChatStreamMessage.ts
This commit is contained in:
parent
5b38037419
commit
d7430f1594
|
@ -219,15 +219,18 @@ export const useChatStreamMessage = () => {
|
||||||
reasoning.message_chunk !== null || reasoning.message_chunk !== undefined;
|
reasoning.message_chunk !== null || reasoning.message_chunk !== undefined;
|
||||||
|
|
||||||
initializeOrUpdateMessage(chat_id, message_id, (draft) => {
|
initializeOrUpdateMessage(chat_id, message_id, (draft) => {
|
||||||
if (!draft[chat_id]?.messages?.[message_id]?.reasoning_messages?.[reasoningMessageId])
|
const reasoningMessage =
|
||||||
return;
|
draft[chat_id]?.messages?.[message_id]?.reasoning_messages?.[reasoningMessageId];
|
||||||
const messageText = draft[chat_id].messages[message_id].reasoning_messages[
|
if (!reasoningMessage) return;
|
||||||
reasoningMessageId
|
const messageText = reasoningMessage as BusterChatMessageReasoning_text;
|
||||||
] as BusterChatMessageReasoning_text;
|
|
||||||
Object.assign(messageText, existingReasoningMessageText);
|
Object.assign(messageText, {
|
||||||
messageText.message = isStreaming
|
...existingReasoningMessageText,
|
||||||
? (existingReasoningMessageText?.message || '') + (reasoning.message_chunk || '')
|
...reasoning,
|
||||||
: reasoning.message;
|
message: isStreaming
|
||||||
|
? (existingReasoningMessageText?.message || '') + (reasoning.message_chunk || '')
|
||||||
|
: reasoning.message
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue