mirror of
https://github.com/langgenius/dify.git
synced 2026-04-05 18:19:21 +08:00
fix: clear mock llm node functions
This commit is contained in:
@@ -65,17 +65,6 @@ export const useSubGraphPersistence = ({
|
||||
})
|
||||
}, [getSubGraphDataKey, inputs, setInputs])
|
||||
|
||||
const clearSubGraphData = useCallback(() => {
|
||||
const dataKey = getSubGraphDataKey()
|
||||
const newToolParameters = { ...inputs.tool_parameters }
|
||||
delete newToolParameters[dataKey]
|
||||
|
||||
setInputs({
|
||||
...inputs,
|
||||
tool_parameters: newToolParameters,
|
||||
})
|
||||
}, [getSubGraphDataKey, inputs, setInputs])
|
||||
|
||||
const hasSubGraphData = useCallback(() => {
|
||||
const dataKey = getSubGraphDataKey()
|
||||
const toolParameters = inputs.tool_parameters || {}
|
||||
@@ -120,7 +109,6 @@ export const useSubGraphPersistence = ({
|
||||
return {
|
||||
loadSubGraphData,
|
||||
saveSubGraphData,
|
||||
clearSubGraphData,
|
||||
hasSubGraphData,
|
||||
updateSubGraphConfig,
|
||||
updateSubGraphNodes,
|
||||
|
||||
@@ -69,7 +69,6 @@ const MixedVariableTextInput = ({
|
||||
const {
|
||||
loadSubGraphData,
|
||||
updateSubGraphNodes,
|
||||
clearSubGraphData,
|
||||
} = useSubGraphPersistence({
|
||||
toolNodeId: toolNodeId || '',
|
||||
paramKey: paramKey || '',
|
||||
@@ -126,10 +125,8 @@ const MixedVariableTextInput = ({
|
||||
}).trim()
|
||||
|
||||
onChange(valueWithoutAgentVars, VarKindTypeEnum.mixed, null)
|
||||
if (toolNodeId && paramKey)
|
||||
clearSubGraphData()
|
||||
setControlPromptEditorRerenderKey(Date.now())
|
||||
}, [clearSubGraphData, detectedAgentFromValue?.nodeId, onChange, paramKey, setControlPromptEditorRerenderKey, toolNodeId, value])
|
||||
}, [detectedAgentFromValue?.nodeId, onChange, paramKey, setControlPromptEditorRerenderKey, toolNodeId, value])
|
||||
|
||||
const handleAgentSelect = useCallback((agent: AgentNode) => {
|
||||
if (!onChange)
|
||||
|
||||
Reference in New Issue
Block a user