Ver código fonte

feat: store mcp_config when switch agent strategy (#19291)

tags/1.4.0
Good Wood 5 meses atrás
pai
commit
d1c08a810b
Nenhuma conta vinculada ao e-mail do autor do commit

+ 0
- 1
web/app/components/workflow/nodes/agent/panel.tsx Ver arquivo

@@ -102,7 +102,6 @@ const AgentPanel: FC<NodePanelProps<AgentNodeType>> = (props) => {
agent_strategy_label: strategy?.agent_strategy_label,
output_schema: strategy!.agent_output_schema,
plugin_unique_identifier: strategy!.plugin_unique_identifier,
agent_parameters: {},
})
resetEditor(Date.now())
}}

+ 3
- 2
web/app/components/workflow/nodes/agent/use-config.ts Ver arquivo

@@ -85,12 +85,13 @@ const useConfig = (id: string, payload: AgentNodeType) => {
enabled: Boolean(pluginId),
})
const formData = useMemo(() => {
const paramNameList = (currentStrategy?.parameters || []).map(item => item.name)
return Object.fromEntries(
Object.entries(inputs.agent_parameters || {}).map(([key, value]) => {
Object.entries(inputs.agent_parameters || {}).filter(([name]) => paramNameList.includes(name)).map(([key, value]) => {
return [key, value.value]
}),
)
}, [inputs.agent_parameters])
}, [inputs.agent_parameters, currentStrategy?.parameters])
const onFormChange = (value: Record<string, any>) => {
const res: ToolVarInputs = {}
Object.entries(value).forEach(([key, val]) => {

Carregando…
Cancelar
Salvar