多轮对话优化

This commit is contained in:
Vinlic
2024-03-31 03:31:45 +08:00
parent dea2c65fb8
commit 0dcadf1e56

View File

@@ -395,10 +395,7 @@ function messagesPrepare(convId: string, messages: any[]) {
}, content);
}
return (content += `${message.role || "user"}:${message.content}\n`);
}, "")
.replace(/[\n"\\]/g, function(e) {
return "\\" + e.charCodeAt(0).toString(16) + " "
});
}, "");
const json = JSON.stringify({
chatId: convId,
messageInfo: {