This commit is contained in:
StyleZhang 2024-03-15 17:57:20 +08:00
parent b5c212f575
commit d0ef9e672f
3 changed files with 6 additions and 3 deletions

View File

@ -2,6 +2,7 @@ import {
useCallback,
useEffect,
} from 'react'
import { uniqBy } from 'lodash-es'
import useSWR from 'swr'
import produce from 'immer'
import {
@ -100,7 +101,7 @@ export const useWorkflow = () => {
list.push(...incomers)
return list.filter((item) => {
return uniqBy(list, 'id').filter((item) => {
return SUPPORT_OUTPUT_VARS_NODE.includes(item.data.type)
})
}, [store])
@ -135,7 +136,7 @@ export const useWorkflow = () => {
const length = list.length
if (length) {
return list.reverse().filter((item) => {
return uniqBy(list, 'id').reverse().filter((item) => {
return SUPPORT_OUTPUT_VARS_NODE.includes(item.data.type)
})
}
@ -171,7 +172,7 @@ export const useWorkflow = () => {
list.push(node)
})
return list
return uniqBy(list, 'id')
}, [store])
const isValidConnection = useCallback(({ source, target }: Connection) => {

View File

@ -118,6 +118,7 @@ const Panel: FC<NodePanelProps<LLMNodeType>> = ({
handleModelChanged({
provider: currentProvider?.provider,
modelId: currentModel?.model,
mode: currentModel?.model_properties?.mode as string,
})
}
}, [model.provider, currentProvider, currentModel, handleModelChanged])

View File

@ -51,6 +51,7 @@ const Panel: FC<NodePanelProps<QuestionClassifierNodeType>> = ({
handleModelChanged({
provider: currentProvider?.provider,
modelId: currentModel?.model,
mode: currentModel?.model_properties?.mode as string,
})
}
}, [model.provider, currentProvider, currentModel, handleModelChanged])