bryan-stearns commited on
Commit
8895767
1 Parent(s): 49dd4ec

Fixing add/remove button text/enabling

Browse files
Files changed (1) hide show
  1. Logic_Demo.py +5 -4
Logic_Demo.py CHANGED
@@ -44,7 +44,6 @@ def json_to_output_df(json_str, input_list):
44
  else:
45
  retval = pd.DataFrame(data=outdata)
46
 
47
- print(retval)
48
  return retval
49
 
50
 
@@ -123,10 +122,12 @@ st.markdown("---")
123
  st.header("Input:")
124
  st.subheader("Choose a request to send to the agent.")
125
 
 
 
126
  ss_input_select_list = [st.selectbox(label="Signs/Symptom:", options=ss_list, index=i, key="ss_in-"+str(i)) for i in range(st.session_state.ld_num_ss_inputs)]
127
- in_col1, in_col2 = st.columns(16)[0:2]
128
- in_col1.button(label="+", on_click=increment_ss_inputs)
129
- in_col2.button(label="", on_click=decrement_ss_inputs) # em: —, en: –
130
 
131
 
132
  # Send a partial pattern to the agent's input
 
44
  else:
45
  retval = pd.DataFrame(data=outdata)
46
 
 
47
  return retval
48
 
49
 
 
122
  st.header("Input:")
123
  st.subheader("Choose a request to send to the agent.")
124
 
125
+ if st.session_state.ld_num_ss_inputs > len(ss_list):
126
+ st.session_state.ld_num_ss_inputs = len(ss_list)
127
  ss_input_select_list = [st.selectbox(label="Signs/Symptom:", options=ss_list, index=i, key="ss_in-"+str(i)) for i in range(st.session_state.ld_num_ss_inputs)]
128
+ in_col1, in_col2 = st.columns(8)[0:2]
129
+ in_col1.button(label="New Input", on_click=increment_ss_inputs, disabled=(st.session_state.ld_num_ss_inputs >= len(ss_list)))
130
+ in_col2.button(label="Remove Input", on_click=decrement_ss_inputs, disabled=(st.session_state.ld_num_ss_inputs <= 1)) # em: —, en: –
131
 
132
 
133
  # Send a partial pattern to the agent's input