Spaces:
Running
Running
Pulastya B
commited on
Commit
·
2b44beb
1
Parent(s):
f762f73
Add comprehensive debug logging for report extraction and merging
Browse files- src/orchestrator.py +9 -0
src/orchestrator.py
CHANGED
|
@@ -1093,13 +1093,19 @@ You are a DOER. Complete workflows based on user intent."""
|
|
| 1093 |
|
| 1094 |
# === COLLECT REPORT FILES ===
|
| 1095 |
elif "report" in tool.lower() or "dashboard" in tool.lower():
|
|
|
|
|
|
|
| 1096 |
if "output_path" in nested_result:
|
| 1097 |
report_path = nested_result["output_path"]
|
|
|
|
| 1098 |
artifacts["reports"].append({
|
| 1099 |
"name": tool.replace("_", " ").title(),
|
| 1100 |
"path": report_path,
|
| 1101 |
"url": f"/outputs/{report_path.replace('./outputs/', '')}"
|
| 1102 |
})
|
|
|
|
|
|
|
|
|
|
| 1103 |
|
| 1104 |
# === COLLECT VISUALIZATION FILES (interactive plots, charts, etc.) ===
|
| 1105 |
elif "plot" in tool.lower() or "visualiz" in tool.lower() or "chart" in tool.lower() or "heatmap" in tool.lower() or "scatter" in tool.lower() or "histogram" in tool.lower():
|
|
@@ -1402,6 +1408,7 @@ You are a DOER. Complete workflows based on user intent."""
|
|
| 1402 |
|
| 1403 |
# 🔥 MERGE REPORTS INTO PLOTS ARRAY FOR FRONTEND DISPLAY
|
| 1404 |
# Frontend expects everything viewable in result.plots array
|
|
|
|
| 1405 |
for report in artifacts["reports"]:
|
| 1406 |
plots.append({
|
| 1407 |
"title": report["name"],
|
|
@@ -1410,6 +1417,8 @@ You are a DOER. Complete workflows based on user intent."""
|
|
| 1410 |
})
|
| 1411 |
print(f"[DEBUG] Added report to plots array: title='{report['name']}', url='{report['url']}'")
|
| 1412 |
|
|
|
|
|
|
|
| 1413 |
return {
|
| 1414 |
"text": "\n".join(summary_lines),
|
| 1415 |
"metrics": metrics,
|
|
|
|
| 1093 |
|
| 1094 |
# === COLLECT REPORT FILES ===
|
| 1095 |
elif "report" in tool.lower() or "dashboard" in tool.lower():
|
| 1096 |
+
print(f"[DEBUG] Report tool detected: {tool}")
|
| 1097 |
+
print(f"[DEBUG] nested_result keys: {list(nested_result.keys())}")
|
| 1098 |
if "output_path" in nested_result:
|
| 1099 |
report_path = nested_result["output_path"]
|
| 1100 |
+
print(f"[DEBUG] Report output_path: {report_path}")
|
| 1101 |
artifacts["reports"].append({
|
| 1102 |
"name": tool.replace("_", " ").title(),
|
| 1103 |
"path": report_path,
|
| 1104 |
"url": f"/outputs/{report_path.replace('./outputs/', '')}"
|
| 1105 |
})
|
| 1106 |
+
print(f"[DEBUG] Added to artifacts[reports], total reports: {len(artifacts['reports'])}")
|
| 1107 |
+
else:
|
| 1108 |
+
print(f"[DEBUG] No output_path in nested_result for report tool")
|
| 1109 |
|
| 1110 |
# === COLLECT VISUALIZATION FILES (interactive plots, charts, etc.) ===
|
| 1111 |
elif "plot" in tool.lower() or "visualiz" in tool.lower() or "chart" in tool.lower() or "heatmap" in tool.lower() or "scatter" in tool.lower() or "histogram" in tool.lower():
|
|
|
|
| 1408 |
|
| 1409 |
# 🔥 MERGE REPORTS INTO PLOTS ARRAY FOR FRONTEND DISPLAY
|
| 1410 |
# Frontend expects everything viewable in result.plots array
|
| 1411 |
+
print(f"[DEBUG] Merging {len(artifacts['reports'])} reports into plots array")
|
| 1412 |
for report in artifacts["reports"]:
|
| 1413 |
plots.append({
|
| 1414 |
"title": report["name"],
|
|
|
|
| 1417 |
})
|
| 1418 |
print(f"[DEBUG] Added report to plots array: title='{report['name']}', url='{report['url']}'")
|
| 1419 |
|
| 1420 |
+
print(f"[DEBUG] Final plots array length: {len(plots)}")
|
| 1421 |
+
|
| 1422 |
return {
|
| 1423 |
"text": "\n".join(summary_lines),
|
| 1424 |
"metrics": metrics,
|