Spaces:
Sleeping
Sleeping
Commit
·
7b32b5c
1
Parent(s):
53ff958
Updated
Browse files
main.py
CHANGED
|
@@ -72,23 +72,38 @@ autodoc_template = """You are DevAssist DocBot.
|
|
| 72 |
Code: {code}
|
| 73 |
Documentation:"""
|
| 74 |
|
| 75 |
-
sme_template = """
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
{
|
| 83 |
"files": {
|
| 84 |
-
"index.html": "
|
| 85 |
-
"style.css": "
|
| 86 |
-
"script.js": "
|
| 87 |
},
|
| 88 |
-
"README.md": "# Instructions
|
| 89 |
}
|
| 90 |
"""
|
| 91 |
|
|
|
|
| 92 |
# --------- CHAINS ----------
|
| 93 |
chat_prompt = PromptTemplate(input_variables=["question"], template=chat_template)
|
| 94 |
stt_prompt = PromptTemplate(input_variables=["speech"], template=stt_chat_template)
|
|
|
|
| 72 |
Code: {code}
|
| 73 |
Documentation:"""
|
| 74 |
|
| 75 |
+
sme_template = """
|
| 76 |
+
You are an SME site builder AI.
|
| 77 |
+
Your job is to turn ANY user prompt (simple or complex) into a working, modern web project.
|
| 78 |
+
You must analyze the request carefully and generate clean, professional, and responsive code.
|
| 79 |
+
|
| 80 |
+
🔑 Rules:
|
| 81 |
+
1. Always return ONLY valid JSON (no explanations, no Markdown).
|
| 82 |
+
2. Always include "index.html", "style.css", and "script.js" in the "files".
|
| 83 |
+
3. Support multiple pages if the user specifies them in the request.
|
| 84 |
+
4. Style must be modern, vibrant, and responsive:
|
| 85 |
+
- Use semantic HTML5 structure (<header>, <main>, <section>, <footer>).
|
| 86 |
+
- Use CSS with modern fonts, colors, spacing, hover effects, flex/grid layout.
|
| 87 |
+
- Buttons must be styled and interactive.
|
| 88 |
+
- Add responsiveness for mobile.
|
| 89 |
+
5. Translate vague descriptions like “make it futuristic and sharp” into concrete CSS design choices.
|
| 90 |
+
6. If the user’s request is very detailed, honor as much as possible while still keeping valid code.
|
| 91 |
+
|
| 92 |
+
User Prompt:
|
| 93 |
+
{user_prompt}
|
| 94 |
+
|
| 95 |
+
Return ONLY JSON in this exact format:
|
| 96 |
{
|
| 97 |
"files": {
|
| 98 |
+
"index.html": "<!DOCTYPE html> ... </html>",
|
| 99 |
+
"style.css": "/* modern responsive CSS here */",
|
| 100 |
+
"script.js": "// optional interactivity here"
|
| 101 |
},
|
| 102 |
+
"README.md": "# Instructions on how to run the project"
|
| 103 |
}
|
| 104 |
"""
|
| 105 |
|
| 106 |
+
|
| 107 |
# --------- CHAINS ----------
|
| 108 |
chat_prompt = PromptTemplate(input_variables=["question"], template=chat_template)
|
| 109 |
stt_prompt = PromptTemplate(input_variables=["speech"], template=stt_chat_template)
|