Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)
Python
Update model selection order
Abi Raja50ac3be8bf08
diff --git a/backend/routes/generate_code.py b/backend/routes/generate_code.pyindex d06ef342..2f9ca4ac 100644--- a/backend/routes/generate_code.py+++ b/backend/routes/generate_code.py@@ -398,7 +398,14 @@ class ModelSelectionStage:# Define models based on available API keysif gemini_api_key and anthropic_api_key and openai_api_key:- if generation_type == "update":+ if input_mode == "text" and generation_type == "create":+ models = [+ Llm.GEMINI_3_FLASH_PREVIEW_MINIMAL,+ Llm.GPT_5_2_CODEX_HIGH,+ Llm.CLAUDE_OPUS_4_6,+ Llm.GEMINI_3_PRO_PREVIEW_LOW,+ ]+ elif generation_type == "update":models = [Llm.GEMINI_3_FLASH_PREVIEW_MINIMAL,Llm.GPT_5_2_CODEX_HIGH,diff --git a/backend/tests/test_model_selection.py b/backend/tests/test_model_selection.pyindex 2e17ede5..72be4cd1 100644--- a/backend/tests/test_model_selection.py+++ b/backend/tests/test_model_selection.py@@ -26,8 +26,27 @@ class TestModelSelectionAllKeys:expected = [Llm.GEMINI_3_FLASH_PREVIEW_MINIMAL,Llm.GPT_5_2_CODEX_HIGH,- Llm.GEMINI_3_PRO_PREVIEW_HIGH,- Llm.GEMINI_3_FLASH_PREVIEW_HIGH,+ Llm.CLAUDE_OPUS_4_6,+ Llm.GEMINI_3_PRO_PREVIEW_LOW,+ ]+ assert models == expected++ @pytest.mark.asyncio+ async def test_gemini_anthropic_update_text(self):+ """All keys text update: uses edit-specific model mix."""+ models = await self.model_selector.select_models(+ generation_type="update",+ input_mode="text",+ openai_api_key="key",+ anthropic_api_key="key",+ gemini_api_key="key",+ )++ expected = [+ Llm.GEMINI_3_FLASH_PREVIEW_MINIMAL,+ Llm.GPT_5_2_CODEX_HIGH,+ Llm.CLAUDE_SONNET_4_6,+ Llm.GPT_5_2_CODEX_LOW,]assert models == expected