mirror of
https://github.com/aljazceru/dev-gpt.git
synced 2025-12-19 14:44:20 +01:00
🪓 feat: sub task refinement
This commit is contained in:
15
dev_gpt/options/generate/parser.py
Normal file
15
dev_gpt/options/generate/parser.py
Normal file
@@ -0,0 +1,15 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user