fix(web): check list add vision_input

This commit is contained in:
zhaoying
2026-04-20 18:39:59 +08:00
parent 10a655772f
commit 2c2ed0ebf3
4 changed files with 16 additions and 2 deletions

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-03-07 16:49:59
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-04-17 10:11:54
* @Last Modified time: 2026-04-20 18:14:34
*/
import { type FC, useEffect, useState } from 'react';
import { Select, Flex, Space } from 'antd';
@@ -56,7 +56,7 @@ const ModelSelect: FC<ModelSelectProps> = ({ params, placeholder, fontClassName,
useEffect(() => {
if (updateOptions) updateOptions([...options, ...initialData]);
}, [options, initialData])
}, [JSON.stringify(options), JSON.stringify(initialData)])
return (
<Select

View File

@@ -2537,6 +2537,7 @@ Memory Bear: After the rebellion, regional warlordism intensified for several re
checkListErrors: {
'llm.model_id': 'Model',
'llm.messages': 'Messages',
'llm.vision_input': 'Vision Variable',
'end.output': 'Output',
'knowledge-retrieval.knowledge_retrieval': 'Knowledge bases',
'parameter-extractor.model_id': 'Model',

View File

@@ -2501,6 +2501,7 @@ export const zh = {
checkListErrors: {
'llm.model_id': '模型',
'llm.messages': '提示词',
'llm.vision_input': '视觉变量',
'end.output': '回复',
'knowledge-retrieval.knowledge_retrieval': '知识库',
'parameter-extractor.model_id': '模型',

View File

@@ -106,6 +106,18 @@ function validateNode(type: string, config: Record<string, any>): CheckError[] {
if (isInvalid) errors.push({ key: specialKey, message: '' })
})
// llm: vision_input required when vision is enabled
if (type === 'llm') {
const vision = get('vision')
if (vision === true || vision === 'true') {
const visionInput = get('vision_input')
console.log('vision', vision, isEmpty(visionInput))
if (isEmpty(visionInput)) {
errors.push({ key: 'llm.vision_input', message: '' })
}
}
}
// http-request body.data (binary) — not a top-level required field, check separately
if (type === 'http-request') {
const body = get('body')