victor HF Staff commited on
Commit
3395169
·
1 Parent(s): 24c2853

Enhance redesign function documentation and examples; clarify user instructions for targeted redesign approaches

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -126,7 +126,7 @@ def redesign_html(html_input: str, user_prompt: str = "") -> str:
126
  html_input (str): The HTML code with TailwindCSS classes to be redesigned.
127
  Can include React/Vue/Svelte/Angular syntax which will be preserved.
128
  user_prompt (str, optional): Custom instructions for the redesign process.
129
- Examples: "make it more colorful", "add animations",
130
  "make it minimal", "improve mobile layout".
131
  If empty, uses default redesign approach.
132
 
@@ -161,7 +161,7 @@ def redesign_html(html_input: str, user_prompt: str = "") -> str:
161
  user_content = html_input
162
  if user_prompt.strip():
163
  user_content = f"User instructions: {user_prompt.strip()}\n\nHTML to redesign:\n{html_input}"
164
-
165
  messages = [
166
  {"role": "system", "content": SYSTEM_PROMPT},
167
  {"role": "user", "content": user_content},
@@ -242,6 +242,8 @@ demo = gr.Interface(
242
 
243
  This is an MCP (Model Context Protocol) server that provides HTML redesign capabilities to LLMs.
244
 
 
 
245
  **IMPORTANT FOR LLM USAGE:** This tool should only be activated when users explicitly request to "redesign" HTML code.
246
  Users must use the word "redesign" or similar intent (e.g., "improve the design", "make it look better") for this tool to be used.
247
 
@@ -251,21 +253,22 @@ demo = gr.Interface(
251
  - Maintains framework syntax (React, Vue, Svelte, Angular)
252
  - Supports dark mode when present in input
253
  - Mobile-first responsive design implementation
 
254
 
255
  **Usage:** LLMs can use this tool when users ask to redesign HTML code by providing the HTML as input.
256
  """,
257
  examples=[
258
  [
259
  "Make it more modern and colorful",
260
- '<div class="p-4 border"><h1 class="text-xl">Welcome</h1><p>This is a basic card</p><button class="bg-blue-500 text-white px-4 py-2">Click me</button></div>'
261
  ],
262
  [
263
  "Add subtle animations and improve spacing",
264
- '<form class="space-y-4"><input type="email" placeholder="Email" class="border p-2 w-full"><input type="password" placeholder="Password" class="border p-2 w-full"><button type="submit" class="bg-green-500 text-white p-2">Login</button></form>'
265
  ],
266
  [
267
  "",
268
- '<nav class="flex justify-between p-4 bg-gray-100"><div class="font-bold">Logo</div><ul class="flex space-x-4"><li><a href="#" class="text-blue-500">Home</a></li><li><a href="#" class="text-blue-500">About</a></li></ul></nav>'
269
  ],
270
  ],
271
  css=custom_css,
 
126
  html_input (str): The HTML code with TailwindCSS classes to be redesigned.
127
  Can include React/Vue/Svelte/Angular syntax which will be preserved.
128
  user_prompt (str, optional): Custom instructions for the redesign process.
129
+ Examples: "make it more colorful", "add animations",
130
  "make it minimal", "improve mobile layout".
131
  If empty, uses default redesign approach.
132
 
 
161
  user_content = html_input
162
  if user_prompt.strip():
163
  user_content = f"User instructions: {user_prompt.strip()}\n\nHTML to redesign:\n{html_input}"
164
+
165
  messages = [
166
  {"role": "system", "content": SYSTEM_PROMPT},
167
  {"role": "user", "content": user_content},
 
242
 
243
  This is an MCP (Model Context Protocol) server that provides HTML redesign capabilities to LLMs.
244
 
245
+ **Powered by DeepSeek-V3-0324** - An advanced model specifically excellent at UI/UX design tasks.
246
+
247
  **IMPORTANT FOR LLM USAGE:** This tool should only be activated when users explicitly request to "redesign" HTML code.
248
  Users must use the word "redesign" or similar intent (e.g., "improve the design", "make it look better") for this tool to be used.
249
 
 
253
  - Maintains framework syntax (React, Vue, Svelte, Angular)
254
  - Supports dark mode when present in input
255
  - Mobile-first responsive design implementation
256
+ - Custom user instructions for targeted redesign approaches
257
 
258
  **Usage:** LLMs can use this tool when users ask to redesign HTML code by providing the HTML as input.
259
  """,
260
  examples=[
261
  [
262
  "Make it more modern and colorful",
263
+ '<div class="p-4 border"><h1 class="text-xl">Welcome</h1><p>This is a basic card</p><button class="bg-blue-500 text-white px-4 py-2">Click me</button></div>',
264
  ],
265
  [
266
  "Add subtle animations and improve spacing",
267
+ '<form class="space-y-4"><input type="email" placeholder="Email" class="border p-2 w-full"><input type="password" placeholder="Password" class="border p-2 w-full"><button type="submit" class="bg-green-500 text-white p-2">Login</button></form>',
268
  ],
269
  [
270
  "",
271
+ '<nav class="flex justify-between p-4 bg-gray-100"><div class="font-bold">Logo</div><ul class="flex space-x-4"><li><a href="#" class="text-blue-500">Home</a></li><li><a href="#" class="text-blue-500">About</a></li></ul></nav>',
272
  ],
273
  ],
274
  css=custom_css,