增加给嵌入父窗口发送外链聊天开始消息,改善父窗口对聊天过程的协同响应能力 (#1252)

Signed-off-by: Ben Gao <bengao168@msn.com>
This commit is contained in:
gaord
2024-04-25 22:41:42 +08:00
committed by GitHub
parent 0a8b104bd7
commit c608f86146

View File

@@ -84,6 +84,17 @@ const OutLink = ({
const prompts = messages.slice(-2);
const completionChatId = chatId ? chatId : nanoid();
//post message to report chat start
window.top?.postMessage(
{
type: 'shareChatStart',
data: {
question: prompts[0]?.content
}
},
'*'
);
const { responseText, responseData } = await streamFetch({
data: {
messages: prompts,