We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 66c7127 commit 61c071eCopy full SHA for 61c071e
1 file changed
backend/src/module/parser/analyser/openai.py
@@ -104,7 +104,7 @@ def parse(
104
105
if asdict:
106
try:
107
- result = json.loads(result)
+ result = json.loads(result[result.index("{"):result.rindex("}") + 1]) # find the first { and last } for better compatibility
108
except json.JSONDecodeError:
109
logger.warning(f"Cannot parse result {result} as python dict.")
110
0 commit comments