mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 21:00:58 +03:00
Merge pull request #1843 from mokeyish/patch-6
Fix the failure to resolve variables for OverrideConfig(Json Object)
This commit is contained in:
@@ -493,13 +493,14 @@ export const clearSessionMemory = async (
|
|||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
export const getVariableValue = (
|
export const getVariableValue = (
|
||||||
paramValue: string,
|
paramValue: string | object,
|
||||||
reactFlowNodes: IReactFlowNode[],
|
reactFlowNodes: IReactFlowNode[],
|
||||||
question: string,
|
question: string,
|
||||||
chatHistory: IMessage[],
|
chatHistory: IMessage[],
|
||||||
isAcceptVariable = false
|
isAcceptVariable = false
|
||||||
) => {
|
) => {
|
||||||
let returnVal = paramValue
|
const isObject = typeof paramValue === 'object'
|
||||||
|
let returnVal = isObject ? JSON.stringify(paramValue) : paramValue
|
||||||
const variableStack = []
|
const variableStack = []
|
||||||
const variableDict = {} as IVariableDict
|
const variableDict = {} as IVariableDict
|
||||||
let startIdx = 0
|
let startIdx = 0
|
||||||
@@ -596,7 +597,7 @@ export const getVariableValue = (
|
|||||||
})
|
})
|
||||||
return returnVal
|
return returnVal
|
||||||
}
|
}
|
||||||
return returnVal
|
return isObject ? JSON.parse(returnVal) : returnVal
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user