feat(web): llm node config add vision,vision_input
This commit is contained in:
@@ -1882,6 +1882,7 @@ Memory Bear: After the rebellion, regional warlordism intensified for several re
|
||||
enable_window: 'Memory Window',
|
||||
inner: 'Built-in',
|
||||
messagesPlaceholder: 'Write prompts here, type "{" to insert variables, type "insert" to insert',
|
||||
vision: 'Vision',
|
||||
},
|
||||
start: {
|
||||
variables: 'Input Fields',
|
||||
|
||||
@@ -1970,6 +1970,7 @@ export const zh = {
|
||||
enable_window: '记忆窗口',
|
||||
inner: '内置',
|
||||
messagesPlaceholder: '在此处编写提示,输入“{”插入变量,输入“insert”插入',
|
||||
vision: '视觉',
|
||||
},
|
||||
start: {
|
||||
variables: '输入字段',
|
||||
|
||||
@@ -55,7 +55,7 @@ const MemoryConfig: FC<{ options: Suggestion[]; parentName: string; }> = ({
|
||||
<Form.Item layout="horizontal" name={[parentName, 'enable_window']} noStyle>
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
<span className="rb:ml-2">{t('workflow.config.llm.enable_window')}</span>
|
||||
<span className="rb:ml-2 rb:text-[12px]">{t('workflow.config.llm.enable_window')}</span>
|
||||
</Col>
|
||||
<Col span={14}>
|
||||
<Form.Item layout="horizontal" name={[parentName, 'window_size']} noStyle>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* @Author: ZhaoYing
|
||||
* @Date: 2026-02-03 15:39:59
|
||||
* @Last Modified by: ZhaoYing
|
||||
* @Last Modified time: 2026-02-03 15:39:59
|
||||
* @Last Modified by: ZhaoYing
|
||||
* @Last Modified time: 2026-02-05 14:21:45
|
||||
*/
|
||||
import { type FC, useEffect, useState, useMemo } from "react";
|
||||
import clsx from 'clsx'
|
||||
@@ -612,11 +612,19 @@ const Properties: FC<PropertiesProps> = ({
|
||||
)
|
||||
}
|
||||
|
||||
if (key === 'vision_input' && !values?.vision) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<Form.Item
|
||||
key={key}
|
||||
name={key}
|
||||
label={key === 'parallel_count' ? <span className="rb:text-[10px] rb:text-[#5B6167] rb:leading-3.5 rb:-mb-1!">{t(`workflow.config.${selectedNode?.data?.type}.${key}`)}</span> : t(`workflow.config.${selectedNode?.data?.type}.${key}`)}
|
||||
label={key === 'vision_input'
|
||||
? undefined : key === 'parallel_count'
|
||||
? <span className="rb:text-[10px] rb:text-[#5B6167] rb:leading-3.5 rb:-mb-1!">{t(`workflow.config.${selectedNode?.data?.type}.${key}`)}</span>
|
||||
: t(`workflow.config.${selectedNode?.data?.type}.${key}`)
|
||||
}
|
||||
layout={config.type === 'switch' ? 'horizontal' : 'vertical'}
|
||||
className={key === 'parallel_count' ? 'rb:-mt-3! rb:leading-3.5!' : ''}
|
||||
>
|
||||
@@ -655,13 +663,16 @@ const Properties: FC<PropertiesProps> = ({
|
||||
// Apply filtering if specified in config
|
||||
if (config.filterNodeTypes || config.filterVariableNames) {
|
||||
return baseVariableList.filter(variable => {
|
||||
const nodeTypeMatch = !config.filterNodeTypes ||
|
||||
const nodeTypeMatch = !config.filterNodeTypes ||
|
||||
(Array.isArray(config.filterNodeTypes) && config.filterNodeTypes.includes(variable.nodeData?.type));
|
||||
const variableNameMatch = !config.filterVariableNames ||
|
||||
const variableNameMatch = !config.filterVariableNames ||
|
||||
(Array.isArray(config.filterVariableNames) && config.filterVariableNames.includes(variable.label));
|
||||
return nodeTypeMatch || variableNameMatch;
|
||||
});
|
||||
}
|
||||
if (config.onFilterVariableNames) {
|
||||
return baseVariableList.filter(variable => Array.isArray(config.onFilterVariableNames) && config.onFilterVariableNames.includes(variable.label));
|
||||
}
|
||||
// Filter child nodes for iteration output
|
||||
if (config.filterChildNodes && selectedNode) {
|
||||
const graph = graphRef.current;
|
||||
@@ -685,7 +696,13 @@ const Properties: FC<PropertiesProps> = ({
|
||||
size="small"
|
||||
/>
|
||||
: config.type === 'switch'
|
||||
? <Switch onChange={key === 'group' ? () => { form.setFieldValue('group_variables', []) } : undefined} />
|
||||
? <Switch onChange={
|
||||
key === 'group'
|
||||
? () => { form.setFieldValue('group_variables', []) }
|
||||
: key === 'vision'
|
||||
? () => { form.setFieldValue('vision_input', undefined) }
|
||||
: undefined
|
||||
} />
|
||||
: config.type === 'categoryList'
|
||||
? <CategoryList
|
||||
parentName={key}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: ZhaoYing
|
||||
* @Date: 2026-02-03 15:06:18
|
||||
* @Last Modified by: ZhaoYing
|
||||
* @Last Modified time: 2026-02-03 15:25:25
|
||||
* @Last Modified time: 2026-02-05 14:15:13
|
||||
*/
|
||||
import LoopNode from './components/Nodes/LoopNode';
|
||||
import NormalNode from './components/Nodes/NormalNode';
|
||||
@@ -91,6 +91,11 @@ export const nodeLibrary: NodeLibrary[] = [
|
||||
type: "string",
|
||||
readonly: true
|
||||
},
|
||||
{
|
||||
name: "files",
|
||||
type: "array[file]",
|
||||
readonly: true
|
||||
},
|
||||
],
|
||||
defaultValue: []
|
||||
}
|
||||
@@ -155,6 +160,13 @@ export const nodeLibrary: NodeLibrary[] = [
|
||||
enable_window: false,
|
||||
window_size: 20
|
||||
}
|
||||
},
|
||||
vision: {
|
||||
type: 'switch'
|
||||
},
|
||||
vision_input: {
|
||||
type: 'variableList',
|
||||
onFilterVariableNames: ['sys.files']
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user