Skip to content

Commit 3e18ca1

Browse files
Tightened response length
1 parent 3691ad3 commit 3e18ca1

File tree

6 files changed

+108
-746
lines changed

6 files changed

+108
-746
lines changed
Binary file not shown.
-30.1 KB
Binary file not shown.

FASTAPI-DEPLOYMENT/rhl_fastapi_v2_modify.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ async def _background_update_and_save(user_id: str, user_message: str, bot_reply
265265
266266
CLASSIFICATION RULES:
267267
- MEDICAL_QUESTION: any standalone question about medical facts, diagnoses, treatments, NEWBORN CARE, or women's health
268+
- MEDICAL_QUESTION : Even if user asks multiple times about the same MEDICAL TOPIC, it should be considered as a MEDICAL_QUESTION
268269
- FOLLOW_UP: short responses to previous assistant suggestions (yes, sure, prevention please, etc.)
269270
- CHITCHAT: greetings, thanks, smalltalk, profanity, non-medical topics, or explicit "stop" requests OR ANYTHING WHICH IS NON-MEDICAL OR NON_FOLLOWUP
270271
@@ -523,11 +524,13 @@ async def _background_update_and_save(user_id: str, user_message: str, bot_reply
523524
- Begin with: **"According to <source(s)>"** (extract filename, NO extensions)
524525
- Single source: "According to abc"
525526
- Multiple sources: "According to abc, def, ghi"
526-
- Use bullet and sub-bullet points (4-5 if sufficient info, minimum 3)
527+
- BE VERY PRECISE AND CONCISE IN ANSWER FRAMING STRUICTLY ANSWER WHAT HAS BEEN ASKED (STRICTLY FROM THE CONTEXT PROVIDED AND NOT FROM OPEN WEB) IN MAXIUMUM OF 150-200 WORDS (SO CHOOSE WISELY) AND AVOID PROVIDING IRRELEVANT INFORMATION
528+
- Use bullet and sub-bullet points (MAXIMUM 5 POINTS MINIMUM)
527529
- Each bullet should be a complete, meaningful point
528530
- Combine related information from multiple sources into single bullets
529531
- Ensure logical flow: Related points should be adjacent
530532
533+
531534
STEP 4 - FOLLOW-UP QUESTION (MANDATORY IF context_followup PROVIDED):
532535
- If <context_followup> is non-empty, you MUST include a follow-up question
533536
- Format: "Would you like to know about <topic from context_followup>?" (without bullet points, at the end of answer)
@@ -582,6 +585,14 @@ async def _background_update_and_save(user_id: str, user_message: str, bot_reply
582585
• Itchy skin (pruritus) may occur in some cases
583586
584587
---
588+
Example 4 - Precise Answer Formatting:
589+
Query: "Oxytocin dosage"
590+
591+
Expected answer : * The recommended dosage for postpartum hemorrhage management is 10 IU by IM/IV bolus injection, administered slowly over 1-2 minutes if IV access is available. ✅
592+
* For induction or augmentation of labor, oxytocin can be infused at a concentration of 2.5 units in 500 mL of dextrose or normal saline, starting at 2.5 mIU per minute and increasing by 2.5 mIU per minute every 30 minutes until a good contraction pattern is established. ✅
593+
594+
Not Expected answer : * Oxytocin is an injectable uterotonic drug used to cause uterine contractions, assisting in the separation of the placenta and stopping postpartum bleeding.. ❌
595+
* It is recommended for actively managing the third stage of labor and should be given within one minute of the birth of the last baby. ❌
585596
586597
Example 3 - Multi-Source Consolidation (WRONG - DON'T DO THIS):
587598
Query: "What are the symptoms of jaundice?"

0 commit comments

Comments
 (0)