mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 05:47:11 +00:00
fix: 修复对原生bing造成的影响
This commit is contained in:
parent
95a4d7a69c
commit
10bbbf4f64
1 changed files with 41 additions and 39 deletions
10
apps/chat.js
10
apps/chat.js
|
|
@ -1049,6 +1049,11 @@ export class chatgpt extends plugin {
|
||||||
let errorMessage = ''
|
let errorMessage = ''
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
try {
|
||||||
|
let opt = _.cloneDeep(conversation) || {}
|
||||||
|
opt.toneStyle = Config.toneStyle
|
||||||
|
opt.context = Config.sydneyContext
|
||||||
|
if (Config.toneStyle === 'Sydney' || Config.toneStyle === 'Custom') {
|
||||||
let abtrs = await getAvailableBingToken(conversation, throttledTokens)
|
let abtrs = await getAvailableBingToken(conversation, throttledTokens)
|
||||||
bingToken = abtrs.bingToken
|
bingToken = abtrs.bingToken
|
||||||
allThrottled = abtrs.allThrottled
|
allThrottled = abtrs.allThrottled
|
||||||
|
|
@ -1057,10 +1062,6 @@ export class chatgpt extends plugin {
|
||||||
}
|
}
|
||||||
bingAIClient.opts.userToken = bingToken
|
bingAIClient.opts.userToken = bingToken
|
||||||
bingAIClient.opts.cookies = cookies
|
bingAIClient.opts.cookies = cookies
|
||||||
try {
|
|
||||||
let opt = _.cloneDeep(conversation) || {}
|
|
||||||
opt.toneStyle = Config.toneStyle
|
|
||||||
opt.context = Config.sydneyContext
|
|
||||||
opt.messageType = allThrottled ? 'Chat' : 'SearchQuery'
|
opt.messageType = allThrottled ? 'Chat' : 'SearchQuery'
|
||||||
if (Config.enableGroupContext && e.isGroup) {
|
if (Config.enableGroupContext && e.isGroup) {
|
||||||
try {
|
try {
|
||||||
|
|
@ -1095,6 +1096,7 @@ export class chatgpt extends plugin {
|
||||||
logger.warn('获取群聊聊天记录失败,本次对话不携带聊天记录', err)
|
logger.warn('获取群聊聊天记录失败,本次对话不携带聊天记录', err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
response = await bingAIClient.sendMessage(prompt, opt, (token) => {
|
response = await bingAIClient.sendMessage(prompt, opt, (token) => {
|
||||||
reply += token
|
reply += token
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue