From 98d414935e406e89f287142503b7c8fe42b4c962 Mon Sep 17 00:00:00 2001 From: ifeif <36729028+ifeif@users.noreply.github.com> Date: Wed, 12 Apr 2023 23:10:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E7=B2=BE=E5=87=86/?= =?UTF-8?q?=E5=B9=B3=E8=A1=A1/=E5=88=9B=E6=84=8F=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E4=B8=8B=EF=BC=8C=E7=BB=99bing=E6=B7=BB=E5=8A=A0=E6=8B=93?= =?UTF-8?q?=E5=B1=95=E8=B5=84=E6=96=99=E5=90=8E=E6=97=A0=E6=B3=95=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E5=9B=9E=E5=A4=8D=E7=9A=84=E9=97=AE=E9=A2=98=20(#343)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/chat.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/chat.js b/apps/chat.js index 4bc7250..8b0d117 100644 --- a/apps/chat.js +++ b/apps/chat.js @@ -1110,7 +1110,11 @@ export class chatgpt extends plugin { try { let opt = _.cloneDeep(conversation) || {} opt.toneStyle = Config.toneStyle - opt.context = Config.sydneyContext + // 如果当前没有开启对话或者当前是Sydney模式、Custom模式,则本次对话携带拓展资料 + let c = await redis.get(`CHATGPT:CONVERSATIONS_BING:${e.sender.user_id}`) + if (!c || Config.toneStyle === 'Sydney' || Config.toneStyle === 'Custom') { + opt.context = Config.sydneyContext + } // 重新拿存储的token,因为可能之前有过期的被删了 let abtrs = await getAvailableBingToken(conversation, throttledTokens) if (Config.toneStyle === 'Sydney' || Config.toneStyle === 'Custom') {