mirror of
https://github.com/langgenius/dify.git
synced 2026-01-13 21:57:48 +08:00
fix: refine agent variable logic
This commit is contained in:
parent
bb190f9610
commit
b25b069917
@ -67,7 +67,7 @@ const WorkflowVariableBlockComponent = ({
|
||||
)()
|
||||
const [localWorkflowNodesMap, setLocalWorkflowNodesMap] = useState<WorkflowNodesMap>(workflowNodesMap)
|
||||
const node = localWorkflowNodesMap![variables[isRagVar ? 1 : 0]]
|
||||
const isAgentVariable = node?.type === BlockEnum.Agent
|
||||
const isAgentContextVariable = node?.type === BlockEnum.Agent && variables[variablesLength - 1] === 'context'
|
||||
|
||||
const isException = isExceptionVariable(varName, node?.type)
|
||||
const variableValid = useMemo(() => {
|
||||
@ -136,7 +136,7 @@ const WorkflowVariableBlockComponent = ({
|
||||
})
|
||||
}, [node, reactflow, store])
|
||||
|
||||
if (isAgentVariable)
|
||||
if (isAgentContextVariable)
|
||||
return <span className="hidden" ref={ref} />
|
||||
|
||||
const Item = (
|
||||
|
||||
@ -113,7 +113,6 @@ const MixedVariableTextInput = ({
|
||||
if (!onChange)
|
||||
return
|
||||
|
||||
console.log('handleAgentSelect', value)
|
||||
const newValue = `{{#${agent.id}.context#}}`
|
||||
|
||||
onChange(newValue)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user