mirror of
https://github.com/OMGeeky/gpt-pilot.git
synced 2026-02-23 15:49:50 +01:00
Fixes for parsing GPT response
This commit is contained in:
@@ -145,6 +145,12 @@ def replace_functions(obj):
|
||||
else:
|
||||
return obj
|
||||
|
||||
def fix_json(s):
|
||||
s = s.replace('True', 'true')
|
||||
s = s.replace('False', 'false')
|
||||
# s = s.replace('`', '"')
|
||||
return fix_json_newlines(s)
|
||||
|
||||
def fix_json_newlines(s):
|
||||
pattern = r'("(?:\\\\n|\\.|[^"\\])*")'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user