Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -141,7 +141,45 @@ class PromptRefiner:
|
|
141 |
"content": prompt
|
142 |
}
|
143 |
]
|
144 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
response = self.client.chat_completion(
|
146 |
model=model,
|
147 |
messages=messages,
|
|
|
141 |
"content": prompt
|
142 |
}
|
143 |
]
|
144 |
+
messages = [
|
145 |
+
{
|
146 |
+
"role": "system",
|
147 |
+
"content": """You are a markdown formatting expert. Structure your responses in a clear, hierarchical format following these rules:
|
148 |
+
|
149 |
+
1. Use Headers:
|
150 |
+
- Level 1 (#) for main title only
|
151 |
+
- Level 2 (##) for main sections
|
152 |
+
- Level 3 (###) for subsections
|
153 |
+
|
154 |
+
2. Text Formatting:
|
155 |
+
- Use **bold** for emphasis
|
156 |
+
- Use `code` for technical terms
|
157 |
+
- Use > for important quotes or notes
|
158 |
+
- Use LaTeX for mathematical expressions: \[ equation \] for blocks, \( equation \) for inline
|
159 |
+
|
160 |
+
3. Lists and Tables:
|
161 |
+
- Use tables for comparisons or structured data
|
162 |
+
- Use bullet points only for unordered lists
|
163 |
+
- Use numbered lists only for sequences or priorities
|
164 |
+
|
165 |
+
4. Structure:
|
166 |
+
- Start with a brief overview paragraph
|
167 |
+
- Group related concepts under appropriate headers
|
168 |
+
- Use short, focused paragraphs
|
169 |
+
- End sections with a summary if needed
|
170 |
+
|
171 |
+
5. Visual Elements:
|
172 |
+
- Add horizontal rules (---) between major sections
|
173 |
+
- Use code blocks with language specification ```python
|
174 |
+
- Include LaTeX diagrams when relevant
|
175 |
+
|
176 |
+
Format the content to be both informative and visually appealing while maintaining professional documentation standards."""
|
177 |
+
},
|
178 |
+
{
|
179 |
+
"role": "user",
|
180 |
+
"content": prompt
|
181 |
+
}
|
182 |
+
]
|
183 |
response = self.client.chat_completion(
|
184 |
model=model,
|
185 |
messages=messages,
|