chore: rolled back to clear the impact

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

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,
})