From 5c266fecf928fadae622a7fc17f7824f847a9601 Mon Sep 17 00:00:00 2001 From: lyzno1 Date: Thu, 30 Oct 2025 18:36:08 +0800 Subject: [PATCH] fix: types --- .../app/configuration/config/automatic/get-automatic-res.tsx | 1 - .../config/code-generator/get-code-generator-res.tsx | 1 - .../dataset-config/params-config/config-content.tsx | 4 +--- .../debug-with-multiple-model/model-parameter-trigger.tsx | 2 -- .../model-provider-page/model-parameter-modal/index.tsx | 2 -- .../components/metadata/metadata-filter/index.tsx | 3 --- .../json-schema-generator/prompt-editor.tsx | 1 - web/app/components/workflow/nodes/llm/panel.tsx | 4 ---- .../components/workflow/nodes/parameter-extractor/panel.tsx | 3 --- .../components/workflow/nodes/question-classifier/panel.tsx | 3 --- 10 files changed, 1 insertion(+), 23 deletions(-) diff --git a/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx b/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx index 33ff7b7b64..dfcaabf017 100644 --- a/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx +++ b/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx @@ -298,7 +298,6 @@ const GetAutomaticRes: FC = ({ portalToFollowElemContentClassName='z-[1000]' isAdvancedMode={true} provider={model.provider} - mode={model.mode} completionParams={model.completion_params} modelId={model.name} setModel={handleModelChange} diff --git a/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx b/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx index 3323ac6ca7..3612f89b02 100644 --- a/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx +++ b/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx @@ -214,7 +214,6 @@ export const GetCodeGeneratorResModal: FC = ( portalToFollowElemContentClassName='z-[1000]' isAdvancedMode={true} provider={model.provider} - mode={model.mode} completionParams={model.completion_params} modelId={model.name} setModel={handleModelChange} diff --git a/web/app/components/app/configuration/dataset-config/params-config/config-content.tsx b/web/app/components/app/configuration/dataset-config/params-config/config-content.tsx index 55b944d695..8e06d6c901 100644 --- a/web/app/components/app/configuration/dataset-config/params-config/config-content.tsx +++ b/web/app/components/app/configuration/dataset-config/params-config/config-content.tsx @@ -6,7 +6,7 @@ import { useTranslation } from 'react-i18next' import WeightedScore from './weighted-score' import TopKItem from '@/app/components/base/param-item/top-k-item' import ScoreThresholdItem from '@/app/components/base/param-item/score-threshold-item' -import { ModelModeType, RETRIEVE_TYPE } from '@/types/app' +import { RETRIEVE_TYPE } from '@/types/app' import type { DatasetConfigs, } from '@/models/debug' @@ -142,7 +142,6 @@ const ConfigContent: FC = ({ } const model = singleRetrievalConfig // Legacy code, for compatibility, have to keep it - const singleRetrievalMode = (model?.mode as ModelModeType | undefined) ?? ModelModeType.unset const rerankingModeOptions = [ { @@ -369,7 +368,6 @@ const ConfigContent: FC = ({ popupClassName='!w-[387px]' portalToFollowElemContentClassName='!z-[1002]' isAdvancedMode={true} - mode={singleRetrievalMode} provider={model?.provider} completionParams={model?.completion_params} modelId={model?.name} diff --git a/web/app/components/app/configuration/debug/debug-with-multiple-model/model-parameter-trigger.tsx b/web/app/components/app/configuration/debug/debug-with-multiple-model/model-parameter-trigger.tsx index 67a221b7e4..e7c4d98733 100644 --- a/web/app/components/app/configuration/debug/debug-with-multiple-model/model-parameter-trigger.tsx +++ b/web/app/components/app/configuration/debug/debug-with-multiple-model/model-parameter-trigger.tsx @@ -27,7 +27,6 @@ const ModelParameterTrigger: FC = ({ const { t } = useTranslation() const { isAdvancedMode, - modelModeType, } = useDebugConfigurationContext() const { multipleModelConfigs, @@ -57,7 +56,6 @@ const ModelParameterTrigger: FC = ({ return ( void diff --git a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/metadata-filter/index.tsx b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/metadata-filter/index.tsx index 6405118c50..1c6158a60e 100644 --- a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/metadata-filter/index.tsx +++ b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/metadata-filter/index.tsx @@ -11,7 +11,6 @@ import type { MetadataShape } from '@/app/components/workflow/nodes/knowledge-re import { MetadataFilteringModeEnum } from '@/app/components/workflow/nodes/knowledge-retrieval/types' import ModelParameterModal from '@/app/components/header/account-setting/model-provider-page/model-parameter-modal' import { noop } from 'lodash-es' -import { ModelModeType } from '@/types/app' type MetadataFilterProps = { metadataFilterMode?: MetadataFilteringModeEnum @@ -27,7 +26,6 @@ const MetadataFilter = ({ }: MetadataFilterProps) => { const { t } = useTranslation() const [collapsed, setCollapsed] = useState(true) - const metadataModelMode = (metadataModelConfig?.mode as ModelModeType | undefined) ?? ModelModeType.chat const handleMetadataFilterModeChangeWrapped = useCallback((mode: MetadataFilteringModeEnum) => { if (mode === MetadataFilteringModeEnum.automatic) @@ -86,7 +84,6 @@ const MetadataFilter = ({ popupClassName='!w-[387px]' isInWorkflow isAdvancedMode={true} - mode={metadataModelMode} provider={metadataModelConfig?.provider || ''} completionParams={metadataModelConfig?.completion_params || { temperature: 0.7 }} modelId={metadataModelConfig?.name || ''} diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-generator/prompt-editor.tsx b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-generator/prompt-editor.tsx index 9387813ee5..62d156253a 100644 --- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-generator/prompt-editor.tsx +++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-generator/prompt-editor.tsx @@ -65,7 +65,6 @@ const PromptEditor: FC = ({ portalToFollowElemContentClassName='z-[1000]' isAdvancedMode={true} provider={model.provider} - mode={model.mode} completionParams={model.completion_params} modelId={model.name} setModel={onModelChange} diff --git a/web/app/components/workflow/nodes/llm/panel.tsx b/web/app/components/workflow/nodes/llm/panel.tsx index bdd51f9cfb..bb893b0da7 100644 --- a/web/app/components/workflow/nodes/llm/panel.tsx +++ b/web/app/components/workflow/nodes/llm/panel.tsx @@ -22,7 +22,6 @@ import Switch from '@/app/components/base/switch' import { RiAlertFill, RiQuestionLine } from '@remixicon/react' import { fetchAndMergeValidCompletionParams } from '@/utils/completion-params' import Toast from '@/app/components/base/toast' -import { ModelModeType } from '@/types/app' const i18nPrefix = 'workflow.nodes.llm' @@ -95,8 +94,6 @@ const Panel: FC> = ({ } })() }, [inputs.model.completion_params]) - const modelMode = (model?.mode as ModelModeType | undefined) ?? ModelModeType.chat - return (
@@ -108,7 +105,6 @@ const Panel: FC> = ({ popupClassName='!w-[387px]' isInWorkflow isAdvancedMode={true} - mode={modelMode} provider={model?.provider} completionParams={model?.completion_params} modelId={model?.name} diff --git a/web/app/components/workflow/nodes/parameter-extractor/panel.tsx b/web/app/components/workflow/nodes/parameter-extractor/panel.tsx index fff3853273..8faebfa547 100644 --- a/web/app/components/workflow/nodes/parameter-extractor/panel.tsx +++ b/web/app/components/workflow/nodes/parameter-extractor/panel.tsx @@ -19,7 +19,6 @@ import type { NodePanelProps } from '@/app/components/workflow/types' import Tooltip from '@/app/components/base/tooltip' import { VarType } from '@/app/components/workflow/types' import { FieldCollapse } from '@/app/components/workflow/nodes/_base/components/collapse' -import { ModelModeType } from '@/types/app' const i18nPrefix = 'workflow.nodes.parameterExtractor' const i18nCommonPrefix = 'workflow.common' @@ -56,7 +55,6 @@ const Panel: FC> = ({ } = useConfig(id, data) const model = inputs.model - const modelMode = (model?.mode as ModelModeType | undefined) ?? ModelModeType.chat return (
@@ -69,7 +67,6 @@ const Panel: FC> = ({ popupClassName='!w-[387px]' isInWorkflow isAdvancedMode={true} - mode={modelMode} provider={model?.provider} completionParams={model?.completion_params} modelId={model?.name} diff --git a/web/app/components/workflow/nodes/question-classifier/panel.tsx b/web/app/components/workflow/nodes/question-classifier/panel.tsx index a0ce9ee346..8b6bc533f2 100644 --- a/web/app/components/workflow/nodes/question-classifier/panel.tsx +++ b/web/app/components/workflow/nodes/question-classifier/panel.tsx @@ -13,7 +13,6 @@ import type { NodePanelProps } from '@/app/components/workflow/types' import Split from '@/app/components/workflow/nodes/_base/components/split' import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars' import { FieldCollapse } from '@/app/components/workflow/nodes/_base/components/collapse' -import { ModelModeType } from '@/types/app' const i18nPrefix = 'workflow.nodes.questionClassifiers' @@ -45,7 +44,6 @@ const Panel: FC> = ({ } = useConfig(id, data) const model = inputs.model - const modelMode = (model?.mode as ModelModeType | undefined) ?? ModelModeType.chat return (
@@ -58,7 +56,6 @@ const Panel: FC> = ({ popupClassName='!w-[387px]' isInWorkflow isAdvancedMode={true} - mode={modelMode} provider={model?.provider} completionParams={model.completion_params} modelId={model.name}