mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
Merge branch 'v2' of github.com:ikechan8370/chatgpt-plugin into v2
This commit is contained in:
commit
3abfcc5d71
44 changed files with 216 additions and 175 deletions
|
|
@ -101,12 +101,12 @@ export default class SydneyAIClient {
|
|||
this.opts.host = 'https://edgeservices.bing.com/edgesvc'
|
||||
}
|
||||
logger.mark('使用host:' + this.opts.host)
|
||||
let response = await fetch(`${this.opts.host}/turing/conversation/create?bundleVersion=1.1055.6`, fetchOptions)
|
||||
let response = await fetch(`${this.opts.host}/turing/conversation/create?bundleVersion=1.1055.10`, fetchOptions)
|
||||
let text = await response.text()
|
||||
let retry = 10
|
||||
while (retry >= 0 && response.status === 200 && !text) {
|
||||
await delay(400)
|
||||
response = await fetch(`${this.opts.host}/turing/conversation/create`, fetchOptions)
|
||||
response = await fetch(`${this.opts.host}/turing/conversation/create?bundleVersion=1.1055.10`, fetchOptions)
|
||||
text = await response.text()
|
||||
retry--
|
||||
}
|
||||
|
|
|
|||
|
|
@ -840,17 +840,17 @@ export function getMaxModelTokens (model = 'gpt-3.5-turbo') {
|
|||
|
||||
export function getUin (e) {
|
||||
if (e?.bot?.uin) return e.bot.uin
|
||||
if (e) {
|
||||
if (Array.isArray(e.bot.uin)) {
|
||||
if (Config.trssBotUin && e.bot.uin.indexOf(Config.trssBotUin) > -1) return Config.trssBotUin
|
||||
else return e.bot.uin[0]
|
||||
} else return e.bot.uin
|
||||
} else {
|
||||
if (Array.isArray(Bot.uin)) {
|
||||
if (Config.trssBotUin && Bot.uin.indexOf(Config.trssBotUin) > -1) return Config.trssBotUin
|
||||
else return Bot.uin[0]
|
||||
} else return Bot.uin
|
||||
}
|
||||
if (Array.isArray(Bot.uin)) {
|
||||
if (Config.trssBotUin && Bot.uin.indexOf(Config.trssBotUin) > -1) {return Config.trssBotUin}
|
||||
else {
|
||||
Bot.uin.forEach((u) => {
|
||||
if (Bot[u].self_id) {
|
||||
return Bot[u].self_id
|
||||
}
|
||||
})
|
||||
return Bot.uin[Bot.uin.length - 1]
|
||||
}
|
||||
} else return Bot.uin
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue