feat: API3支持plus用户的GPT-4

This commit is contained in:
ikechan8370 2023-03-15 11:22:26 +08:00
parent 704b76c3e9
commit 13c4fae629
3 changed files with 8 additions and 1 deletions

View file

@ -313,6 +313,12 @@ export function supportGuoba () {
bottomHelpMessage: '即使配置了proxy依然使用ChatGPT反代', bottomHelpMessage: '即使配置了proxy依然使用ChatGPT反代',
component: 'Switch' component: 'Switch'
}, },
{
field: 'useGPT4',
label: '使用GPT-4',
bottomHelpMessage: '使用GPT-4注意试用配额较低如果用不了就关掉',
component: 'Switch'
},
{ {
label: '以下为浏览器方式的配置.(Deprecated)', label: '以下为浏览器方式的配置.(Deprecated)',
component: 'Divider' component: 'Divider'

View file

@ -37,6 +37,7 @@ const defaultConfig = {
apiBaseUrl: 'https://pimon.d201.cn/backend-api', apiBaseUrl: 'https://pimon.d201.cn/backend-api',
apiForceUseReverse: false, apiForceUseReverse: false,
plus: false, plus: false,
useGPT4: false,
promptPrefixOverride: 'Your answer shouldn\'t be too verbose. Prefer to answer in Chinese.', promptPrefixOverride: 'Your answer shouldn\'t be too verbose. Prefer to answer in Chinese.',
assistantLabel: 'ChatGPT', assistantLabel: 'ChatGPT',
thinkingTips: true, thinkingTips: true,

View file

@ -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 parent_message_id: parentMessageId
} }
if (conversationId) { if (conversationId) {