@@ -611,28 +611,35 @@ export const resolveVariables = (
611
611
export const replaceInputsWithConfig = ( flowNodeData : INodeData , overrideConfig : ICommonObject ) => {
612
612
const types = 'inputs'
613
613
614
- const getParamValues = ( paramsObj : ICommonObject ) => {
614
+ const getParamValues = ( inputsObj : ICommonObject ) => {
615
615
for ( const config in overrideConfig ) {
616
616
// If overrideConfig[key] is object
617
617
if ( overrideConfig [ config ] && typeof overrideConfig [ config ] === 'object' ) {
618
618
const nodeIds = Object . keys ( overrideConfig [ config ] )
619
619
if ( nodeIds . includes ( flowNodeData . id ) ) {
620
- paramsObj [ config ] = overrideConfig [ config ] [ flowNodeData . id ]
620
+ inputsObj [ config ] = overrideConfig [ config ] [ flowNodeData . id ]
621
+ continue
622
+ } else if ( nodeIds . some ( ( nodeId ) => nodeId . includes ( flowNodeData . name ) ) ) {
623
+ /*
624
+ * "systemMessagePrompt": {
625
+ * "chatPromptTemplate_0": "You are an assistant" <---- continue for loop if current node is chatPromptTemplate_1
626
+ * }
627
+ */
621
628
continue
622
629
}
623
630
}
624
631
625
- let paramValue = overrideConfig [ config ] ?? paramsObj [ config ]
632
+ let paramValue = overrideConfig [ config ] ?? inputsObj [ config ]
626
633
// Check if boolean
627
634
if ( paramValue === 'true' ) paramValue = true
628
635
else if ( paramValue === 'false' ) paramValue = false
629
- paramsObj [ config ] = paramValue
636
+ inputsObj [ config ] = paramValue
630
637
}
631
638
}
632
639
633
- const paramsObj = flowNodeData [ types ] ?? { }
640
+ const inputsObj = flowNodeData [ types ] ?? { }
634
641
635
- getParamValues ( paramsObj )
642
+ getParamValues ( inputsObj )
636
643
637
644
return flowNodeData
638
645
}
0 commit comments