Skip to content

Commit

Permalink
fix: make sure $schema field always added (#252)
Browse files Browse the repository at this point in the history
* fix: make sure $schema field always added

Signed-off-by: Yulong Ruan <[email protected]>

---------

Signed-off-by: Yulong Ruan <[email protected]>
(cherry picked from commit e09abdc)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Sep 6, 2024
1 parent 6cce85d commit de060bc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/routes/text2viz_routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit de060bc

Please sign in to comment.