|
|
|
|
|
|
|
|
import { Cog8ToothIcon, InformationCircleIcon, ChevronDownIcon } from '@heroicons/react/24/outline' |
|
|
import { Cog8ToothIcon, InformationCircleIcon, ChevronDownIcon } from '@heroicons/react/24/outline' |
|
|
import { AppType } from '@/types/app' |
|
|
import { AppType } from '@/types/app' |
|
|
import { TONE_LIST } from '@/config' |
|
|
import { TONE_LIST } from '@/config' |
|
|
|
|
|
import Toast from '@/app/components/base/toast' |
|
|
|
|
|
|
|
|
export type IConifgModelProps = { |
|
|
export type IConifgModelProps = { |
|
|
mode: string |
|
|
mode: string |
|
|
|
|
|
|
|
|
key: 'max_tokens', |
|
|
key: 'max_tokens', |
|
|
tip: t('common.model.params.maxTokenTip'), |
|
|
tip: t('common.model.params.maxTokenTip'), |
|
|
step: 100, |
|
|
step: 100, |
|
|
max: 4000, |
|
|
|
|
|
|
|
|
max: modelId === 'gpt-4' ? 8000 : 4000, |
|
|
}, |
|
|
}, |
|
|
] |
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onShowUseGPT4Confirm() |
|
|
onShowUseGPT4Confirm() |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
if(id !== 'gpt-4' && completionParams.max_tokens > 4000) { |
|
|
|
|
|
Toast.notify({ |
|
|
|
|
|
type: 'warning', |
|
|
|
|
|
message: t('common.model.params.setToCurrentModelMaxTokenTip') |
|
|
|
|
|
}) |
|
|
|
|
|
onCompletionParamsChange({ |
|
|
|
|
|
...completionParams, |
|
|
|
|
|
max_tokens: 4000 |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
setModelId(id) |
|
|
setModelId(id) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |