Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -270,10 +270,6 @@ def ask_question(message, history):
|
|
| 270 |
advisory_prompt = (
|
| 271 |
"Use the PolicyRetrievalRAG tool to extract the most relevant clauses from the policy document. "
|
| 272 |
"Always base your response strictly on the actual policy content—do not fabricate or assume.\n\n"
|
| 273 |
-
|
| 274 |
-
"All advice must be grounded in Indian medical insurance standards and practices, "
|
| 275 |
-
"as defined by the IRDAI (Insurance Regulatory and Development Authority of India). "
|
| 276 |
-
"If the policy appears to deviate from IRDAI norms, flag this clearly.\n\n"
|
| 277 |
|
| 278 |
"Respond strictly in this structured Markdown format:\n\n"
|
| 279 |
|
|
@@ -339,27 +335,43 @@ with gr.Blocks(theme='shivi/calm_seafoam', title="📄 Insurance Policy AIdvisor
|
|
| 339 |
)
|
| 340 |
|
| 341 |
with gr.Tab("💬 Chatbot"):
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 348 |
)
|
| 349 |
-
|
| 350 |
-
)
|
| 351 |
-
|
| 352 |
-
gr.Examples(
|
| 353 |
-
examples=[
|
| 354 |
-
"In what forms are the certificate avalaible?",
|
| 355 |
-
"How many employees should enroll if the member is to not contribute premium?",
|
| 356 |
-
"Can insurer contest this policy?",
|
| 357 |
-
"when can insurer make changes to the policy?",
|
| 358 |
-
"I gave incorrect age in the policy, what to do now?",
|
| 359 |
-
"Can the data I filled in the application form to get the insurance policy be used against me?"
|
| 360 |
-
],
|
| 361 |
-
inputs=chat.textbox
|
| 362 |
-
)
|
| 363 |
|
| 364 |
with gr.Tab("System Design"):
|
| 365 |
gr.Image(value="AIdvisor_devcon.png")
|
|
|
|
| 270 |
advisory_prompt = (
|
| 271 |
"Use the PolicyRetrievalRAG tool to extract the most relevant clauses from the policy document. "
|
| 272 |
"Always base your response strictly on the actual policy content—do not fabricate or assume.\n\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 273 |
|
| 274 |
"Respond strictly in this structured Markdown format:\n\n"
|
| 275 |
|
|
|
|
| 335 |
)
|
| 336 |
|
| 337 |
with gr.Tab("💬 Chatbot"):
|
| 338 |
+
with gr.Row():
|
| 339 |
+
with gr.Column():
|
| 340 |
+
gr.Examples(
|
| 341 |
+
examples=[
|
| 342 |
+
"In what forms are the certificate avalaible?",
|
| 343 |
+
"How many employees should enroll if the member is to not contribute premium?",
|
| 344 |
+
"Can insurer contest this policy?",
|
| 345 |
+
"when can insurer make changes to the policy?",
|
| 346 |
+
"I gave incorrect age in the policy, what to do now?",
|
| 347 |
+
"Can the data I filled in the application form to get the insurance policy be used against me?",
|
| 348 |
+
"What are the eligibility criteria for dependent life insurance?",
|
| 349 |
+
"When does the life insurance coverage terminate for a member?",
|
| 350 |
+
"Is the insurer allowed to contest the policy after two years?",
|
| 351 |
+
"Can I convert my group policy to an individual life insurance plan?",
|
| 352 |
+
"How is the death benefit amount affected if I receive accelerated benefits?",
|
| 353 |
+
"What happens if my dependent child turns 26 but is physically handicapped?",
|
| 354 |
+
"Is proof of good health required if I request insurance after 31 days of eligibility?",
|
| 355 |
+
"What is the process for reinstating my policy after a leave of absence?",
|
| 356 |
+
"What support services are included along with the insurance plan?",
|
| 357 |
+
"What happens if I stop paying my premium?",
|
| 358 |
+
"Can the insurer make changes to the policy without my consent?",
|
| 359 |
+
"How are premium rates determined and can they change?",
|
| 360 |
+
"Are there any benefits if I die in an accident while wearing a seatbelt?",
|
| 361 |
+
"What information does the insurer need from the policyholder?"
|
| 362 |
+
],
|
| 363 |
+
inputs=chat.textbox
|
| 364 |
+
)
|
| 365 |
+
with gr.column():
|
| 366 |
+
chat = gr.ChatInterface(fn=ask_question,
|
| 367 |
+
title = "🤖 AIdvisor",
|
| 368 |
+
chatbot=gr.Chatbot(
|
| 369 |
+
avatar_images=(
|
| 370 |
+
"https://em-content.zobj.net/source/twitter/141/parrot_1f99c.png", # User
|
| 371 |
+
"https://em-content.zobj.net/source/twitter/141/robot-face_1f916.png" # Bot
|
| 372 |
+
)
|
| 373 |
)
|
| 374 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 375 |
|
| 376 |
with gr.Tab("System Design"):
|
| 377 |
gr.Image(value="AIdvisor_devcon.png")
|