feat: geminikey load balancing

This commit is contained in:
syfantasy 2024-12-30 21:39:22 +08:00 committed by GitHub
parent 7710d45c20
commit 4cebbb5408
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -271,7 +271,7 @@ export const Config = new Proxy(config, {
if (typeof target[property] === 'string' && target[property].includes(',')) {
const keys = target[property].split(',').map(key => key.trim()).filter(Boolean)
const selectedKey = keys[Math.floor(Math.random() * keys.length)]
console.log(`[ChatGPT-Plugin] 当前使用的Gemini Key: ${selectedKey}`)
console.log(`[ChatGPT-Plugin] 当前使用的Gemini Key: ${selectedKey.slice(0, 8)}...`)
return selectedKey
}
}