mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Feat: Allow operators inside the loop operator to reference the output parameters of external operators #3221 (#8498)
### What problem does this PR solve? Feat: Allow operators inside the loop operator to reference the output parameters of external operators #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -139,13 +139,14 @@ export function useBuildBeginVariableOptions() {
|
||||
return options;
|
||||
}
|
||||
|
||||
export const useBuildVariableOptions = (nodeId?: string) => {
|
||||
export const useBuildVariableOptions = (nodeId?: string, parentId?: string) => {
|
||||
const nodeOutputOptions = useBuildNodeOutputOptions(nodeId);
|
||||
const parentNodeOutputOptions = useBuildNodeOutputOptions(parentId);
|
||||
const beginOptions = useBuildBeginVariableOptions();
|
||||
|
||||
const options = useMemo(() => {
|
||||
return [...beginOptions, ...nodeOutputOptions];
|
||||
}, [beginOptions, nodeOutputOptions]);
|
||||
return [...beginOptions, ...nodeOutputOptions, ...parentNodeOutputOptions];
|
||||
}, [beginOptions, nodeOutputOptions, parentNodeOutputOptions]);
|
||||
|
||||
return options;
|
||||
};
|
||||
@ -153,7 +154,7 @@ export const useBuildVariableOptions = (nodeId?: string) => {
|
||||
export function useBuildQueryVariableOptions() {
|
||||
const { data } = useFetchAgent();
|
||||
const node = useContext(AgentFormContext);
|
||||
const options = useBuildVariableOptions(node?.id);
|
||||
const options = useBuildVariableOptions(node?.id, node?.parentId);
|
||||
|
||||
const nextOptions = useMemo(() => {
|
||||
const globals = data?.dsl?.globals ?? {};
|
||||
|
||||
Reference in New Issue
Block a user