ASNVS commited on
Commit
fa7d26f
·
verified ·
1 Parent(s): 877249c
Files changed (1) hide show
  1. app.py +4 -77
app.py CHANGED
@@ -1,79 +1,5 @@
1
 
2
 
3
- # # # # # from langchain_google_genai import ChatGoogleGenerativeAI
4
-
5
-
6
-
7
- # # # # # llm = ChatGoogleGenerativeAI(
8
- # # # # # model="gemini-1.5-flash",
9
- # # # # # google_api_key='AIzaSyC7Rhv4L6_oNl-nW3Qeku2SPRkxL5hhtoE',
10
- # # # # # temperature=0.2)
11
-
12
- # # # # # poem = llm.invoke("Write a poem on love for burger")
13
- # # # # # print(poem)
14
-
15
-
16
- # # # # import streamlit as st
17
- # # # # from langchain_google_genai import ChatGoogleGenerativeAI
18
-
19
- # # # # # Set up the AI model
20
- # # # # llm = ChatGoogleGenerativeAI(
21
- # # # # model="gemini-1.5-flash", # Free model
22
- # # # # google_api_key="AIzaSyC7Rhv4L6_oNl-nW3Qeku2SPRkxL5hhtoE",
23
- # # # # temperature=0.5
24
- # # # # )
25
-
26
- # # # # # Streamlit UI
27
- # # # # st.title("🩺 Healthcare AI Assistant")
28
- # # # # st.write("Ask me anything about health, symptoms, diet, or general medical advice!")
29
-
30
- # # # # # User Input
31
- # # # # user_question = st.text_input("Enter your health-related question:")
32
-
33
- # # # # # Process User Query
34
- # # # # if st.button("Get Recommendation"):
35
- # # # # if user_question.strip():
36
- # # # # with st.spinner("Analyzing..."):
37
- # # # # response = llm.invoke(user_question)
38
- # # # # st.success("Recommendation:")
39
- # # # # st.write(response)
40
- # # # # else:
41
- # # # # st.warning("Please enter a question!")
42
-
43
- # # # # # Footer
44
- # # # # st.markdown("---")
45
- # # # # st.markdown("💡 *Disclaimer: This AI assistant provides general health information. Always consult a doctor for medical concerns.*")
46
-
47
-
48
-
49
- # # # import streamlit as st
50
- # # # from langchain_google_genai import ChatGoogleGenerativeAI
51
-
52
- # # # # Set up AI model
53
- # # # llm = ChatGoogleGenerativeAI(
54
- # # # model="gemini-1.5-flash", # Free model
55
- # # # google_api_key="AIzaSyC7Rhv4L6_oNl-nW3Qeku2SPRkxL5hhtoE",
56
- # # # temperature=0.5
57
- # # # )
58
-
59
- # # # # Streamlit UI
60
- # # # st.title("🩺 AI Healthcare Learning Assistant")
61
- # # # st.write("Ask me anything about healthcare, symptoms, diet, or medical learning!")
62
-
63
- # # # # User Input
64
- # # # user_question = st.text_input("Enter your healthcare question:")
65
-
66
- # # # # Function to filter AI disclaimers
67
- # # # def is_valid_response(response):
68
- # # # disclaimers = [
69
- # # # "I am an AI and cannot give medical advice",
70
- # # # "Seek medical attention",
71
- # # # "Consult a doctor",
72
- # # # "Contact your doctor",
73
- # # # "Go to an emergency room",
74
- # # # ]
75
- # # # return not any(phrase.lower() in response.lower() for phrase in disclaimers)
76
-
77
  # # # # Process User Query
78
  # # # if st.button("Get Information"):
79
  # # # if user_question.strip():
@@ -260,7 +186,10 @@ st.markdown(
260
  iframe {
261
  border: none !important;
262
  }
263
- h1, h2, h3, h4, h5, h6, p, div, span, {
 
 
 
264
  color: black !important;
265
  }
266
  </style>
@@ -336,5 +265,3 @@ if st.button("Emergency Contact"):
336
 
337
  # Footer
338
  st.markdown("---")
339
-
340
-
 
1
 
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  # # # # Process User Query
4
  # # # if st.button("Get Information"):
5
  # # # if user_question.strip():
 
186
  iframe {
187
  border: none !important;
188
  }
189
+ h1, h2, h3, h4, h5, h6, p, div, span, label {
190
+ color: black !important;
191
+ }
192
+ button, .stButton>button {
193
  color: black !important;
194
  }
195
  </style>
 
265
 
266
  # Footer
267
  st.markdown("---")