zakerytclarke commited on
Commit
d366837
·
verified ·
1 Parent(s): 4e256cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -10
app.py CHANGED
@@ -305,7 +305,7 @@ def handle_chat(user_prompt, user_input, teapot_ai):
305
  return response
306
 
307
  def suggestion_button(suggestion_text):
308
- if st.button(suggestion_text):
309
  return suggestion_text
310
 
311
  def main():
@@ -335,22 +335,18 @@ def main():
335
  choice1 = random.choice(list1)
336
  choice2 = random.choice(list2)
337
  choice3 = random.choice(list3)
 
338
  s1, s2, s3 = st.columns([1, 2, 3])
339
 
340
  with s1:
341
- st.markdown("<div style='text-align: center;'>", unsafe_allow_html=True)
342
- user_input = suggestion_button(choice1) or None
343
- st.markdown("</div>", unsafe_allow_html=True)
344
-
345
  with s2:
346
- st.markdown("<div style='text-align: center;'>", unsafe_allow_html=True)
347
  user_input = suggestion_button(choice2) or user_input
348
- st.markdown("</div>", unsafe_allow_html=True)
349
-
350
  with s3:
351
- st.markdown("<div style='text-align: center;'>", unsafe_allow_html=True)
352
  user_input = suggestion_button(choice3) or user_input
353
- st.markdown("</div>", unsafe_allow_html=True)
354
  if user_input:
355
  with st.spinner('Generating Response...'):
356
  response = handle_chat(user_prompt, user_input, teapot_ai)
 
305
  return response
306
 
307
  def suggestion_button(suggestion_text):
308
+ if st.button(suggestion_text, use_column_width=True):
309
  return suggestion_text
310
 
311
  def main():
 
335
  choice1 = random.choice(list1)
336
  choice2 = random.choice(list2)
337
  choice3 = random.choice(list3)
338
+
339
  s1, s2, s3 = st.columns([1, 2, 3])
340
 
341
  with s1:
342
+ user_input = suggestion_button(choice1) or user_input
343
+
 
 
344
  with s2:
 
345
  user_input = suggestion_button(choice2) or user_input
346
+
 
347
  with s3:
 
348
  user_input = suggestion_button(choice3) or user_input
349
+
350
  if user_input:
351
  with st.spinner('Generating Response...'):
352
  response = handle_chat(user_prompt, user_input, teapot_ai)