Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)
Python
Simplify screenshot system prompt
Abi Raja3635b402c00b
diff --git a/backend/prompts/__init__.py b/backend/prompts/__init__.pyindex de508ad0..846bf304 100644--- a/backend/prompts/__init__.py+++ b/backend/prompts/__init__.py@@ -3,7 +3,7 @@ from openai.types.chat import ChatCompletionMessageParam, ChatCompletionContentPfrom custom_types import InputModefrom prompts.imported_code_prompts import IMPORTED_CODE_SYSTEM_PROMPTS-from prompts.screenshot_system_prompts import SYSTEM_PROMPTS+from prompts.screenshot_system_prompts import SYSTEM_PROMPTfrom prompts.text_prompts import SYSTEM_PROMPTS as TEXT_SYSTEM_PROMPTSfrom prompts.claude_prompts import GEMINI_VIDEO_PROMPTfrom prompts.types import Stack, PromptContent@@ -66,7 +66,7 @@ async def create_prompt(ChatCompletionMessageParam,{"role": "system",- "content": SYSTEM_PROMPTS[stack],+ "content": SYSTEM_PROMPT,},)]@@ -152,7 +152,7 @@ def assemble_prompt(stack: Stack,text_prompt: str = "",) -> list[ChatCompletionMessageParam]:- system_content = SYSTEM_PROMPTS[stack]+ system_content = SYSTEM_PROMPTuser_prompt = USER_PROMPT# Append optional text instructions if provideddiff --git a/backend/prompts/screenshot_system_prompts.py b/backend/prompts/screenshot_system_prompts.pyindex 71924fc2..75879efb 100644--- a/backend/prompts/screenshot_system_prompts.py+++ b/backend/prompts/screenshot_system_prompts.py@@ -1,7 +1,4 @@-from prompts.types import SystemPrompts---HTML_TAILWIND_SYSTEM_PROMPT = """+SYSTEM_PROMPT = """You are an expert frontend developer.You particularly specialize in taking screenshots and then replicating them exactly in code as single page appsusing Tailwind, HTML and JS.@@ -84,12 +81,3 @@ Tooling instructions:- Use retrieve_option to fetch the full HTML for a specific option (1-based option_number) when a user references another option.- Any non-tool output should be short, user-facing chat updates."""--SYSTEM_PROMPTS = SystemPrompts(- html_css=HTML_TAILWIND_SYSTEM_PROMPT,- html_tailwind=HTML_TAILWIND_SYSTEM_PROMPT,- react_tailwind=HTML_TAILWIND_SYSTEM_PROMPT,- bootstrap=HTML_TAILWIND_SYSTEM_PROMPT,- ionic_tailwind=HTML_TAILWIND_SYSTEM_PROMPT,- vue_tailwind=HTML_TAILWIND_SYSTEM_PROMPT,-)diff --git a/backend/tests/test_prompts.py b/backend/tests/test_prompts.pyindex 96ee8e31..a889bed5 100644--- a/backend/tests/test_prompts.py+++ b/backend/tests/test_prompts.py@@ -91,10 +91,7 @@ class TestCreatePrompt:"generationType": "create",}- # Mock the system prompts- mock_system_prompts: Dict[str, str] = {self.TEST_STACK: self.MOCK_SYSTEM_PROMPT}-- with patch("prompts.SYSTEM_PROMPTS", mock_system_prompts):+ with patch("prompts.SYSTEM_PROMPT", self.MOCK_SYSTEM_PROMPT):# Call the functionmessages = await create_prompt(stack=self.TEST_STACK,@@ -148,10 +145,7 @@ class TestCreatePrompt:],}- # Mock the system prompts and image cache function- mock_system_prompts = {self.TEST_STACK: self.MOCK_SYSTEM_PROMPT}-- with patch("prompts.SYSTEM_PROMPTS", mock_system_prompts):+ with patch("prompts.SYSTEM_PROMPT", self.MOCK_SYSTEM_PROMPT):# Call the functionmessages = await create_prompt(stack=self.TEST_STACK,@@ -379,10 +373,7 @@ class TestCreatePrompt:]}- # Mock the system prompts and image cache function- mock_system_prompts: Dict[str, str] = {self.TEST_STACK: self.MOCK_SYSTEM_PROMPT}-- with patch("prompts.SYSTEM_PROMPTS", mock_system_prompts):+ with patch("prompts.SYSTEM_PROMPT", self.MOCK_SYSTEM_PROMPT):# Call the functionmessages = await create_prompt(stack=self.TEST_STACK,@@ -454,10 +445,7 @@ class TestCreatePrompt:]}- # Mock the system prompts and image cache function- mock_system_prompts: Dict[str, str] = {self.TEST_STACK: self.MOCK_SYSTEM_PROMPT}-- with patch("prompts.SYSTEM_PROMPTS", mock_system_prompts):+ with patch("prompts.SYSTEM_PROMPT", self.MOCK_SYSTEM_PROMPT):# Call the functionmessages = await create_prompt(stack=self.TEST_STACK,@@ -534,10 +522,7 @@ class TestCreatePrompt:]}- # Mock the system prompts and image cache function- mock_system_prompts: Dict[str, str] = {self.TEST_STACK: self.MOCK_SYSTEM_PROMPT}-- with patch("prompts.SYSTEM_PROMPTS", mock_system_prompts):+ with patch("prompts.SYSTEM_PROMPT", self.MOCK_SYSTEM_PROMPT):# Call the functionmessages = await create_prompt(stack=self.TEST_STACK,diff --git a/backend/tests/test_prompts_additional.py b/backend/tests/test_prompts_additional.pyindex f5a25e57..a7cd1b5e 100644--- a/backend/tests/test_prompts_additional.py+++ b/backend/tests/test_prompts_additional.py@@ -97,10 +97,7 @@ class TestCreatePromptImageSupport:]}- # Mock the system prompts and image cache function- mock_system_prompts: Dict[str, str] = {self.TEST_STACK: self.MOCK_SYSTEM_PROMPT}-- with patch("prompts.SYSTEM_PROMPTS", mock_system_prompts):+ with patch("prompts.SYSTEM_PROMPT", self.MOCK_SYSTEM_PROMPT):# Call the functionmessages = await create_prompt(stack=self.TEST_STACK,@@ -177,10 +174,7 @@ class TestCreatePromptImageSupport:]}- # Mock the system prompts and image cache function- mock_system_prompts: Dict[str, str] = {self.TEST_STACK: self.MOCK_SYSTEM_PROMPT}-- with patch("prompts.SYSTEM_PROMPTS", mock_system_prompts):+ with patch("prompts.SYSTEM_PROMPT", self.MOCK_SYSTEM_PROMPT):# Call the functionmessages = await create_prompt(stack=self.TEST_STACK,