fix: 增加claude.ai对话超时配置项

This commit is contained in:
ikechan8370 2023-09-19 09:47:48 +08:00
parent 08e92d871e
commit 77f6d2d85b
3 changed files with 9 additions and 1 deletions

View file

@ -619,6 +619,12 @@ export function supportGuoba () {
bottomHelpMessage: 'claude.ai使用的浏览器UAhttps://scrapfly.io/web-scraping-tools/http2-fingerprint或https://ja3.zone/check查看。如果用了反代就不用管',
component: 'Input'
},
{
field: 'claudeAITimeout',
label: 'claude2超时时间',
bottomHelpMessage: '等待响应的超时时间单位为秒默认为30。如果不使用反代而是使用代理可以适当调低。',
component: 'InputNumber'
},
{
label: '以下为ChatGLM方式的配置',
component: 'Divider'

View file

@ -150,7 +150,8 @@ export class ClaudeAIClient {
proxy: this.proxy,
body: JSON.stringify(body),
headers: this.rawHeaders,
disableRedirect: true
disableRedirect: true,
timeout: Config.claudeAITimeout || 30
}, 'post')
if (streamDataRes.status === 307) {
throw new Error('claude.ai目前不支持你所在的地区')

View file

@ -148,6 +148,7 @@ const defaultConfig = {
claudeAIOrganizationId: '',
claudeAISessionKey: '',
claudeAIReverseProxy: '',
claudeAITimeout: 30,
claudeAIJA3: '772,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,27-5-65281-13-35-0-51-18-16-43-10-45-11-17513-23,29-23-24,0',
claudeAIUA: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36',
version: 'v2.7.4'