Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1320,6 +1320,12 @@ If you find any "Code-Blocks" then,
|
|
| 1320 |
print(f"result:\n\n {result}")
|
| 1321 |
except Exception as e_corr:
|
| 1322 |
logger.error(f"Failed to correct JSON output for even after retry: {e_corr}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1323 |
|
| 1324 |
|
| 1325 |
# Update the original action_plan in the state with the refined version
|
|
@@ -3174,13 +3180,21 @@ def process_pdf():
|
|
| 3174 |
# return jsonify({"message": "Procesed PDF and Game sb3 generated successfully", "project_id": project_id, "download_url": download_url})
|
| 3175 |
return jsonify({
|
| 3176 |
"message": "✅ PDF processed successfully",
|
|
|
|
| 3177 |
"output_json": "output_path",
|
| 3178 |
"sprites": "result",
|
| 3179 |
"project_output_json": "project_output",
|
| 3180 |
"test_url": download_url
|
| 3181 |
})
|
| 3182 |
else:
|
| 3183 |
-
return jsonify(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3184 |
|
| 3185 |
except Exception as e:
|
| 3186 |
logger.error(f"Error during processing the pdf workflow for project ID {project_id}: {e}", exc_info=True)
|
|
|
|
| 1320 |
print(f"result:\n\n {result}")
|
| 1321 |
except Exception as e_corr:
|
| 1322 |
logger.error(f"Failed to correct JSON output for even after retry: {e_corr}")
|
| 1323 |
+
result = {
|
| 1324 |
+
"refined_logic": {
|
| 1325 |
+
"name_variable": "Error",
|
| 1326 |
+
"pseudocode": "Processing failed"
|
| 1327 |
+
}
|
| 1328 |
+
}
|
| 1329 |
|
| 1330 |
|
| 1331 |
# Update the original action_plan in the state with the refined version
|
|
|
|
| 3180 |
# return jsonify({"message": "Procesed PDF and Game sb3 generated successfully", "project_id": project_id, "download_url": download_url})
|
| 3181 |
return jsonify({
|
| 3182 |
"message": "✅ PDF processed successfully",
|
| 3183 |
+
"isError": False,
|
| 3184 |
"output_json": "output_path",
|
| 3185 |
"sprites": "result",
|
| 3186 |
"project_output_json": "project_output",
|
| 3187 |
"test_url": download_url
|
| 3188 |
})
|
| 3189 |
else:
|
| 3190 |
+
return jsonify({
|
| 3191 |
+
"message": "❌ Scanned images are not clear please retry!",
|
| 3192 |
+
"isError": True,
|
| 3193 |
+
"output_json": "output_path",
|
| 3194 |
+
"sprites": "result",
|
| 3195 |
+
"project_output_json": "project_output",
|
| 3196 |
+
"test_url": download_url
|
| 3197 |
+
}), 500
|
| 3198 |
|
| 3199 |
except Exception as e:
|
| 3200 |
logger.error(f"Error during processing the pdf workflow for project ID {project_id}: {e}", exc_info=True)
|