fix(trigger): appmode type

This commit is contained in:
yessenia
2025-10-30 17:57:05 +08:00
parent 3f34f38635
commit bc95678c5e
4 changed files with 7 additions and 7 deletions

View File

@ -10,7 +10,7 @@ import { fetchPromptTemplate } from '@/service/debug'
import type { FormValue } from '@/app/components/header/account-setting/model-provider-page/declarations'
type Param = {
appMode: AppModeEnum
appMode?: AppModeEnum
modelModeType: ModelModeType
modelName: string
promptMode: PromptMode
@ -104,6 +104,9 @@ const useAdvancedPromptConfig = ({
const migrateToDefaultPrompt = async (isMigrateToCompetition?: boolean, toModelModeType?: ModelModeType) => {
const mode = modelModeType
const toReplacePrePrompt = prePrompt || ''
if (!appMode)
return
if (!isAdvancedPrompt) {
const { chat_prompt_config, completion_prompt_config, stop } = await fetchPromptTemplate({
appMode,
@ -122,7 +125,6 @@ const useAdvancedPromptConfig = ({
})
setChatPromptConfig(newPromptConfig)
}
else {
const newPromptConfig = produce(completion_prompt_config, (draft) => {
draft.prompt.text = draft.prompt.text.replace(PRE_PROMPT_PLACEHOLDER_TEXT, toReplacePrePrompt)

View File

@ -982,7 +982,6 @@ const Configuration: FC = () => {
<>
<ModelParameterModal
isAdvancedMode={isAdvancedMode}
mode={mode}
provider={modelConfig.provider}
completionParams={completionParams}
modelId={modelConfig.model_id}

View File

@ -31,13 +31,11 @@ import Loading from '@/app/components/base/loading'
import { useProviderContext } from '@/context/provider-context'
import { PROVIDER_WITH_PRESET_TONE, STOP_PARAMETER_RULE, TONE_LIST } from '@/config'
import { ArrowNarrowLeft } from '@/app/components/base/icons/src/vender/line/arrows'
import type { ModelModeType } from '@/types/app'
export type ModelParameterModalProps = {
popupClassName?: string
portalToFollowElemContentClassName?: string
isAdvancedMode: boolean
mode: ModelModeType
modelId: string
provider: string
setModel: (model: { modelId: string; provider: string; mode?: string; features?: string[] }) => void