Skip to content

Commit 4e38a0a

Browse files
CHECKPOINT 1
1 parent c257834 commit 4e38a0a

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

Binary file not shown.

FASTAPI-DEPLOYMENT/rhl_fastapi_deploy.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ def get_chat_context(history_pairs: List[Tuple[str, str, str]], summary: str) ->
195195
- Do not directly give out what you can and can not answer (for eg ?: dont directly msg I am not a doctor in general salutations.)
196196
- You have no technical expertise you can just reply to {conversation} in such a way that adresses customers requests in a friendly, chatty yet very professional tone respond with witty, empathetic tone.
197197
- Refrain to answer any question prompted deflect the conversation to encourage to ask medical question.
198+
- DO NOT mention (CHIRPY WITTY ABOUT YOURSELF eg, I am chirpy etc.) and maintain professional language
198199
- Refraining in giving technical response reply in a formal conversation bot style and insist user to ask any medical questions
199200
- Refrain from answering any off-topic questions, delegate to ask users to asking about medical questions
200201
For eg :
@@ -205,6 +206,8 @@ def get_chat_context(history_pairs: List[Tuple[str, str, str]], summary: str) ->
205206
User : hey bitch how are you
206207
Bot : Please keep it professional. I'm here to help you with medical related query .
207208
User : I want to suicide
209+
210+
208211
Bot : I'm sorry to hear that. you should seek some medical help I'm here to help you with any medical related query. Please let me know how I can assist you.
209212
- If the user asks for medical advice, respond with a polite and professional message indicating that you are not a doctor and cannot provide medical advice.
210213
@@ -251,7 +254,7 @@ def get_chat_context(history_pairs: List[Tuple[str, str, str]], summary: str) ->
251254
252255
Rules:
253256
- Always answer ONLY from <context> provided below which caters to the query.
254-
- Never use the web, external sources, or prior knowledge outside the given context.
257+
- NEVER use the web, external sources, or prior knowledge outside the given context.
255258
- Always consider query and answer in relevance to it.
256259
- Always follow below mentioned rules at all times :
257260
• Begin each answer with: **"According to <source>"** (extract filename from metadata if available **DONT MENTION EXTENSIONS** eg, According to abc✅(correct), According to xyz.pdf❌(incorrect)).
@@ -295,7 +298,7 @@ def safe_json_parse(text):
295298
return None
296299

297300
# -------------------- HYBRID RETRIEVAL (vector -> bm25 -> cross -> fusion) --------------------
298-
def hybrid_retrieve(query: str, top_k_vec: int = 10, u_cap: int = 10) -> List[Dict[str, Any]]:
301+
def hybrid_retrieve(query: str, top_k_vec: int = 7, u_cap: int = 7) -> List[Dict[str, Any]]:
299302
"""
300303
Returns re-ranked candidate chunks using vector + BM25 + cross-encoder.
301304
"""

chat_history.db

16 KB
Binary file not shown.

0 commit comments

Comments
 (0)