From b6308ee3214ecae8001c93b0d713a4bfa8d2aac6 Mon Sep 17 00:00:00 2001 From: Henry Date: Sat, 12 Oct 2024 21:26:03 +0100 Subject: [PATCH] parse vars from overrideconfig to JSON --- packages/server/src/utils/buildChatflow.ts | 3 +++ packages/server/src/utils/upsertVector.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/packages/server/src/utils/buildChatflow.ts b/packages/server/src/utils/buildChatflow.ts index 90297076f46..3257f0a8a9e 100644 --- a/packages/server/src/utils/buildChatflow.ts +++ b/packages/server/src/utils/buildChatflow.ts @@ -184,6 +184,9 @@ export const utilBuildChatflow = async (req: Request, isInternal: boolean = fals fs.unlinkSync(file.path) } + if (overrideConfig.vars && typeof overrideConfig.vars === 'string') { + overrideConfig.vars = JSON.parse(overrideConfig.vars) + } incomingInput = { question: req.body.question ?? 'hello', overrideConfig diff --git a/packages/server/src/utils/upsertVector.ts b/packages/server/src/utils/upsertVector.ts index 044716e74a8..c0e5e4d98f3 100644 --- a/packages/server/src/utils/upsertVector.ts +++ b/packages/server/src/utils/upsertVector.ts @@ -89,6 +89,9 @@ export const upsertVector = async (req: Request, isInternal: boolean = false) => fs.unlinkSync(file.path) } + if (overrideConfig.vars && typeof overrideConfig.vars === 'string') { + overrideConfig.vars = JSON.parse(overrideConfig.vars) + } incomingInput = { question: req.body.question ?? 'hello', overrideConfig,