mirror of
https://github.com/aljazceru/dev-gpt.git
synced 2025-12-19 14:44:20 +01:00
16 lines
262 B
Python
16 lines
262 B
Python
import json
|
|
import re
|
|
|
|
|
|
def identity_parser(x):
|
|
return x
|
|
|
|
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]
|
|
return json.loads(x)
|