nithinare commited on
Commit
66aa2ce
·
verified ·
1 Parent(s): 1e9f372

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -20
app.py CHANGED
@@ -43,29 +43,41 @@ def initialize():
43
  )
44
 
45
  prompt = ChatPromptTemplate.from_template("""
46
- you health insurance advisor.
47
- you need to understand the query and context.and then answer.
48
- try to answer below query in answer format which ever is applicable
49
- you can use your knowledge for disease names similarity
50
- *does it cover
51
- *if yes,how?if no ,why?
52
- *if it is uncertain .try to put possibities
53
- format:
54
- covered:yes/no/partially/on-condition
55
- give the summary of below things
56
- waht is that coverage:
57
- how:
58
- why:
59
- citiation:
60
-
61
- try to from context not generalised answer .
62
-
63
- Context:
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  {context}
65
 
66
- Question:
67
  {input}
68
-
69
  """)
70
 
71
  doc_chain = create_stuff_documents_chain(llm, prompt)
 
43
  )
44
 
45
  prompt = ChatPromptTemplate.from_template("""
46
+ You are a strict retrieval-based Insurance Policy Assistant.
47
+
48
+ You MUST follow these constraints:
49
+
50
+ - Use ONLY the provided context.
51
+ - Do NOT rely on external knowledge.
52
+ - Do NOT infer beyond what is explicitly stated.
53
+ - If answer is missing → respond exactly:
54
+ "Not found in document"
55
+ - If partially available but unclear → respond:
56
+ "Uncertain based on provided context"
57
+
58
+ DECISION RULES:
59
+ - "Yes" → explicitly covered in context
60
+ - "No" → explicitly excluded in context
61
+ - "Uncertain" → not clearly stated or conflicting info
62
+
63
+ OUTPUT FORMAT (STRICT):
64
+
65
+ Coverage: <Yes / No / Uncertain>
66
+
67
+ Explanation:
68
+ - Step-by-step reasoning from context
69
+ - Include all relevant conditions, exclusions, and scenarios
70
+
71
+ Reference:
72
+ - Exact supporting lines or summarized clauses from context
73
+
74
+ ---
75
+
76
+ CONTEXT:
77
  {context}
78
 
79
+ QUESTION:
80
  {input}
 
81
  """)
82
 
83
  doc_chain = create_stuff_documents_chain(llm, prompt)