Spaces:
Sleeping
Sleeping
Commit ·
c972896
1
Parent(s): 4ac204f
issue fixed 001
Browse files
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"(?
|
| 320 |
-
matches = re.finditer(file_pattern, reply, re.
|
|
|
|
|
|
|
|
|
|
| 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
|