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

1.2.7

上级 7cde6f71
## 1.2.7(2023-07-03)
- 【重要】修复 部分情况下 客户端未正确带上ai总结的内容的问题
## 1.2.6(2023-07-03)
- 修改错误的`placeholder`提示内容
## 1.2.5(2023-06-26)
......
{
"id": "uni-ai-chat",
"name": "uni-ai-chat",
"version": "1.2.6",
"version": "1.2.7",
"description": "基于uni-ai的聊天示例项目,支持流式、支持前文总结,云端一体",
"main": "main.js",
"scripts": {
......
......@@ -2,7 +2,7 @@ export default class SliceMsgToLastMsg {
constructor(arg) {
this.$ = arg
//分割显示的速度(毫秒)
this.t = 30
this.t = 70
// 要追加的消息的创建时间
this.msgCreateTime = false
// 是否立即结束追加
......
......@@ -731,21 +731,21 @@
console.log(' 拿到总结',summarize);
// 总结的内容是上一轮对话的
// console.log('setSummarize');
let index = this.msgList.length;
// 如果最后一项是ai就往前退2项,否则退项(流式响应的时候,回答可能晚于总结)
if(index%2 === 0){
let index = this.msgList.length - 1;
// 如果最后一项是ai就往前退2项,否则退1项(流式响应的时候,回答可能晚于总结)
if(index%2){
index -= 2
}else{
index -= 1
}
// 假如第一次提问就需要总结
if (index < 0) {
index = 0
if (index < 1) {
index = 1
}
let msg = this.msgList[index]
msg.summarize = summarize
this.msgList.splice(index, 1, msg)
// console.log('setSummarize this.msgList',this.msgList);
// console.log('setSummarize this.msgList',this.msgList,this.msgList.length-1,index);
}
if (illegal) {
console.error('内容涉及敏感');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册