Skip to content

Commit 90d40e1

Browse files
authored
Merge pull request #1843 from mokeyish/patch-6
Fix the failure to resolve variables for OverrideConfig(Json Object)
2 parents 13ee0d0 + 5f7efd3 commit 90d40e1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/server/src/utils/index.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -493,13 +493,14 @@ export const clearSessionMemory = async (
493493
* @returns {string}
494494
*/
495495
export const getVariableValue = (
496-
paramValue: string,
496+
paramValue: string | object,
497497
reactFlowNodes: IReactFlowNode[],
498498
question: string,
499499
chatHistory: IMessage[],
500500
isAcceptVariable = false
501501
) => {
502-
let returnVal = paramValue
502+
const isObject = typeof paramValue === 'object'
503+
let returnVal = isObject ? JSON.stringify(paramValue) : paramValue
503504
const variableStack = []
504505
const variableDict = {} as IVariableDict
505506
let startIdx = 0
@@ -596,7 +597,7 @@ export const getVariableValue = (
596597
})
597598
return returnVal
598599
}
599-
return returnVal
600+
return isObject ? JSON.parse(returnVal) : returnVal
600601
}
601602

602603
/**

0 commit comments

Comments
 (0)