From 13c4fae629c0badfe58bd265c79a6dcff3876fe5 Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Wed, 15 Mar 2023 11:22:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20API3=E6=94=AF=E6=8C=81plus=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=9A=84GPT-4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- guoba.support.js | 6 ++++++ utils/config.js | 1 + utils/message.js | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/guoba.support.js b/guoba.support.js index 4e016fe..d8fe68c 100644 --- a/guoba.support.js +++ b/guoba.support.js @@ -313,6 +313,12 @@ export function supportGuoba () { bottomHelpMessage: '即使配置了proxy,依然使用ChatGPT反代', component: 'Switch' }, + { + field: 'useGPT4', + label: '使用GPT-4', + bottomHelpMessage: '使用GPT-4,注意试用配额较低,如果用不了就关掉', + component: 'Switch' + }, { label: '以下为浏览器方式的配置.(Deprecated)', component: 'Divider' diff --git a/utils/config.js b/utils/config.js index 9696ad7..b585371 100644 --- a/utils/config.js +++ b/utils/config.js @@ -37,6 +37,7 @@ const defaultConfig = { apiBaseUrl: 'https://pimon.d201.cn/backend-api', apiForceUseReverse: false, plus: false, + useGPT4: false, promptPrefixOverride: 'Your answer shouldn\'t be too verbose. Prefer to answer in Chinese.', assistantLabel: 'ChatGPT', thinkingTips: true, diff --git a/utils/message.js b/utils/message.js index 2435d18..31fd59d 100644 --- a/utils/message.js +++ b/utils/message.js @@ -65,7 +65,7 @@ export class OfficialChatGPTClient { } } ], - model: Config.plus ? 'text-davinci-002-render-sha' : 'text-davinci-002-render-sha', + model: Config.useGPT4 ? 'gpt-4' : 'text-davinci-002-render-sha', parent_message_id: parentMessageId } if (conversationId) {