Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
|
@@ -882,8 +882,8 @@ def approve_project_plan(project_id):
|
|
| 882 |
logger.info(f"[PROJECT APPROVAL] Response preview: {combined_text[:300]}...")
|
| 883 |
|
| 884 |
# More robust regex patterns with error handling - updated for your production format
|
| 885 |
-
tools_match = re.search(r"TOOLS AND MATERIALS:\s*(.*?)\s*(?=STEPS\(|STEPS
|
| 886 |
-
steps_match = re.search(r"STEPS\([^)]*\):\s*(.*)|STEPS
|
| 887 |
|
| 888 |
if not tools_match:
|
| 889 |
logger.error(f"[PROJECT APPROVAL] ERROR: Could not find TOOLS AND MATERIALS section in AI response")
|
|
|
|
| 882 |
logger.info(f"[PROJECT APPROVAL] Response preview: {combined_text[:300]}...")
|
| 883 |
|
| 884 |
# More robust regex patterns with error handling - updated for your production format
|
| 885 |
+
tools_match = re.search(r"TOOLS AND MATERIALS:\s*(.*?)\s*(?=STEPS\s*\(|STEPS\s*:|$)", combined_text, re.DOTALL | re.IGNORECASE)
|
| 886 |
+
steps_match = re.search(r"STEPS\s*\([^)]*\):\s*(.*)|STEPS\s*:\s*(.*)", combined_text, re.DOTALL | re.IGNORECASE)
|
| 887 |
|
| 888 |
if not tools_match:
|
| 889 |
logger.error(f"[PROJECT APPROVAL] ERROR: Could not find TOOLS AND MATERIALS section in AI response")
|