From 82008ce58bbd9968302d421f05cfbd4e254fb6ea Mon Sep 17 00:00:00 2001 From: linju Date: Mon, 10 Jul 2023 20:09:57 +0800 Subject: [PATCH] 1.2.9 --- changelog.md | 2 ++ package.json | 2 +- pages/chat/chat.vue | 17 ++++++++++------- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/changelog.md b/changelog.md index f1f919a..22f9202 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,5 @@ +## 1.2.9(2023-07-10) +- 修复 因某次更新引起的:非流式响应模式下,未自动过滤历史消息中的涉敏内容,导致因上文涉敏而造成后续对话都涉敏的问题 [相关问题](https://ask.dcloud.net.cn/question/173701?notification_id-1286470__rf-false__item_id-246057#!answer_246057) ## 1.2.8(2023-07-07) - 优化 部分图标样式在,不同平台下,大小不一致的问题 ## 1.2.7(2023-07-03) diff --git a/package.json b/package.json index 07e9ca5..c4290dd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "id": "uni-ai-chat", "name": "uni-ai-chat", - "version": "1.2.8", + "version": "1.2.9", "description": "基于uni-ai的聊天示例项目,支持流式、支持前文总结,云端一体", "main": "main.js", "scripts": { diff --git a/pages/chat/chat.vue b/pages/chat/chat.vue index d7b0747..1ccebd1 100644 --- a/pages/chat/chat.vue +++ b/pages/chat/chat.vue @@ -706,6 +706,15 @@ reply = "内容涉及敏感" } // 特殊处理 - end + + // 非流式模式 && 内容涉及敏感 + if (this.enableStream == false && illegal) { + console.error('内容涉及敏感'); + this.updateLastMsg({ + // 添加消息涉敏标记 + illegal: true + }) + } // 非流式模式 或者流式模式,但列表还没有数据且已经进入异常的情况下 if (this.enableStream == false || this.sseIndex == 0 && (illegal||insufficientScore)) { @@ -747,13 +756,7 @@ this.msgList.splice(index, 1, msg) // console.log('setSummarize this.msgList',this.msgList,this.msgList.length-1,index); } - if (illegal) { - console.error('内容涉及敏感'); - this.updateLastMsg({ - // 添加消息涉敏标记 - illegal: true - }) - } + }, complete:e=>{ if (this.enableStream) { -- GitLab