fix: adjustment for sydney

This commit is contained in:
ikechan8370 2023-03-24 15:53:08 +08:00
parent afd0650d04
commit e39391c176

View file

@ -8,7 +8,7 @@ import crypto from 'crypto'
import HttpsProxyAgent from 'https-proxy-agent' import HttpsProxyAgent from 'https-proxy-agent'
import { Config, pureSydneyInstruction } from './config.js' import { Config, pureSydneyInstruction } from './config.js'
import { isCN } from './common.js' import { isCN } from './common.js'
import delay from "delay"; import delay from 'delay'
if (!globalThis.fetch) { if (!globalThis.fetch) {
globalThis.fetch = fetch globalThis.fetch = fetch
@ -113,9 +113,9 @@ export default class SydneyAIClient {
logger.mark('使用host' + this.opts.host) logger.mark('使用host' + this.opts.host)
let response = await fetch(`${this.opts.host}/turing/conversation/create`, fetchOptions) let response = await fetch(`${this.opts.host}/turing/conversation/create`, fetchOptions)
let text = await response.text() let text = await response.text()
let retry = 6 let retry = 10
while (retry >= 0 && response.status === 200 && !text) { while (retry >= 0 && response.status === 200 && !text) {
await delay(300) await delay(500)
response = await fetch(`${this.opts.host}/turing/conversation/create`, fetchOptions) response = await fetch(`${this.opts.host}/turing/conversation/create`, fetchOptions)
text = await response.text() text = await response.text()
retry-- retry--
@ -348,11 +348,20 @@ export default class SydneyAIClient {
'disable_emoji_spoken_text', 'disable_emoji_spoken_text',
'responsible_ai_policy_235', 'responsible_ai_policy_235',
'enablemm', 'enablemm',
toneOption, // 'h3precise',
'dtappid', 'clgalileo',
'cricinfo', 'dlcodex3k',
'cricinfov2', 'dltokens18k',
'dv3sugg' 'enablesd',
'bfprss',
'cachewriteext',
'deepleofreq',
'e2ecachewrite',
'saharafreq',
'wlthrottle',
'dl_edge_desc',
'dv3sugg',
toneOption
], ],
sliceIds: [ sliceIds: [
'222dtappid', '222dtappid',