Shiva-teja-chary commited on
Commit
4ce25fd
·
verified ·
1 Parent(s): b5d0847

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +8 -7
main.py CHANGED
@@ -158,13 +158,14 @@ User text: {user_text}
158
  cleaned = clean_json(raw)
159
 
160
  try:
161
- parsed = json.loads(cleaned)
162
- return remove_nulls(parsed)
163
- except json.JSONDecodeError:
164
- return {
165
- "error": "Invalid JSON from model",
166
- "raw": raw
167
- }
 
168
 
169
  except Exception as e:
170
  return {
 
158
  cleaned = clean_json(raw)
159
 
160
  try:
161
+ parsed = json.loads(cleaned)
162
+ return remove_nulls(parsed)
163
+
164
+ except json.JSONDecodeError:
165
+ return {
166
+ "error": "Invalid JSON from model",
167
+ "raw": raw
168
+ }
169
 
170
  except Exception as e:
171
  return {