Feature: Added global variable functionality #10703 (#11117)

### What problem does this PR solve?

Feature: Added global variable functionality

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
chanx
2025-11-10 10:16:12 +08:00
committed by GitHub
parent b6cd282ccd
commit 7423a5806e
10 changed files with 402 additions and 4 deletions

View File

@ -3,6 +3,7 @@ import {
useResetAgent,
useSetAgent,
} from '@/hooks/use-agent-request';
import { GobalVariableType } from '@/interfaces/database/agent';
import { RAGFlowNodeType } from '@/interfaces/database/flow';
import { formatDate } from '@/utils/date';
import { useDebounceEffect } from 'ahooks';
@ -18,11 +19,14 @@ export const useSaveGraph = (showMessage: boolean = true) => {
const { buildDslData } = useBuildDslData();
const saveGraph = useCallback(
async (currentNodes?: RAGFlowNodeType[]) => {
async (
currentNodes?: RAGFlowNodeType[],
otherParam?: { gobalVariables: Record<string, GobalVariableType> },
) => {
return setAgent({
id,
title: data.title,
dsl: buildDslData(currentNodes),
dsl: buildDslData(currentNodes, otherParam),
});
},
[setAgent, data, id, buildDslData],