Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,26 @@
|
|
1 |
-
import
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
#
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import subprocess
|
3 |
+
|
4 |
+
# 🔹 Force install missing dependencies
|
5 |
+
missing_packages = ["xgboost"]
|
6 |
+
for package in missing_packages:
|
7 |
+
try:
|
8 |
+
__import__(package)
|
9 |
+
except ImportError:
|
10 |
+
subprocess.call(["pip", "install", package])
|
11 |
+
|
12 |
+
from virtualhealth import handle_user_query # Now import your function
|
13 |
+
import streamlit as st
|
14 |
+
|
15 |
+
st.set_page_config(page_title="AI Health Assistant", page_icon="🩺")
|
16 |
+
|
17 |
+
st.title("🩺 AI Health Assistant")
|
18 |
+
st.write("Ask any medical-related questions below:")
|
19 |
+
|
20 |
+
# User Input
|
21 |
+
user_input = st.text_input("Your Question:")
|
22 |
+
|
23 |
+
# Button to Process Query
|
24 |
+
if st.button("Ask"):
|
25 |
+
bot_response = handle_user_query(user_input) # Call function directly
|
26 |
+
st.markdown(f"**🤖 Bot:** {bot_response}")
|