mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 09:28:04 +08:00
fix
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import type { FC } from 'react'
|
||||
import React from 'react'
|
||||
import React, { useEffect } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import VarReferencePicker from '../_base/components/variable/var-reference-picker'
|
||||
import useConfig from './use-config'
|
||||
@ -11,6 +11,7 @@ import ModelParameterModal from '@/app/components/header/account-setting/model-p
|
||||
import { InputVarType, type NodePanelProps } from '@/app/components/workflow/types'
|
||||
import BeforeRunForm from '@/app/components/workflow/nodes/_base/components/before-run-form'
|
||||
import ResultPanel from '@/app/components/workflow/run/result-panel'
|
||||
import { useModelListAndDefaultModelAndCurrentProviderAndModel } from '@/app/components/header/account-setting/model-provider-page/hooks'
|
||||
|
||||
const i18nPrefix = 'workflow.nodes.questionClassifiers'
|
||||
|
||||
@ -20,6 +21,10 @@ const Panel: FC<NodePanelProps<QuestionClassifierNodeType>> = ({
|
||||
}) => {
|
||||
const { t } = useTranslation()
|
||||
const readOnly = false
|
||||
const {
|
||||
currentProvider,
|
||||
currentModel,
|
||||
} = useModelListAndDefaultModelAndCurrentProviderAndModel(1)
|
||||
|
||||
const {
|
||||
inputs,
|
||||
@ -41,6 +46,15 @@ const Panel: FC<NodePanelProps<QuestionClassifierNodeType>> = ({
|
||||
|
||||
const model = inputs.model
|
||||
|
||||
useEffect(() => {
|
||||
if (currentProvider?.provider && currentModel?.model && !model.provider) {
|
||||
handleModelChanged({
|
||||
provider: currentProvider?.provider,
|
||||
modelId: currentModel?.model,
|
||||
})
|
||||
}
|
||||
}, [model.provider, currentProvider, currentModel, handleModelChanged])
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className='mt-2 px-4 space-y-4'>
|
||||
|
||||
Reference in New Issue
Block a user