Update app.py
Browse files
app.py
CHANGED
@@ -234,13 +234,13 @@ def upload_and_chat(file, query):
|
|
234 |
|
235 |
initial_prompt = PromptTemplate(
|
236 |
input_variables=["text"],
|
237 |
-
template="""
|
238 |
-
You are a document summarisation expert. Read the following text and extract the most important ideas, conclusions, and key facts.
|
239 |
|
240 |
-
|
241 |
-
-
|
242 |
-
-
|
243 |
-
-
|
|
|
244 |
|
245 |
--- Document ---
|
246 |
{text}
|
@@ -250,15 +250,15 @@ Return a **concise, bullet-point summary** in **British English**.
|
|
250 |
)
|
251 |
refine_prompt = PromptTemplate(
|
252 |
input_variables=["existing_answer", "text"],
|
253 |
-
template="""
|
254 |
-
You already have an existing summary:
|
255 |
{existing_answer}
|
256 |
|
257 |
-
Refine the summary based on the new content below. Add or update information only if it's relevant.
|
258 |
|
259 |
-
|
260 |
-
-
|
261 |
-
-
|
|
|
262 |
|
263 |
{text}
|
264 |
|
|
|
234 |
|
235 |
initial_prompt = PromptTemplate(
|
236 |
input_variables=["text"],
|
237 |
+
template="""You are a document summarisation expert.
|
|
|
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}
|
|
|
250 |
)
|
251 |
refine_prompt = PromptTemplate(
|
252 |
input_variables=["existing_answer", "text"],
|
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 |
|