修复了精准/平衡/创意模式下,给bing添加拓展资料后无法正常回复的问题 (#343)

This commit is contained in:
ifeif 2023-04-12 23:10:42 +08:00 committed by GitHub
parent 8bdbd623b3
commit 98d414935e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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') {