chore: rolled back to clear the impact

This commit is contained in:
ChenZhaoYu committed 2023-03-28 13:20:55 +08:00
1 parent b579d24d19
commit 07123b70ad
2 files changed
+88 -98

No files matched your search

+2 -10
View File
@@ -29,16 +29,8 @@ router.post('/chat-process', [auth, limiter], async (req, res) => {
message: prompt,
lastContext: options,
process: (chat: ChatMessage) => {
if (firstChunk) {
res.write(`${JSON.stringify(chat)}t1h1i4s5i1s4a1s9i1l9l8y1s0plit`)
firstChunk = false
}
else {
let tmp = chat.delta
if (!(chat.delta))
tmp = ''
res.write(tmp)
}
res.write(firstChunk ? JSON.stringify(chat) : `\n${JSON.stringify(chat)}`)
firstChunk = false
},
systemMessage,
})