Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)
Python
Print backend debug status on start
Abi Rajac0c1adbe65c3
diff --git a/backend/main.py b/backend/main.pyindex 192ef220..245b0f27 100644--- a/backend/main.py+++ b/backend/main.py@@ -6,10 +6,17 @@ load_dotenv()from fastapi import FastAPIfrom fastapi.middleware.cors import CORSMiddleware+from config import IS_DEBUG_ENABLEDfrom routes import screenshot, generate_code, home, evalsapp = FastAPI(openapi_url=None, docs_url=None, redoc_url=None)+[email protected]_event("startup")+async def log_debug_mode() -> None:+ debug_status = "ENABLED" if IS_DEBUG_ENABLED else "DISABLED"+ print(f"Backend startup complete. Debug mode is {debug_status}.")+# Configure CORS settingsapp.add_middleware(CORSMiddleware,diff --git a/backend/routes/generate_code.py b/backend/routes/generate_code.pyindex d2f8025e..dfa511a6 100644--- a/backend/routes/generate_code.py+++ b/backend/routes/generate_code.py@@ -10,6 +10,7 @@ from codegen.utils import extract_html_contentfrom config import (ANTHROPIC_API_KEY,GEMINI_API_KEY,+ IS_DEBUG_ENABLED,IS_PROD,NUM_VARIANTS,NUM_VARIANTS_VIDEO,@@ -729,13 +730,14 @@ class CodeGenerationMiddleware(Middleware):anthropic_api_key=context.extracted_params.anthropic_api_key,gemini_api_key=GEMINI_API_KEY,)- await context.send_message(- "variantModels",- None,- 0,- {"models": [model.value for model in context.variant_models]},- None,- )+ if IS_DEBUG_ENABLED:+ await context.send_message(+ "variantModels",+ None,+ 0,+ {"models": [model.value for model in context.variant_models]},+ None,+ )generation_stage = AgenticGenerationStage(send_message=context.send_message,