KeenWoo commited on
Commit
3b4c562
·
verified ·
1 Parent(s): 6228821

Update alz_companion/prompts.py

Browse files
Files changed (1) hide show
  1. alz_companion/prompts.py +25 -17
alz_companion/prompts.py CHANGED
@@ -279,14 +279,12 @@ Your response MUST be based ONLY on the information in the 'General Guidance' an
279
  1. Your final answer MUST be in {language}.
280
  2. Adopt the **concise, warm, and validating** tone described in the 'Response Tone Guidelines'. If the Patient's Name is provided, use it to make the opening more personal and direct.
281
  3. The response must be a single, natural-sounding paragraph between 2 and 4 sentences.
282
- 4. Follow this three-part structure for the paragraph:
283
- - Start with a varied, empathetic opening that validates the user’s feeling or concern.
284
- Do not reuse the same first sentence across turns.
285
- Invent fresh openings in each response, such as: acknowledging frustration, naming the emotion, or affirming their experience.
286
- Do not copy example text verbatim.
287
- - Gently offer 1-2 of the most important practical steps from the provided context.
288
- - **If possible, weave details from the 'Relevant Personal Memories' into your suggestions to make the response feel more personal and familiar.**
289
- - End with a compassionate, de-escalating phrase.
290
  5. **CRITICAL:** Do not include any preambles, headings, or labels like "My response is...". Address the user directly and naturally.
291
  """
292
 
@@ -394,9 +392,15 @@ User's Request: {question}
394
 
395
  ---
396
  INSTRUCTIONS FOR THE AI:
397
- --- CRITICAL RULE ---
398
- You MUST NOT add any facts or details that are not in the 'Source excerpts' above. Your task is ONLY to summarize the provided text.
 
 
 
 
399
  ---
 
 
400
  **Formatting and Content Rules:**
401
  1. Your final summary MUST be in {language}.
402
  2. Write a succinct summary that is tailored to the user's request, addressing the user by their role. For example, "Of course, {caregiver_name}, here is a summary about {patient_name}..."
@@ -420,18 +424,22 @@ INSTRUCTIONS FOR THE AI:
420
  --- CRITICAL RULE ---
421
  Your final answer MUST be based ONLY on the provided 'Context'. Do not invent any details.
422
  ---
 
423
  1. **Reasoning Process:** First, silently follow these steps to plan your answer.
424
- - Carefully compare and cross-check evidence from all context passages.
425
- - Identify any agreements or contradictions in the information.
426
- - Formulate a clear and concise plan to answer the user's question based ONLY on the provided evidence.
 
427
 
428
  2. **Show Your Work:** Next, write out your step-by-step thinking process inside the <thinking> block below.
429
 
430
  3. **Final Answer Rules:** After the <thinking> block, write the final answer for the user.
431
- - The answer MUST be in {language}.
432
- - The tone must be warm, natural, and friendly.
433
- - If the context does not contain enough information to answer, state that gently.
434
- - **CRITICAL:** Output ONLY the final paragraph. Do not include the <thinking> block, headings, reasoning steps, or any labels like "Final Answer:".
 
 
435
  ---
436
 
437
  <thinking>
 
279
  1. Your final answer MUST be in {language}.
280
  2. Adopt the **concise, warm, and validating** tone described in the 'Response Tone Guidelines'. If the Patient's Name is provided, use it to make the opening more personal and direct.
281
  3. The response must be a single, natural-sounding paragraph between 2 and 4 sentences.
282
+ # --- MODIFICATION START ---
283
+ 4. Follow this explicit three-part structure for the paragraph:
284
+ A. **Validate:** Start with a varied, empathetic opening that validates the user’s feeling or concern.
285
+ B. **Inform with Example:** Next, provide helpful context by briefly referencing a specific, illustrative example from the 'General Guidance' section to show the user this is a known situation (e.g., "This is a common experience; in one story, a character named Anthony often hid his watch when he felt confused.").
286
+ C. **Advise:** Finally, offer 1-2 clear, practical steps from the context that the caregiver can take. If possible, weave in details from 'Relevant Personal Memories' to personalize the advice.
287
+ # --- END OF MODIFICATION ---
 
 
288
  5. **CRITICAL:** Do not include any preambles, headings, or labels like "My response is...". Address the user directly and naturally.
289
  """
290
 
 
392
 
393
  ---
394
  INSTRUCTIONS FOR THE AI:
395
+ # --- MODIFICATION START ---
396
+ --- CRITICAL INSTRUCTIONS ---
397
+ 1. Your ONLY task is to summarize the 'Source excerpts' to directly answer the 'User's Request'.
398
+ 2. **You MUST NOT add any facts or details that are not in the 'Source excerpts'.**
399
+ 3. **CRITICAL:** If the user asks for a summary of a specific time period (e.g., "yesterday", "last three days") or a specific topic (e.g., "daily routine", "word-finding difficulties"), you MUST filter the context and summarize ONLY the information relevant to that specific request.
400
+ 4. **DO NOT provide a general character summary of the person's entire life unless that is what was explicitly asked for.**
401
  ---
402
+ # --- END OF MODIFICATION ---
403
+
404
  **Formatting and Content Rules:**
405
  1. Your final summary MUST be in {language}.
406
  2. Write a succinct summary that is tailored to the user's request, addressing the user by their role. For example, "Of course, {caregiver_name}, here is a summary about {patient_name}..."
 
424
  --- CRITICAL RULE ---
425
  Your final answer MUST be based ONLY on the provided 'Context'. Do not invent any details.
426
  ---
427
+ # --- MODIFICATION START ---
428
  1. **Reasoning Process:** First, silently follow these steps to plan your answer.
429
+ - Scan all context passages to find any and all pieces of information relevant to the user's question.
430
+ - Synthesize the facts. If different sources provide different pieces of a complete answer, you must combine them.
431
+ - Identify if the information is present but separate (e.g., one source mentions Person A, another mentions Person B).
432
+ - Formulate a clear and concise plan to answer the user's question based ONLY on the provided evidence.
433
 
434
  2. **Show Your Work:** Next, write out your step-by-step thinking process inside the <thinking> block below.
435
 
436
  3. **Final Answer Rules:** After the <thinking> block, write the final answer for the user.
437
+ - The answer MUST be in {language}.
438
+ - The tone must be warm, natural, and friendly.
439
+ - If you combine information from different places, present it as a single, helpful answer.
440
+ - If the context does not contain enough information to answer, state that gently.
441
+ - **CRITICAL:** Output ONLY the final paragraph. Do not include the <thinking> block, headings, reasoning steps, or any labels like "Final Answer:".
442
+ # --- END OF MODIFICATION ---
443
  ---
444
 
445
  <thinking>