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

新增 对话不希望带上“上下文”的实现逻辑注释

上级 279d4691
......@@ -519,7 +519,9 @@
let messages = []
// 复制一份,消息列表数据
let msgs = JSON.parse(JSON.stringify(this.msgList))
let msgs = JSON.parse(JSON.stringify(this.msgList))
// - 获取上下文的代码【start】-
// 带总结的消息 index
let findIndex = [...msgs].reverse().findIndex(item => item.summarize)
// console.log('findIndex', findIndex)
......@@ -535,7 +537,10 @@
msgs = msgs.splice(-10)
}
// 过滤涉敏问题
msgs = msgs.filter(msg => !msg.illegal)
msgs = msgs.filter(msg => !msg.illegal)
// - 获取上下文的代码【end】-
// 如果:不希望带上上下文;请注释掉 上方:获取上下文的代码【start】-【end】。并添加,代码: msgs = [msgs.pop()]
// 根据数据内容设置角色
messages = msgs.map(item => {
// 角色默认为用户
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册