From de060bcc35bbdf2180213e22637eaa070957485d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 6 Sep 2024 07:32:59 +0000 Subject: [PATCH] fix: make sure $schema field always added (#252) * fix: make sure $schema field always added Signed-off-by: Yulong Ruan --------- Signed-off-by: Yulong Ruan (cherry picked from commit e09abdcd5a4f7b6aa9c76d1842ef8937c6a386a2) Signed-off-by: github-actions[bot] --- server/routes/text2viz_routes.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/routes/text2viz_routes.ts b/server/routes/text2viz_routes.ts index 752240df..ec563ffc 100644 --- a/server/routes/text2viz_routes.ts +++ b/server/routes/text2viz_routes.ts @@ -47,6 +47,9 @@ export function registerText2VizRoutes(router: IRouter, assistantService: Assist delete result.width; delete result.height; + // make sure $schema field always been added, sometimes, LLM 'forgot' to add this field + result.$schema = 'https://vega.github.io/schema/vega-lite/v5.json'; + return res.ok({ body: result }); } catch (e) { return res.internalError();