mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
feat: add bymFuckList Configuration (#737)
* feat: add bymFuckList * feat: geminikey load balancing * add: console.log() * fix: whole key * fix: whole key * feat: geminikey load balancing
This commit is contained in:
parent
5692af692b
commit
1c34ecbb83
2 changed files with 31 additions and 0 deletions
|
|
@ -998,6 +998,26 @@ export function supportGuoba () {
|
||||||
label: '伪人模式骂人反击的设定词',
|
label: '伪人模式骂人反击的设定词',
|
||||||
component: 'Input'
|
component: 'Input'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'bymFuckList',
|
||||||
|
label: '伪人模式反击的触发词',
|
||||||
|
bottomHelpMessage: '请输入用于伪人模式下骂人反击的触发词,每个词组将被单独处理',
|
||||||
|
component: "GTags",
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '请输入反击触发词',
|
||||||
|
allowAdd: true,
|
||||||
|
allowDel: true,
|
||||||
|
showPrompt: true,
|
||||||
|
promptProps: {
|
||||||
|
content: '添加新的反击触发词',
|
||||||
|
okText: '添加',
|
||||||
|
rules: [
|
||||||
|
{ required: true, message: '触发词不能为空' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
valueParser: ((value) => value.split(',') || []),
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '以下为Azure chatGPT的配置',
|
label: '以下为Azure chatGPT的配置',
|
||||||
component: 'Divider'
|
component: 'Divider'
|
||||||
|
|
|
||||||
|
|
@ -266,6 +266,17 @@ config.version = defaultConfig.version
|
||||||
// config.version = latestTag
|
// config.version = latestTag
|
||||||
|
|
||||||
export const Config = new Proxy(config, {
|
export const Config = new Proxy(config, {
|
||||||
|
get(target, property) {
|
||||||
|
if (property === 'geminiKey') {
|
||||||
|
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.slice(0, 8)}...`)
|
||||||
|
return selectedKey
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return target[property]
|
||||||
|
},
|
||||||
set (target, property, value) {
|
set (target, property, value) {
|
||||||
target[property] = value
|
target[property] = value
|
||||||
const change = lodash.transform(target, function (result, value, key) {
|
const change = lodash.transform(target, function (result, value, key) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue