billusanda007 commited on
Commit
74704d2
·
verified ·
1 Parent(s): 21b4bcd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -6
app.py CHANGED
@@ -87,11 +87,6 @@ music = {
87
  }
88
 
89
  def get_response(user_input):
90
- if 'hello' in user_input.lower() or 'hi' in user_input.lower():
91
- return "Hello! How can I assist you today?"
92
-
93
- if 'thank you' in user_input.lower() or 'thanks' in user_input.lower() or 'thanx' in user_input.lower():
94
- return "You are welcome!"
95
 
96
  # Check if the user asks for the definition of a disease
97
  disease_keywords = ['definition', 'what is', 'explain', "what's", 'whats']
@@ -158,10 +153,24 @@ def main():
158
 
159
  user_input = st.text_input("User Input:")
160
 
161
- if st.button("Submit"):
 
 
 
 
 
 
 
 
 
 
162
  response = get_response(user_input)
163
  st.write("Bot Response:")
164
  st.write(response)
 
 
 
 
165
 
166
  if __name__ == '__main__':
167
  main()
 
87
  }
88
 
89
  def get_response(user_input):
 
 
 
 
 
90
 
91
  # Check if the user asks for the definition of a disease
92
  disease_keywords = ['definition', 'what is', 'explain', "what's", 'whats']
 
153
 
154
  user_input = st.text_input("User Input:")
155
 
156
+ flag = 0
157
+
158
+ if 'hello' in user_input.lower() or 'hi' in user_input.lower():
159
+ response = "Hello! How can I assist you today?"
160
+ flag = 1
161
+
162
+ if 'thank you' in user_input.lower() or 'thanks' in user_input.lower() or 'thanx' in user_input.lower():
163
+ response = "You are welcome!"
164
+ flag = 1
165
+
166
+ if st.button("Submit") and flag == 0:
167
  response = get_response(user_input)
168
  st.write("Bot Response:")
169
  st.write(response)
170
+ elif:
171
+ st.write("Bot Response:")
172
+ st.write(response)
173
+
174
 
175
  if __name__ == '__main__':
176
  main()