File tree 1 file changed +4
-3
lines changed
packages/server/src/utils
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -493,13 +493,14 @@ export const clearSessionMemory = async (
493
493
* @returns {string }
494
494
*/
495
495
export const getVariableValue = (
496
- paramValue : string ,
496
+ paramValue : string | object ,
497
497
reactFlowNodes : IReactFlowNode [ ] ,
498
498
question : string ,
499
499
chatHistory : IMessage [ ] ,
500
500
isAcceptVariable = false
501
501
) => {
502
- let returnVal = paramValue
502
+ const isObject = typeof paramValue === 'object'
503
+ let returnVal = isObject ? JSON . stringify ( paramValue ) : paramValue
503
504
const variableStack = [ ]
504
505
const variableDict = { } as IVariableDict
505
506
let startIdx = 0
@@ -596,7 +597,7 @@ export const getVariableValue = (
596
597
} )
597
598
return returnVal
598
599
}
599
- return returnVal
600
+ return isObject ? JSON . parse ( returnVal ) : returnVal
600
601
}
601
602
602
603
/**
You can’t perform that action at this time.
0 commit comments