Skip to content

Commit 0bf09bf

Browse files
committed
feat: check chart config None
1 parent caf05aa commit 0bf09bf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

backend/apps/chat/task/llm.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,8 @@ def check_save_sql(self, res: str) -> str:
700700
def check_save_chart(self, res: str) -> Dict[str, Any]:
701701

702702
json_str = extract_nested_json(res)
703+
if json_str is None:
704+
raise Exception("Cannot parse chart config from answer")
703705
data = orjson.loads(json_str)
704706

705707
chart: Dict[str, Any] = {}

0 commit comments

Comments
 (0)