Feat: Add a switch to control the display of structured output to the agent form. #10427 (#11344)

### What problem does this PR solve?

Feat: Add a switch to control the display of structured output to the
agent form. #10427

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-11-18 18:58:36 +08:00
committed by GitHub
parent d1716d865a
commit 4942a23290
13 changed files with 133 additions and 75 deletions

View File

@ -6,7 +6,7 @@ import {
import { BaseNode } from '@/interfaces/database/agent';
import { Edge } from '@xyflow/react';
import { isEmpty } from 'lodash';
import { get, isEmpty } from 'lodash';
import { ComponentType, ReactNode } from 'react';
export function filterAllUpstreamNodeIds(edges: Edge[], nodeIds: string[]) {
@ -87,3 +87,15 @@ export function buildNodeOutputOptions({
),
}));
}
export function getStructuredDatatype(value: Record<string, any> | unknown) {
const dataType = get(value, 'type');
const arrayItemsType = get(value, 'items.type', JsonSchemaDataType.String);
const compositeDataType =
dataType === JsonSchemaDataType.Array
? `${dataType}<${arrayItemsType}>`
: dataType;
return { dataType, compositeDataType };
}