Spaces:
Running
Running
Update app/app.py
Browse files- app/app.py +4 -2
app/app.py
CHANGED
|
@@ -107,11 +107,13 @@ async def chat(query: Query):
|
|
| 107 |
top_score = search_results[0]['relevance_score']
|
| 108 |
logger.info(f"[INFO] Using top {len(context_chunks)} contexts (top score: {top_score:.4f})")
|
| 109 |
|
| 110 |
-
prompt = f"""You are a helpful assistant trained on NEEPCO Delegation of Powers (DoP) policies.
|
|
|
|
|
|
|
| 111 |
### Relevant Context:
|
| 112 |
{context}
|
| 113 |
### Question: {question}
|
| 114 |
-
### Answer:"""
|
| 115 |
|
| 116 |
answer = "Sorry, I couldn't process your request right now. Please try again later."
|
| 117 |
try:
|
|
|
|
| 107 |
top_score = search_results[0]['relevance_score']
|
| 108 |
logger.info(f"[INFO] Using top {len(context_chunks)} contexts (top score: {top_score:.4f})")
|
| 109 |
|
| 110 |
+
prompt = f"""You are a helpful assistant trained on NEEPCO Delegation of Powers (DoP) policies. Answer questions strictly using the provided context.
|
| 111 |
+
If the answer is 'No', explain the specific reason why based on the context.
|
| 112 |
+
If the answer is 'Yes', justify it clearly using the relevant policy. Do not make assumptions beyond the provided text.
|
| 113 |
### Relevant Context:
|
| 114 |
{context}
|
| 115 |
### Question: {question}
|
| 116 |
+
### Detailed Answer:"""
|
| 117 |
|
| 118 |
answer = "Sorry, I couldn't process your request right now. Please try again later."
|
| 119 |
try:
|