From 0bf09bfb64d804093efc94d07cbe8fdafc91b1ba Mon Sep 17 00:00:00 2001 From: ulleo Date: Wed, 30 Jul 2025 16:54:20 +0800 Subject: [PATCH] feat: check chart config None --- backend/apps/chat/task/llm.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/apps/chat/task/llm.py b/backend/apps/chat/task/llm.py index 577ecb22..b208f4e2 100644 --- a/backend/apps/chat/task/llm.py +++ b/backend/apps/chat/task/llm.py @@ -700,6 +700,8 @@ class LLMService: def check_save_chart(self, res: str) -> Dict[str, Any]: json_str = extract_nested_json(res) + if json_str is None: + raise Exception("Cannot parse chart config from answer") data = orjson.loads(json_str) chart: Dict[str, Any] = {}