Update app.py
Browse files
app.py
CHANGED
|
@@ -234,15 +234,8 @@ def upload_and_chat(file, query):
|
|
| 234 |
|
| 235 |
initial_prompt = PromptTemplate(
|
| 236 |
input_variables=["text"],
|
| 237 |
-
template="""
|
| 238 |
|
| 239 |
-
Read the content below and produce a structured summary suitable for non-experts. Your summary must follow this format:
|
| 240 |
-
- Start with a 1–2 sentence overview of the whole document.
|
| 241 |
-
- Then present the most important 3–7 insights as a plain-text bullet list (use "- ", avoid Markdown formatting).
|
| 242 |
-
- Do not include background or filler content.
|
| 243 |
-
- Avoid using `*`, `**`, or heading symbols like `##`.
|
| 244 |
-
|
| 245 |
-
--- Document ---
|
| 246 |
{text}
|
| 247 |
|
| 248 |
--- Summary ---
|
|
@@ -253,12 +246,7 @@ refine_prompt = PromptTemplate(
|
|
| 253 |
template="""You already have an existing summary:
|
| 254 |
{existing_answer}
|
| 255 |
|
| 256 |
-
Refine the summary based on the new content below. Add or update information only if it's relevant. Keep it concise
|
| 257 |
-
|
| 258 |
-
Maintain the same style:
|
| 259 |
-
- Start with a 1–2 sentence overview (if applicable)
|
| 260 |
-
- Use plain text bullet points (with "- "), not Markdown symbols
|
| 261 |
-
- Avoid headings like `##`, `**`, `*`, or numbered lists.
|
| 262 |
|
| 263 |
{text}
|
| 264 |
|
|
|
|
| 234 |
|
| 235 |
initial_prompt = PromptTemplate(
|
| 236 |
input_variables=["text"],
|
| 237 |
+
template="""Write a concise and structured summary of the following content. Focus on capturing the main ideas and key details:
|
| 238 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 239 |
{text}
|
| 240 |
|
| 241 |
--- Summary ---
|
|
|
|
| 246 |
template="""You already have an existing summary:
|
| 247 |
{existing_answer}
|
| 248 |
|
| 249 |
+
Refine the summary based on the new content below. Add or update information only if it's relevant. Keep it concise:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 250 |
|
| 251 |
{text}
|
| 252 |
|