1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-09-03 14:22:41 +02:00
This commit is contained in:
Arik Chakma
2025-06-05 14:42:20 +06:00
parent cfb06adc6a
commit 6a413cdaef
2 changed files with 3 additions and 1 deletions

View File

@@ -183,6 +183,7 @@ export function AIChat(props: AIChatProps) {
},
credentials: 'include',
body: JSON.stringify({
chatHistoryId: chatDetails?.chatHistoryId,
messages: messages.slice(-10),
force,
}),

View File

@@ -24,7 +24,8 @@ export async function readChatStream(
break;
}
const text = decoder.decode(value);
const textWithNewLine = decoder.decode(value);
const text = textWithNewLine.replace(/\n$/, '');
if (text.startsWith(CHAT_RESPONSE_PREFIX.message)) {
const textWithoutPrefix = text.replace(CHAT_RESPONSE_PREFIX.message, '');