FrederickSundeep commited on
Commit
c972896
·
1 Parent(s): 4ac204f

issue fixed 001

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -316,8 +316,11 @@ def chat_stream_doc():
316
  reply = generate_full_reply(prompt, [])
317
 
318
  # ✅ Extract filenames and code from reply
319
- file_pattern = r"(?<=^|\n)```(?P<lang>[a-z]*)\s*file=(?P<name>[^\n]+)\n(?P<code>[\s\S]+?)```"
320
- matches = re.finditer(file_pattern, reply, re.MULTILINE)
 
 
 
321
 
322
  if not matches:
323
  return jsonify({"error": "No files found in generated output."}), 500
 
316
  reply = generate_full_reply(prompt, [])
317
 
318
  # ✅ Extract filenames and code from reply
319
+ file_pattern = r"### File: (.+?)\n```(.*?)```"
320
+ matches = re.finditer(file_pattern, reply, re.DOTALL)
321
+ for match in matches:
322
+ filename = match.group(1).strip()
323
+ code = match.group(2).strip()
324
 
325
  if not matches:
326
  return jsonify({"error": "No files found in generated output."}), 500