mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 17:01:00 +03:00
Bugfix/Allow analytics override config (#3520)
allow analytics override config
This commit is contained in:
@@ -1014,30 +1014,33 @@ export const replaceInputsWithConfig = (flowNodeData: INodeData, overrideConfig:
|
|||||||
|
|
||||||
const getParamValues = (inputsObj: ICommonObject) => {
|
const getParamValues = (inputsObj: ICommonObject) => {
|
||||||
for (const config in overrideConfig) {
|
for (const config in overrideConfig) {
|
||||||
// If overrideConfig[key] is object
|
// Always allow analytics config: https://docs.flowiseai.com/using-flowise/analytic#api
|
||||||
if (overrideConfig[config] && typeof overrideConfig[config] === 'object') {
|
if (config !== 'analytics') {
|
||||||
const nodeIds = Object.keys(overrideConfig[config])
|
// If overrideConfig[key] is object
|
||||||
if (nodeIds.includes(flowNodeData.id)) {
|
if (overrideConfig[config] && typeof overrideConfig[config] === 'object') {
|
||||||
// Check if this parameter is enabled for this node type
|
const nodeIds = Object.keys(overrideConfig[config])
|
||||||
if (isParameterEnabled(flowNodeData.label, config)) {
|
if (nodeIds.includes(flowNodeData.id)) {
|
||||||
inputsObj[config] = overrideConfig[config][flowNodeData.id]
|
// Check if this parameter is enabled for this node type
|
||||||
|
if (isParameterEnabled(flowNodeData.label, config)) {
|
||||||
|
inputsObj[config] = overrideConfig[config][flowNodeData.id]
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
} else if (nodeIds.some((nodeId) => nodeId.includes(flowNodeData.name))) {
|
||||||
|
/*
|
||||||
|
* "systemMessagePrompt": {
|
||||||
|
* "chatPromptTemplate_0": "You are an assistant" <---- continue for loop if current node is chatPromptTemplate_1
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
continue
|
}
|
||||||
} else if (nodeIds.some((nodeId) => nodeId.includes(flowNodeData.name))) {
|
|
||||||
/*
|
// Only proceed if the parameter is enabled for this node type
|
||||||
* "systemMessagePrompt": {
|
if (!isParameterEnabled(flowNodeData.label, config)) {
|
||||||
* "chatPromptTemplate_0": "You are an assistant" <---- continue for loop if current node is chatPromptTemplate_1
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only proceed if the parameter is enabled for this node type
|
|
||||||
if (!isParameterEnabled(flowNodeData.label, config)) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
let paramValue = inputsObj[config]
|
let paramValue = inputsObj[config]
|
||||||
const overrideConfigValue = overrideConfig[config]
|
const overrideConfigValue = overrideConfig[config]
|
||||||
if (overrideConfigValue) {
|
if (overrideConfigValue) {
|
||||||
|
|||||||
Reference in New Issue
Block a user