Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,10 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
# Program explanation map
|
| 3 |
-
|
| 4 |
-
"medicaid": "Medicaid (called Apple Health in Washington) is a free or low-cost health coverage program for eligible low-income adults, children, pregnant women, and people with disabilities.",
|
| 5 |
-
"medicare": "Medicare is a federal health insurance program mainly for people age 65 or older and certain younger people with disabilities.",
|
| 6 |
-
"aca": "ACA subsidies are financial help from the Affordable Care Act that reduce your monthly insurance premium based on your income.",
|
| 7 |
-
}
|
| 8 |
# Load clinic info (organized by county)
|
| 9 |
with open("info.txt", "r", encoding="utf-8") as file:
|
| 10 |
clinic_data = file.read().lower()
|
|
@@ -47,6 +43,12 @@ def chatbot(message, history):
|
|
| 47 |
for key in program_explanations:
|
| 48 |
if key in message:
|
| 49 |
return program_explanations[key] + "\n\nAnything else you'd like help with?"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
# EXPLANATION TRIGGER FIX
|
| 51 |
if any(phrase in message for phrase in ["what does that mean", "what's that", "explain", "what is that"]):
|
| 52 |
program = conversation_state.get("last_eligible_program")
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
# Program explanation map
|
| 3 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
# Load clinic info (organized by county)
|
| 5 |
with open("info.txt", "r", encoding="utf-8") as file:
|
| 6 |
clinic_data = file.read().lower()
|
|
|
|
| 43 |
for key in program_explanations:
|
| 44 |
if key in message:
|
| 45 |
return program_explanations[key] + "\n\nAnything else you'd like help with?"
|
| 46 |
+
|
| 47 |
+
program_explanations = {
|
| 48 |
+
"medicaid": "Medicaid (called Apple Health in Washington) is a free or low-cost health coverage program for eligible low-income adults, children, pregnant women, and people with disabilities.",
|
| 49 |
+
"medicare": "Medicare is a federal health insurance program mainly for people age 65 or older and certain younger people with disabilities.",
|
| 50 |
+
"aca": "ACA subsidies are financial help from the Affordable Care Act that reduce your monthly insurance premium based on your income.",
|
| 51 |
+
}
|
| 52 |
# EXPLANATION TRIGGER FIX
|
| 53 |
if any(phrase in message for phrase in ["what does that mean", "what's that", "explain", "what is that"]):
|
| 54 |
program = conversation_state.get("last_eligible_program")
|