diff --git a/web/app/components/workflow/nodes/llm/use-config.ts b/web/app/components/workflow/nodes/llm/use-config.ts index 13db9e403..cd2c55225 100644 --- a/web/app/components/workflow/nodes/llm/use-config.ts +++ b/web/app/components/workflow/nodes/llm/use-config.ts @@ -247,11 +247,11 @@ const useConfig = (id: string, payload: LLMNodeType) => { }, [inputs, setInputs]) const handlePromptChange = useCallback((newPrompt: PromptItem[] | PromptItem) => { - const newInputs = produce(inputRef.current, (draft) => { + const newInputs = produce(inputs, (draft) => { draft.prompt_template = newPrompt }) setInputs(newInputs) - }, [setInputs]) + }, [inputs, setInputs]) const handleMemoryChange = useCallback((newMemory?: Memory) => { const newInputs = produce(inputs, (draft) => { diff --git a/web/app/components/workflow/types.ts b/web/app/components/workflow/types.ts index 5218c2308..2a0a10629 100644 --- a/web/app/components/workflow/types.ts +++ b/web/app/components/workflow/types.ts @@ -198,7 +198,7 @@ export type InputVar = { hint?: string options?: string[] value_selector?: ValueSelector - hide: boolean + hide?: boolean } & Partial export type ModelConfig = {