mirror of
https://github.com/aljazceru/dev-gpt.git
synced 2025-12-20 07:04:20 +01:00
➕ refactor: summarize error message without line number
This commit is contained in:
@@ -17,9 +17,8 @@ def boolean_parser(x):
|
||||
return 'yes' in x.lower()
|
||||
|
||||
def json_parser(x):
|
||||
if '```' in x:
|
||||
pattern = r'([\[\{].+[\]\}])'
|
||||
x = re.findall(pattern, x, re.DOTALL)[-1]
|
||||
pattern = r'([\[\{].*[\]\}])'
|
||||
x = re.findall(pattern, x, re.DOTALL)[-1]
|
||||
return json.loads(x)
|
||||
|
||||
def self_healing_json_parser(original_json_string):
|
||||
|
||||
Reference in New Issue
Block a user