diff --git a/src/chat/knowledge/src/utils/json_fix.py b/src/chat/knowledge/src/utils/json_fix.py index dd91499ee..53fa8f36f 100644 --- a/src/chat/knowledge/src/utils/json_fix.py +++ b/src/chat/knowledge/src/utils/json_fix.py @@ -1,6 +1,7 @@ import json from json_repair import repair_json + def _find_unclosed(json_str): """ Identifies the unclosed braces and brackets in the JSON string. @@ -94,4 +95,4 @@ def new_fix_broken_generated_json(json_str: str) -> str: return json_str # 如果有效则按原样返回 except json.JSONDecodeError: # 如果无效,则尝试修复它 - return repair_json(json_str) \ No newline at end of file + return repair_json(json_str)