Explorar el Código

fix: node use vision model may caused page crash (#15921)

Joel hace 1 mes
padre
commit
f8f21ef7c0

+ 1 - 1
web/app/components/workflow/nodes/llm/panel.tsx

@@ -103,7 +103,7 @@ const Panel: FC<NodePanelProps<LLMNodeType>> = ({
       )
     }
 
-    if (isVisionModel && data.vision.enabled && data.vision.configs?.variable_selector) {
+    if (isVisionModel && data.vision?.enabled && data.vision?.configs?.variable_selector) {
       const currentVariable = findVariableWhenOnLLMVision(data.vision.configs.variable_selector, availableVars)
 
       forms.push(

+ 1 - 1
web/app/components/workflow/nodes/parameter-extractor/panel.tsx

@@ -89,7 +89,7 @@ const Panel: FC<NodePanelProps<ParameterExtractorNodeType>> = ({
       },
     )
 
-    if (isVisionModel && data.vision.enabled && data.vision.configs?.variable_selector) {
+    if (isVisionModel && data.vision?.enabled && data.vision?.configs?.variable_selector) {
       const currentVariable = findVariableWhenOnLLMVision(data.vision.configs.variable_selector, availableVisionVars)
 
       forms.push(

+ 1 - 1
web/app/components/workflow/nodes/question-classifier/panel.tsx

@@ -77,7 +77,7 @@ const Panel: FC<NodePanelProps<QuestionClassifierNodeType>> = ({
       },
     )
 
-    if (isVisionModel && data.vision.enabled && data.vision.configs?.variable_selector) {
+    if (isVisionModel && data.vision?.enabled && data.vision?.configs?.variable_selector) {
       const currentVariable = findVariableWhenOnLLMVision(data.vision.configs.variable_selector, availableVisionVars)
 
       forms.push(