Feat: Fixed the issue where form data assigned by variables was not updated in real time. #10427 (#11333)

### What problem does this PR solve?

Feat: Fixed the issue where form data assigned by variables was not
updated in real time. #10427
### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-11-18 13:07:52 +08:00
committed by GitHub
parent 2993fc666b
commit 701761d119
6 changed files with 46 additions and 49 deletions

View File

@ -1,4 +1,10 @@
import {
AgentStructuredOutputField,
JsonSchemaDataType,
Operator,
} from '@/constants/agent';
import { BaseNode } from '@/interfaces/database/agent';
import { Edge } from '@xyflow/react';
import { isEmpty } from 'lodash';
import { ComponentType, ReactNode } from 'react';
@ -23,6 +29,12 @@ export function filterAllUpstreamNodeIds(edges: Edge[], nodeIds: string[]) {
}, []);
}
export function isAgentStructured(id?: string, label?: string) {
return (
label === AgentStructuredOutputField && id?.startsWith(`${Operator.Agent}:`)
);
}
export function buildOutputOptions(
outputs: Record<string, any> = {},
nodeId?: string,
@ -34,7 +46,9 @@ export function buildOutputOptions(
value: `${nodeId}@${x}`,
parentLabel,
icon,
type: outputs[x]?.type,
type: isAgentStructured(nodeId, x)
? JsonSchemaDataType.Object
: outputs[x]?.type,
}));
}