mirror of https://github.com/Mai-with-u/MaiBot.git
🤖 自动格式化代码 [skip ci]
parent
e82a5f7d47
commit
6730b60e0a
|
|
@ -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)
|
||||
return repair_json(json_str)
|
||||
|
|
|
|||
Loading…
Reference in New Issue