Tachi67 commited on
Commit
6c1b6e4
·
1 Parent(s): 4c62421

Update CodeGeneratorAtomicFlow.py

Browse files
Files changed (1) hide show
  1. CodeGeneratorAtomicFlow.py +3 -4
CodeGeneratorAtomicFlow.py CHANGED
@@ -68,10 +68,9 @@ class CodeGeneratorAtomicFlow(ChatAtomicFlow):
68
  response = json.loads(api_output)
69
  return response
70
  except json.decoder.JSONDecodeError:
 
71
  new_input_data = input_data.copy()
72
- new_input_data['goal'] += ("The previous respond cannot be parsed with json.loads, it could be the "
73
- "backslashes used for escaping single quotes in the string arguments of the "
74
- "Python code are not properly escaped themselves within the JSON context. "
75
- "Make sure your next response is in JSON format.")
76
  new_api_output = super().run(new_input_data)["api_output"].strip()
77
  return json.loads(new_api_output)
 
 
68
  response = json.loads(api_output)
69
  return response
70
  except json.decoder.JSONDecodeError:
71
+ new_goal = f"Here is your previous response {api_output}, it cannot be parsed with json.loads, it could be the backslashes usesd for escaping single quotes in the string arguments of the code are not properly escaped themselves within the JSON context. Please fix this issue."
72
  new_input_data = input_data.copy()
73
+ new_input_data['goal'] = new_goal
 
 
 
74
  new_api_output = super().run(new_input_data)["api_output"].strip()
75
  return json.loads(new_api_output)
76
+