arpita-23 commited on
Commit
f26e91b
Β·
verified Β·
1 Parent(s): 4f2399b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -87
app.py CHANGED
@@ -8,8 +8,8 @@ load_dotenv()
8
 
9
  # Configure Streamlit page settings
10
  st.set_page_config(
11
- page_title="Interview Prep Assistant",
12
- page_icon="🎯",
13
  layout="wide",
14
  )
15
 
@@ -17,34 +17,16 @@ st.set_page_config(
17
  st.markdown(
18
  """
19
  <style>
20
- <style>
21
- /* Set light blue background for the whole page */
22
  body, .stApp {
23
  background-color: #E3F2FD;
24
  }
25
-
26
-
27
- body {
28
- background-color: #ADD8E6;
29
- }
30
- .stTabs [data-baseweb="tab-list"] {
31
- justify-content: center;
32
- }
33
- .stTabs [data-baseweb="tab"] {
34
- background-color: #E3F2FD;
35
- border-radius: 20px;
36
- font-weight: bold;
37
- color: black;
38
- padding: 10px;
39
- }
40
- .stTabs [data-baseweb="tab"][aria-selected="true"] {
41
- background-color: #1E90FF;
42
- color: white;
43
- border-radius: 20px;
44
- }
45
  h2 {
46
  color: #003366;
47
  }
 
 
 
 
48
  </style>
49
  """,
50
  unsafe_allow_html=True,
@@ -74,76 +56,28 @@ if "chat_session" not in st.session_state:
74
  st.stop()
75
 
76
  # Display chatbot title
77
- st.title("🎯 Interview Prep Assistant")
78
-
79
- # Tabs for category selection
80
- tabs = ["πŸ’» Technical", "πŸ’¬ HR & Behavioral", "🧠 Aptitude", "🏒 Company-Specific", "πŸ“š DSA"]
81
- selected_tab = st.tabs(tabs)
82
-
83
- # Sample interview questions
84
- interview_questions = {
85
- "πŸ’» Technical": [
86
- "πŸ–₯️ Explain Object-Oriented Programming.",
87
- "🌐 What are the differences between TCP and UDP?",
88
- "πŸ“‚ How does a database index work?",
89
- "πŸ”— What is the difference between REST and SOAP?",
90
- "⚑ Explain Big O notation with an example."
91
- ],
92
- "πŸ’¬ HR & Behavioral": [
93
- "πŸ—£οΈ Tell me about yourself.",
94
- "πŸ’ͺ What are your strengths and weaknesses?",
95
- "πŸ“Œ Describe a challenging project you worked on.",
96
- "🎯 Why should we hire you?",
97
- "πŸ“… Where do you see yourself in five years?"
98
- ],
99
- "🧠 Aptitude": [
100
- "πŸš‚ Solve: A train moving at 60 km/hr crosses a 200m bridge in how many seconds?",
101
- "πŸ”’ What is the next number in the sequence: 2, 6, 12, 20, 30, ...?",
102
- "⏰ If a clock is 10 minutes fast, how will you correct it?",
103
- "🐈 A room has 8 corners, each with a cat. How many cats are there in total?",
104
- "🚰 Solve: Two pipes can fill a tank in 4 and 6 hours. How long to fill together?"
105
- ],
106
- "🏒 Company-Specific": [
107
- "🏒 What do you know about our company?",
108
- "❓ Why do you want to work at Google (or any company)?",
109
- "πŸ” How do you stay updated with the latest technologies?",
110
- "πŸ† What sets you apart from other candidates?",
111
- "⚠️ Describe a time you handled failure professionally."
112
- ],
113
- "πŸ“š DSA": [
114
- "πŸ”— What is a linked list? Explain with an example.",
115
- "πŸ“Š How do you implement a binary search algorithm?",
116
- "πŸŒ€ Explain quicksort and its time complexity.",
117
- "🎯 What is dynamic programming and how is it used?",
118
- "πŸ“¦ Describe the difference between a stack and a queue."
119
- ]
120
- }
121
-
122
- # Display sample questions under the selected tab
123
- for i, tab in enumerate(selected_tab):
124
- with tab:
125
- st.subheader(f"πŸ“Œ {tabs[i]} Questions")
126
- for question in interview_questions[tabs[i]]:
127
- st.write(f"- {question}")
128
-
129
- # Input field for user's message
130
- user_prompt = st.chat_input("πŸ’¬ Ask anything about interview preparation...")
131
-
132
- if user_prompt:
133
- # Display the user's message
134
- st.chat_message("user").markdown(user_prompt)
135
 
 
 
 
 
136
  # Send message to Gemini-Pro for response
137
  try:
138
- gemini_response = st.session_state.chat_session.send_message(
139
- f"Provide an interview preparation guide for: {user_prompt}"
140
  )
141
 
142
  # Display AI response
143
- with st.chat_message("assistant"):
144
- st.markdown(gemini_response.text)
145
  except Exception as e:
146
- st.error(f"❌ Error processing your message: {e}")
147
 
148
 
149
 
 
8
 
9
  # Configure Streamlit page settings
10
  st.set_page_config(
11
+ page_title="AI Healthcare Assistant",
12
+ page_icon="🩺",
13
  layout="wide",
14
  )
15
 
 
17
  st.markdown(
18
  """
19
  <style>
 
 
20
  body, .stApp {
21
  background-color: #E3F2FD;
22
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  h2 {
24
  color: #003366;
25
  }
26
+ .stTextInput, .stButton > button {
27
+ border-radius: 10px;
28
+ font-size: 16px;
29
+ }
30
  </style>
31
  """,
32
  unsafe_allow_html=True,
 
56
  st.stop()
57
 
58
  # Display chatbot title
59
+ st.title("🩺 AI Healthcare Assistant")
60
+
61
+ st.subheader("Enter your symptoms to get advice and treatment guidance")
62
+
63
+ # User input for symptoms
64
+ user_symptoms = st.text_input("Describe your symptoms (e.g., fever, cough, headache)...")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
+ if st.button("Get Advice") and user_symptoms:
67
+ # Display user input
68
+ st.write(f"**Your Symptoms:** {user_symptoms}")
69
+
70
  # Send message to Gemini-Pro for response
71
  try:
72
+ response = st.session_state.chat_session.send_message(
73
+ f"A user is experiencing the following symptoms: {user_symptoms}. Provide possible causes, advice, and treatment guidance."
74
  )
75
 
76
  # Display AI response
77
+ st.subheader("🩺 AI Advice & Treatment Guidance:")
78
+ st.markdown(response.text)
79
  except Exception as e:
80
+ st.error(f"❌ Error processing your request: {e}")
81
 
82
 
83