Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -78,28 +78,28 @@ async def lifespan(app: FastAPI):
|
|
| 78 |
max_output_tokens=300
|
| 79 |
)
|
| 80 |
ml_models["prompt_template"] = ChatPromptTemplate.from_template("""
|
| 81 |
-
**Role**: You are an expert decision
|
| 82 |
-
Do not use your own knowledge.
|
| 83 |
-
**Context**:
|
| 84 |
-
{context}
|
| 85 |
|
| 86 |
-
**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
|
| 88 |
-
|
| 89 |
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
response: A grace period of thirty days is provided for premium payment after the due date to renew or continue the policy without losing continuity benefits.
|
| 93 |
|
| 94 |
-
|
| 95 |
-
response: There is a waiting period of thirty-six (36) months of continuous coverage from the first policy inception for pre-existing diseases and their direct complications to be covered.
|
| 96 |
|
| 97 |
-
|
| 98 |
-
|
| 99 |
|
| 100 |
-
|
| 101 |
-
response: Yes, the policy covers maternity expenses, including childbirth and lawful medical termination of pregnancy. To be eligible, the female insured person must have been continuously covered for at least 24 months. The benefit is limited to two deliveries or terminations during the policy period.
|
| 102 |
|
|
|
|
| 103 |
"""
|
| 104 |
)
|
| 105 |
print("✅ Models and prompt loaded successfully!")
|
|
|
|
| 78 |
max_output_tokens=300
|
| 79 |
)
|
| 80 |
ml_models["prompt_template"] = ChatPromptTemplate.from_template("""
|
| 81 |
+
**Role**: You are an expert decision-maker assistant in domains such as insurance, legal compliance, human resources, and contract management.
|
|
|
|
|
|
|
|
|
|
| 82 |
|
| 83 |
+
**Instructions**:
|
| 84 |
+
- Use **only** the provided context to answer the query. Do **not** use prior knowledge or assumptions.
|
| 85 |
+
- Provide a **direct, complete, and accurate** answer.
|
| 86 |
+
- Do **not** mention document IDs, page numbers, or say "Based on the document..."
|
| 87 |
+
- Avoid bullet points. Respond in clear, well-formed sentences.
|
| 88 |
+
- If relevant, use the exact language from the policy clauses in a natural way.
|
| 89 |
|
| 90 |
+
---
|
| 91 |
|
| 92 |
+
**Context**:
|
| 93 |
+
{context}
|
|
|
|
| 94 |
|
| 95 |
+
---
|
|
|
|
| 96 |
|
| 97 |
+
**Customer Query**:
|
| 98 |
+
{full_query}
|
| 99 |
|
| 100 |
+
---
|
|
|
|
| 101 |
|
| 102 |
+
**Response**:
|
| 103 |
"""
|
| 104 |
)
|
| 105 |
print("✅ Models and prompt loaded successfully!")
|