fix: 优化请求超时配置

This commit is contained in:
shaw
2025-09-08 16:34:12 +08:00
parent 399e6b9d8c
commit fec80a16fa
7 changed files with 19 additions and 12 deletions

View File

@@ -273,7 +273,7 @@ async function sendGeminiRequest({
'Content-Type': 'application/json'
},
data: requestBody,
timeout: config.requestTimeout || 120000
timeout: config.requestTimeout || 600000
}
// 添加代理配置
@@ -382,7 +382,7 @@ async function getAvailableModels(accessToken, proxy, projectId, location = 'us-
headers: {
Authorization: `Bearer ${accessToken}`
},
timeout: 30000
timeout: config.requestTimeout || 600000
}
const proxyAgent = createProxyAgent(proxy)
@@ -482,7 +482,7 @@ async function countTokens({
'X-Goog-User-Project': projectId || undefined
},
data: requestBody,
timeout: 30000
timeout: config.requestTimeout || 600000
}
// 添加代理配置