mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-17 11:35:58 +08:00
fix: can not set llm struct the right var type
This commit is contained in:
parent
7a647cf18e
commit
a75e77e156
@ -8,7 +8,7 @@ import type {
|
|||||||
ValueSelector,
|
ValueSelector,
|
||||||
Var,
|
Var,
|
||||||
} from '@/app/components/workflow/types'
|
} from '@/app/components/workflow/types'
|
||||||
import { useIsChatMode, useWorkflow } from './use-workflow'
|
import { useIsChatMode } from './use-workflow'
|
||||||
import { useStoreApi } from 'reactflow'
|
import { useStoreApi } from 'reactflow'
|
||||||
|
|
||||||
export const useWorkflowVariables = () => {
|
export const useWorkflowVariables = () => {
|
||||||
@ -80,7 +80,6 @@ export const useWorkflowVariableType = () => {
|
|||||||
const {
|
const {
|
||||||
getNodes,
|
getNodes,
|
||||||
} = store.getState()
|
} = store.getState()
|
||||||
const { getBeforeNodesInSameBranch } = useWorkflow()
|
|
||||||
const { getCurrentVariableType } = useWorkflowVariables()
|
const { getCurrentVariableType } = useWorkflowVariables()
|
||||||
|
|
||||||
const isChatMode = useIsChatMode()
|
const isChatMode = useIsChatMode()
|
||||||
@ -92,12 +91,10 @@ export const useWorkflowVariableType = () => {
|
|||||||
nodeId: string,
|
nodeId: string,
|
||||||
valueSelector: ValueSelector,
|
valueSelector: ValueSelector,
|
||||||
}) => {
|
}) => {
|
||||||
// debugger
|
|
||||||
const node = getNodes().find(n => n.id === nodeId)
|
const node = getNodes().find(n => n.id === nodeId)
|
||||||
// console.log(nodeId, valueSelector)
|
|
||||||
const isInIteration = !!node?.data.isInIteration
|
const isInIteration = !!node?.data.isInIteration
|
||||||
const iterationNode = isInIteration ? getNodes().find(n => n.id === node.parentId) : null
|
const iterationNode = isInIteration ? getNodes().find(n => n.id === node.parentId) : null
|
||||||
const availableNodes = getBeforeNodesInSameBranch(nodeId)
|
const availableNodes = [node]
|
||||||
|
|
||||||
const type = getCurrentVariableType({
|
const type = getCurrentVariableType({
|
||||||
parentNode: iterationNode,
|
parentNode: iterationNode,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user