From ea63d703221096ba3a085025c724f86f580c26c5 Mon Sep 17 00:00:00 2001 From: ulleo Date: Wed, 30 Jul 2025 13:49:53 +0800 Subject: [PATCH] feat: check sql 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 3311c9f8..e758fa93 100644 --- a/backend/apps/chat/task/llm.py +++ b/backend/apps/chat/task/llm.py @@ -672,6 +672,8 @@ class LLMService: self.chart_message]).decode()) def check_sql(self, res: str) -> tuple[any]: json_str = extract_nested_json(res) + if json_str is None: + raise Exception("Cannot parse sql from answer") data: dict = orjson.loads(json_str) sql = '' message = ''