Feat: Add a form with data operations operators #10427 (#11001)

### What problem does this PR solve?

Feat: Add a form with data operations operators #10427

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-11-04 19:42:59 +08:00
committed by GitHub
parent 880a6a0428
commit db9fa3042b
16 changed files with 433 additions and 49 deletions

View File

@ -29,6 +29,7 @@ import {
NodeHandleId,
Operator,
} from './constant';
import { DataOperationsFormSchemaType } from './form/data-operations-form';
import { ExtractorFormSchemaType } from './form/extractor-form';
import { HierarchicalMergerFormSchemaType } from './form/hierarchical-merger-form';
import { ParserFormSchemaType } from './form/parser-form';
@ -267,6 +268,15 @@ function transformExtractorParams(params: ExtractorFormSchemaType) {
return { ...params, prompts: [{ content: params.prompts, role: 'user' }] };
}
function transformDataOperationsParams(params: DataOperationsFormSchemaType) {
return {
...params,
select_keys: params?.select_keys?.map((x) => x.name),
remove_keys: params?.remove_keys?.map((x) => x.name),
inputs: params.inputs.map((x) => x.input),
};
}
// construct a dsl based on the node information of the graph
export const buildDslComponentsByGraph = (
nodes: RAGFlowNodeType[],
@ -313,6 +323,9 @@ export const buildDslComponentsByGraph = (
case Operator.Extractor:
params = transformExtractorParams(params);
break;
case Operator.DataOperations:
params = transformDataOperationsParams(params);
break;
default:
break;