Conversation
PrakharDoneria
left a comment
There was a problem hiding this comment.
ModuleNotFoundError: No module named 'fuzzy_json'
PrakharDoneria
left a comment
There was a problem hiding this comment.
please add all required modules in requirements.txt
|
sure will do that |
|
Removed dependency on This improves portability and simplifies the dependency tree. |
|
Made a few changes in the ai_engine.py file and i implemented robust JSON extraction strategies with fallback handling for malformed AI responses and enhanced input validation. |
|
@PrakharDoneria Basically the ai_engine.py code is running successfully in my system but its not opening the web UI builder properly. Like its just showing a blank page in my Mac but i shared the changes i have made so far in case it worked for you. I am trying to rectify it and i'll send the updated code in few days because its still showing a blank page |
|
@Parthavi19 the process to check working of |


Root Cause:
The extract_json() function attempted to parse the entire response string as JSON, even when the AI returned:
Explanations before/after the JSON block
Extra characters after the valid JSON
Solution:
Updated extract_json() to safely extract the first complete JSON block using a bracket-counting method.
Stripped any markdown/code fences using regular expressions.
Retained fuzzy_json as a fallback for resilience.
Added better logging and error handling for transparency.
Changes Made:
Enhanced extract_json() logic to prevent partial/extra-data parsing.
Improved log outputs for cleaned and parsed responses.
Strengthened prompt instructions in generate_code_from_prompt() to avoid malformed responses.