diff --git a/backend/main.py b/backend/main.py
index 4b75f71..b8e3f4f 100644
--- a/backend/main.py
+++ b/backend/main.py
@@ -70,11 +70,13 @@ async def stream_code(websocket: WebSocket):
print("Received params")
# Read the output settings from the request. Fall back to default if not provided.
- output_settings = {"css": "tailwind", "js": "vanilla"}
+ output_settings = {"css": "tailwind", "js": "vanilla" , "components" : "html"}
if params["outputSettings"] and params["outputSettings"]["css"]:
output_settings["css"] = params["outputSettings"]["css"]
if params["outputSettings"] and params["outputSettings"]["js"]:
output_settings["js"] = params["outputSettings"]["js"]
+ if params["outputSettings"] and params["outputSettings"]["components"]:
+ output_settings["components"] = params["outputSettings"]["components"]
print("Using output settings:", output_settings)
# Get the OpenAI API key from the request. Fall back to environment variable if not provided.
diff --git a/backend/prompts.py b/backend/prompts.py
index f01eb7e..fe3ba9e 100644
--- a/backend/prompts.py
+++ b/backend/prompts.py
@@ -77,6 +77,40 @@ Return only the full code in tags.
Do not include markdown "```" or "```html" at the start or end.
"""
+IONIC_TAILWIND_SYSTEM_PROMPT = """
+You are an expert Ionic/Tailwind developer
+You take screenshots of a reference web page from the user, and then build single page apps
+using Ionic and Tailwind CSS.
+You might also be given a screenshot(The second image) of a web page that you have already built, and asked to
+update it to look more like the reference image(The first image).
+
+- Make sure the app looks exactly like the screenshot.
+- Pay close attention to background color, text color, font size, font family,
+padding, margin, border, etc. Match the colors and sizes exactly.
+- Use the exact text from the screenshot.
+- Do not add comments in the code such as "" and "" in place of writing the full code. WRITE THE FULL CODE.
+- Repeat elements as needed to match the screenshot. For example, if there are 15 items, the code should have 15 items. DO NOT LEAVE comments like "" or bad things will happen.
+- For images, use placeholder images from https://placehold.co and include a detailed description of the image in the alt text so that an image generation AI can generate the image later.
+
+In terms of libraries,
+
+- Use these script to include Ionic so that it can run on a standalone page:
+
+
+
+- Use this script to include Tailwind:
+- You can use Google Fonts
+- ionicons for icons, add the following
+
+
+
+Return only the full code in tags.
+Do not include markdown "```" or "```html" at the start or end.
+"""
+
USER_PROMPT = """
Generate code for a web page that looks exactly like this.
"""
@@ -92,6 +126,9 @@ def assemble_prompt(image_data_url, output_settings: dict, result_image_data_url
if output_settings["js"] == "react":
chosen_prompt_name = "react-tailwind"
system_content = REACT_TAILWIND_SYSTEM_PROMPT
+ if output_settings["components"] == "ionic":
+ chosen_prompt_name = "ionic-tailwind"
+ system_content = IONIC_TAILWIND_SYSTEM_PROMPT
print("Using system prompt:", chosen_prompt_name)