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

View File

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

View File

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