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 with data operations operators #10427 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user