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 = ''