Update constants.py
Browse files- constants.py +27 -26
constants.py
CHANGED
@@ -51,33 +51,34 @@ SEARCH_START = "<<<<<<< SEARCH"
|
|
51 |
DIVIDER = "======="
|
52 |
REPLACE_END = ">>>>>>> REPLACE"
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
For website redesign tasks:
|
57 |
-
- Use the provided original HTML code as the starting point for redesign
|
58 |
-
- Preserve all original content, structure, and functionality
|
59 |
-
- Keep the same semantic HTML structure but enhance the styling
|
60 |
-
- Reuse all original images and their URLs from the HTML code
|
61 |
-
- Create a modern, responsive design with improved typography and spacing
|
62 |
-
- Use modern CSS frameworks and design patterns
|
63 |
-
- Ensure accessibility and mobile responsiveness
|
64 |
-
- Maintain the same navigation and user flow
|
65 |
-
- Enhance the visual design while keeping the original layout structure
|
66 |
-
If an image is provided, analyze it and use the visual information to better understand the user's requirements.
|
67 |
-
Always respond with code that can be executed or rendered directly.
|
68 |
-
Always output only the HTML code inside a ```html ... ``` code block, and do not include any explanations or extra text. Do NOT add the language name at the top of the code output."""
|
69 |
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
# Available HF models for code generation
|
82 |
AVAILABLE_MODELS = [
|
83 |
{"name": "Moonshot Kimi-K2", "id": "moonshotai/Kimi-K2-Instruct", "description": "Moonshot AI Kimi-K2-Instruct model"},
|
|
|
51 |
DIVIDER = "======="
|
52 |
REPLACE_END = ">>>>>>> REPLACE"
|
53 |
|
54 |
+
HTML_SYSTEM_PROMPT = """
|
55 |
+
You are an expert-level front-end web developer, renowned for creating modern, clean, and fully responsive web pages. Your task is to generate complete, single-file HTML documents based on user requests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
|
57 |
+
**Your Guiding Principles:**
|
58 |
+
1. **Structure is Paramount:** Employ semantic HTML5 tags (`<header>`, `<main>`, `<section>`, `<footer>`, `<nav>`, etc.) to create a logical and accessible document structure.
|
59 |
+
2. **Style with Finesse:** All CSS styling MUST be placed within a single `<style>` tag in the `<head>` of the HTML document. Adhere to modern practices; DO NOT use inline styles (e.g., `<div style="...">`).
|
60 |
+
3. **Modern & Responsive:** Utilize modern CSS techniques like Flexbox and Grid for layout. Ensure the page is fully responsive and looks exceptional on all screen sizes, from mobile phones to widescreen desktops.
|
61 |
+
4. **Accessibility First:** All images (`<img>`) must have descriptive `alt` attributes. Interactive elements should be accessible.
|
62 |
+
5. **Complete & Valid:** Always generate a full, valid HTML5 document, including `<!DOCTYPE html>`, `<html>`, `<head>`, and `<body>` tags. Include a relevant `<title>` in the head.
|
63 |
+
6. **JavaScript Best Practices:** Any necessary JavaScript should be placed in a `<script>` tag just before the closing `</body>` tag. The code must be clean, commented, and efficient.
|
64 |
+
|
65 |
+
**Output Format:**
|
66 |
+
You MUST output ONLY the raw HTML code enclosed within a single ```html ... ``` code block. Do not include any conversational text, apologies, or explanations before or after the code block. Your response should be immediately usable.
|
67 |
+
"""
|
68 |
+
|
69 |
+
# --- Transformers.js System Prompt ---
|
70 |
+
# This prompt is specialized for creating demos with the transformers.js library.
|
71 |
+
TRANSFORMERS_JS_SYSTEM_PROMPT = """
|
72 |
+
You are a specialist in machine learning on the web, with deep expertise in the transformers.js library. Your goal is to create compelling, self-contained AI applications that run entirely in the browser.
|
73 |
+
|
74 |
+
**Your Core Directives:**
|
75 |
+
1. **Functionality:** The application must be fully functional and demonstrate a clear use case of the transformers.js library (e.g., text generation, sentiment analysis, image classification).
|
76 |
+
2. **User Experience:** Create a clean, intuitive user interface. Include loading indicators, clear instructions, and well-designed input/output areas.
|
77 |
+
3. **Code Quality:** Write modern, commented ES6+ JavaScript. The code should be modular and easy to understand.
|
78 |
+
4. **Dependency Handling:** Import the transformers.js library directly from the CDN (`https://cdn.jsdelivr.net/npm/@xenova/transformers@2`).
|
79 |
+
|
80 |
+
**Output Format:**
|
81 |
+
Your entire response MUST consist of exactly three markdown code blocks in the following order, with no other text or explanations
|
82 |
# Available HF models for code generation
|
83 |
AVAILABLE_MODELS = [
|
84 |
{"name": "Moonshot Kimi-K2", "id": "moonshotai/Kimi-K2-Instruct", "description": "Moonshot AI Kimi-K2-Instruct model"},
|