Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Feat: When saving the canvas, other dls parameters passed from the backend are spliced ​​into the dsl parameters #3355 (#3558)

balibabud47ee8845457
diff --git a/web/src/pages/flow/canvas/node/popover.tsx b/web/src/pages/flow/canvas/node/popover.tsx
index f943c2120e..f9cb70bd54 100644
--- a/web/src/pages/flow/canvas/node/popover.tsx
+++ b/web/src/pages/flow/canvas/node/popover.tsx
@@ -35,10 +35,10 @@ export function NextNodePopover({ children, nodeId, name }: IProps) {
const inputs: Array<{ component_id: string; content: string }> = get(
component,
- ['obj', 'params', 'inputs'],
+ ['obj', 'inputs'],
[],
);
- const output = get(component, ['obj', 'params', 'output'], {});
+ const output = get(component, ['obj', 'output'], {});
const { replacedOutput } = useReplaceIdWithText(output);
const stopPropagation: MouseEventHandler = useCallback((e) => {
e.stopPropagation();
diff --git a/web/src/pages/flow/hooks.tsx b/web/src/pages/flow/hooks.tsx
index e73455791a..de630b9457 100644
--- a/web/src/pages/flow/hooks.tsx
+++ b/web/src/pages/flow/hooks.tsx
@@ -268,6 +268,7 @@ export const useSaveGraph = () => {
const dslComponents = buildDslComponentsByGraph(
currentNodes ?? nodes,
edges,
+ data.dsl.components,
);
return setFlow({
id,
diff --git a/web/src/pages/flow/utils.ts b/web/src/pages/flow/utils.ts
index 3cf7f481db..e3b66d5719 100644
--- a/web/src/pages/flow/utils.ts
+++ b/web/src/pages/flow/utils.ts
@@ -119,6 +119,7 @@ const buildOperatorParams = (operatorName: string) =>
export const buildDslComponentsByGraph = (
nodes: Node<NodeData>[],
edges: Edge[],
+ oldDslComponents: DSLComponents,
): DSLComponents => {
const components: DSLComponents = {};
@@ -129,6 +130,7 @@ export const buildDslComponentsByGraph = (
const operatorName = x.data.label;
components[id] = {
obj: {
+ ...(oldDslComponents[id]?.obj ?? {}),
component_name: operatorName,
params:
buildOperatorParams(operatorName)(