mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Add a form for variable aggregation operators #10427 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -53,10 +53,13 @@ export function StructuredOutputSecondaryMenu({
|
||||
|
||||
const renderAgentStructuredOutput = useCallback(
|
||||
(values: any, option: { label: ReactNode; value: string }) => {
|
||||
if (isPlainObject(values) && 'properties' in values) {
|
||||
const properties =
|
||||
get(values, 'properties') || get(values, 'items.properties');
|
||||
|
||||
if (isPlainObject(values) && properties) {
|
||||
return (
|
||||
<ul className="border-l">
|
||||
{Object.entries(values.properties).map(([key, value]) => {
|
||||
{Object.entries(properties).map(([key, value]) => {
|
||||
const nextOption = {
|
||||
label: option.label + `.${key}`,
|
||||
value: option.value + `.${key}`,
|
||||
@ -79,8 +82,9 @@ export function StructuredOutputSecondaryMenu({
|
||||
{key}
|
||||
<span className="text-text-secondary">{dataType}</span>
|
||||
</div>
|
||||
{dataType === JsonSchemaDataType.Object &&
|
||||
renderAgentStructuredOutput(value, nextOption)}
|
||||
{[JsonSchemaDataType.Object, JsonSchemaDataType.Array].some(
|
||||
(x) => x === dataType,
|
||||
) && renderAgentStructuredOutput(value, nextOption)}
|
||||
</li>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user