mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
feat: 支持GeminiPro模型
This commit is contained in:
parent
ac0aa7d02d
commit
220525fbbd
11 changed files with 415 additions and 218 deletions
|
|
@ -126,6 +126,11 @@ export class ChatgptManagement extends plugin {
|
|||
fnc: 'useClaudeAISolution',
|
||||
permission: 'master'
|
||||
},
|
||||
{
|
||||
reg: '^#chatgpt切换(Gemini|gemini)$',
|
||||
fnc: 'useGeminiSolution',
|
||||
permission: 'master'
|
||||
},
|
||||
{
|
||||
reg: '^#chatgpt切换星火$',
|
||||
fnc: 'useXinghuoBasedSolution',
|
||||
|
|
@ -184,6 +189,11 @@ export class ChatgptManagement extends plugin {
|
|||
fnc: 'setAPIKey',
|
||||
permission: 'master'
|
||||
},
|
||||
{
|
||||
reg: '^#chatgpt设置(Gemini|gemini)(Key|key)$',
|
||||
fnc: 'setGeminiKey',
|
||||
permission: 'master'
|
||||
},
|
||||
{
|
||||
reg: '^#chatgpt设置(API|api)设定$',
|
||||
fnc: 'setAPIPromptPrefix',
|
||||
|
|
@ -902,6 +912,16 @@ azure语音:Azure 语音是微软 Azure 平台提供的一项语音服务,
|
|||
}
|
||||
}
|
||||
|
||||
async useGeminiSolution () {
|
||||
let use = await redis.get('CHATGPT:USE')
|
||||
if (use !== 'gemini') {
|
||||
await redis.set('CHATGPT:USE', 'gemini')
|
||||
await this.reply('已切换到基于Google Gemini的解决方案')
|
||||
} else {
|
||||
await this.reply('当前已经是gemini模式了')
|
||||
}
|
||||
}
|
||||
|
||||
async useXinghuoBasedSolution () {
|
||||
let use = await redis.get('CHATGPT:USE')
|
||||
if (use !== 'xh') {
|
||||
|
|
@ -1148,6 +1168,21 @@ azure语音:Azure 语音是微软 Azure 平台提供的一项语音服务,
|
|||
this.finish('saveAPIKey')
|
||||
}
|
||||
|
||||
async setGeminiKey (e) {
|
||||
this.setContext('saveGeminiKey')
|
||||
await this.reply('请发送Gemini API Key.获取地址:https://makersuite.google.com/app/apikey', true)
|
||||
return false
|
||||
}
|
||||
|
||||
async saveGeminiKey () {
|
||||
if (!this.e.msg) return
|
||||
let token = this.e.msg
|
||||
// todo
|
||||
Config.geminiKey = token
|
||||
await this.reply('请发送Gemini API Key设置成功', true)
|
||||
this.finish('saveGeminiKey')
|
||||
}
|
||||
|
||||
async setXinghuoToken () {
|
||||
this.setContext('saveXinghuoToken')
|
||||
await this.reply('请发送星火的ssoSessionId', true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue