Unverified Commit 74575506 authored by Joel's avatar Joel Committed by GitHub

feat: frontend remove gpt4 check (#815)

parent c13a90ee
...@@ -34,20 +34,15 @@ export type IConfigModelProps = { ...@@ -34,20 +34,15 @@ export type IConfigModelProps = {
completionParams: CompletionParams completionParams: CompletionParams
onCompletionParamsChange: (newParams: CompletionParams) => void onCompletionParamsChange: (newParams: CompletionParams) => void
disabled: boolean disabled: boolean
canUseGPT4: boolean
onShowUseGPT4Confirm: () => void
} }
const ConfigModel: FC<IConfigModelProps> = ({ const ConfigModel: FC<IConfigModelProps> = ({
// mode,
modelId, modelId,
provider, provider,
setModelId, setModelId,
completionParams, completionParams,
onCompletionParamsChange, onCompletionParamsChange,
disabled, disabled,
canUseGPT4,
onShowUseGPT4Confirm,
}) => { }) => {
const { t } = useTranslation() const { t } = useTranslation()
const { textGenerationModelList } = useProviderContext() const { textGenerationModelList } = useProviderContext()
...@@ -122,11 +117,6 @@ const ConfigModel: FC<IConfigModelProps> = ({ ...@@ -122,11 +117,6 @@ const ConfigModel: FC<IConfigModelProps> = ({
const handleSelectModel = (id: string, nextProvider = ProviderEnum.openai) => { const handleSelectModel = (id: string, nextProvider = ProviderEnum.openai) => {
return async () => { return async () => {
if (id === 'gpt-4' && !canUseGPT4) {
hideConfig()
onShowUseGPT4Confirm()
return
}
const prevParamsRule = getAllParams()[provider]?.[modelId] const prevParamsRule = getAllParams()[provider]?.[modelId]
setModelId(id, nextProvider) setModelId(id, nextProvider)
......
...@@ -292,10 +292,6 @@ const Configuration: FC = () => { ...@@ -292,10 +292,6 @@ const Configuration: FC = () => {
setCompletionParams(newParams) setCompletionParams(newParams)
}} }}
disabled={!hasSetAPIKEY} disabled={!hasSetAPIKEY}
canUseGPT4={hasSetCustomAPIKEY}
onShowUseGPT4Confirm={() => {
setShowUseGPT4Confirm(true)
}}
/> />
<div className='mx-3 w-[1px] h-[14px] bg-gray-200'></div> <div className='mx-3 w-[1px] h-[14px] bg-gray-200'></div>
<Button onClick={() => setShowConfirm(true)} className='shrink-0 mr-2 w-[70px] !h-8 !text-[13px] font-medium'>{t('appDebug.operation.resetConfig')}</Button> <Button onClick={() => setShowConfirm(true)} className='shrink-0 mr-2 w-[70px] !h-8 !text-[13px] font-medium'>{t('appDebug.operation.resetConfig')}</Button>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment