fix: no support cache

This commit is contained in:
ikechan8370 2023-03-04 11:41:39 +08:00
parent 90c7c992a6
commit 5ceb9c9de3
3 changed files with 23 additions and 15 deletions

View file

@ -641,9 +641,9 @@ export class chatgpt extends plugin {
if (!bingToken) {
throw new Error('未绑定Bing Cookie请使用#chatgpt设置必应token命令绑定Bing Cookie')
}
let cookie
let cookies
if (bingToken?.indexOf('=') > -1) {
cookie = bingToken
cookies = bingToken
}
let bingAIClient
if (Config.toneStyle === 'Sydney') {
@ -653,10 +653,11 @@ export class chatgpt extends plugin {
}
bingAIClient = new SydneyAIClient({
userToken: bingToken, // "_U" cookie from bing.com
cookie,
cookies,
debug: Config.debug,
cache: cacheOptions,
user: e.sender.user_id
user: e.sender.user_id,
proxy: Config.proxy
})
// Sydney不实现上下文传递删除上下文索引
delete conversation.clientId
@ -665,8 +666,9 @@ export class chatgpt extends plugin {
} else {
bingAIClient = new BingAIClient({
userToken: bingToken, // "_U" cookie from bing.com
cookie,
debug: Config.debug
cookies,
debug: Config.debug,
proxy: Config.proxy
})
}
let response