andreska commited on
Commit
11a6534
·
verified ·
1 Parent(s): f5e81c3

Try to realign elements to take less vertical space.

Browse files
Files changed (1) hide show
  1. app.py +11 -6
app.py CHANGED
@@ -35,11 +35,21 @@ st.markdown(
35
  )
36
 
37
  #st.title("Adrega AI Help")
38
- st.session_state.include_context = st.checkbox('Search in Help')
 
 
 
 
 
 
39
 
40
  if 'conversation' not in st.session_state:
41
  st.session_state.conversation = ""
42
 
 
 
 
 
43
  def handle_submit():
44
  user_input = st.session_state.user_input
45
  if user_input:
@@ -66,10 +76,5 @@ def handle_submit():
66
  st.session_state.conversation = f"<p><strong>User:</strong> {user_input}</p><p><strong>Adrega AI:</strong> {answer}</p>" + st.session_state.conversation
67
  else:
68
  st.write("Please enter a question.")
69
-
70
-
71
- st.text_input('Ask me a question', key='user_input', on_change=handle_submit)
72
- if st.button("Ask"):
73
- handle_submit()
74
 
75
  st.markdown(f'<div class="scrollable-div">{st.session_state.conversation}</div>', unsafe_allow_html=True)
 
35
  )
36
 
37
  #st.title("Adrega AI Help")
38
+ col1, col2, col3 = st.columns([3, 1, 1])
39
+
40
+ with col1:
41
+ st.text_input('Ask me a question', key='user_input', on_change=handle_submit)
42
+
43
+ with col2:
44
+ st.session_state.include_context = st.checkbox('Search in Help')
45
 
46
  if 'conversation' not in st.session_state:
47
  st.session_state.conversation = ""
48
 
49
+ with col3:
50
+ if st.button("Ask"):
51
+ handle_submit()
52
+
53
  def handle_submit():
54
  user_input = st.session_state.user_input
55
  if user_input:
 
76
  st.session_state.conversation = f"<p><strong>User:</strong> {user_input}</p><p><strong>Adrega AI:</strong> {answer}</p>" + st.session_state.conversation
77
  else:
78
  st.write("Please enter a question.")
 
 
 
 
 
79
 
80
  st.markdown(f'<div class="scrollable-div">{st.session_state.conversation}</div>', unsafe_allow_html=True)