MCPcopy
hub / github.com/FlowiseAI/Flowise / findParamsWithLoadConfig

Function findParamsWithLoadConfig

packages/server/src/utils/buildAgentflow.ts:475–492  ·  view source on GitHub ↗
(inputParams: any[])

Source from the content-addressed store, hash-verified

473 // Helper function to find params with loadConfig recursively
474 // Example: Finds ["agentModel", "agentSelectedTool"] from the inputParams structure
475 const findParamsWithLoadConfig = (inputParams: any[]): string[] => {
476 const paramsWithLoadConfig: string[] = []
477
478 for (const param of inputParams) {
479 // Direct loadConfig param (e.g., agentModel with loadConfig: true)
480 if (param.loadConfig === true) {
481 paramsWithLoadConfig.push(param.name)
482 }
483
484 // Check nested array parameters (e.g., agentTools.array contains agentSelectedTool with loadConfig: true)
485 if (param.type === 'array' && param.array && Array.isArray(param.array)) {
486 const nestedParams = findParamsWithLoadConfig(param.array)
487 paramsWithLoadConfig.push(...nestedParams)
488 }
489 }
490
491 return paramsWithLoadConfig
492 }
493
494 // Helper function to find value of a parameter recursively in nested objects/arrays
495 // Example: Searches for "agentSelectedTool" value in complex nested inputs structure

Callers 1

getParamValuesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected