提交 3060f957 编写于 作者: DCloud_JSON's avatar DCloud_JSON

1.0.7 修复 uni-ai默认服务商,流式响应模式,部分情况下:AI回复的内容包含的代码 没有以代码风格显示的问题

上级 29a6112f
## 1.0.7(2023-05-15)
- 修复 uni-ai默认服务商,流式响应模式,部分情况下:AI回复的内容包含的代码 没有以代码风格显示的问题
## 1.0.6(2023-05-12)
- 修复 流式响应模式,AI回答内容在开头不涉及敏感,后续内容涉及敏感的场景 卡住会话的问题
## 1.0.5(2023-05-11)
......
{
"id": "uni-ai-chat",
"name": "uni-ai-chat",
"version": "1.0.6",
"version": "1.0.7",
"description": "基于uni-ai的聊天示例项目,支持流式、支持前文总结,云端一体",
"main": "main.js",
"scripts": {
......
......@@ -248,7 +248,7 @@ module.exports = {
// 如果存在sseChannel
if (sseChannel) {
let reply = ""
let reply = ""
return new Promise((resolve, reject) => {
// 反序列化sseChannel
const channel = uniCloud.deserializeSSEChannel(sseChannel)
......@@ -263,8 +263,11 @@ module.exports = {
}else{
// 按行返回
res.on('line', async (line) => {
await channel.write(reply? ("\n\n " + line) : line)
if(reply.length){
line = " \n\n " + line
}
reply += line
await channel.write(line)
// console.log('---line----', line)
})
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册