fix output prediction output parser

This commit is contained in:
Henry
2024-01-19 14:27:40 +00:00
parent a4f7d5f6d2
commit 31a4769079
3 changed files with 38 additions and 5 deletions
@@ -80,6 +80,17 @@ class CustomFunction_Utilities implements INode {
}
}
// Some values might be a stringified JSON, parse it
for (const key in inputVars) {
if (typeof inputVars[key] === 'string' && inputVars[key].startsWith('{') && inputVars[key].endsWith('}')) {
try {
inputVars[key] = JSON.parse(inputVars[key])
} catch (e) {
continue
}
}
}
let sandbox: any = { $input: input }
sandbox['$vars'] = prepareSandboxVars(variables)
sandbox['$flow'] = flow