schlenker commited on
Commit
54faac5
·
1 Parent(s): f40dd20

bug fix remember

Browse files
Files changed (1) hide show
  1. pages/1_Descriptive_chatbot.py +33 -18
pages/1_Descriptive_chatbot.py CHANGED
@@ -138,23 +138,23 @@ def write_bot(input, remember=True, blink=True):
138
  if remember == True:
139
  st.session_state.messages.append({'role': 'assistant', 'content': full_response})
140
 
141
- def ask_if_helped():
142
- y = st.button('Yes!', key=60)
143
- n = st.button('No...', key=61)
144
- new = st.button('I have a new word', key=62)
145
- if y:
146
- write_bot("I am happy to help!")
147
- again = st.button('Play again')
148
- if again:
149
- write_bot("Please describe your word!")
150
- st.session_state.is_helpful['ask'] = False
151
- elif n:
152
- st.session_state.actions.append('cue')
153
- st.session_state.is_helpful['ask'] = False
154
- #cue_generation()
155
- elif new:
156
- write_bot("Please describe your word!")
157
- st.session_state.is_helpful['ask'] = False
158
 
159
  ## removed: if st.session_state.actions[-1] == "result":
160
 
@@ -300,7 +300,22 @@ if st.session_state.actions[-1] == "result":
300
  #st.session_state.is_helpful['ask'] = True
301
 
302
  if st.session_state.is_helpful['ask']:
303
- ask_if_helped()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
304
 
305
  if st.session_state.actions[-1] == 'cue':
306
  guessed = False
 
138
  if remember == True:
139
  st.session_state.messages.append({'role': 'assistant', 'content': full_response})
140
 
141
+ #def ask_if_helped():
142
+ #y = st.button('Yes!', key=60)
143
+ #n = st.button('No...', key=61)
144
+ #new = st.button('I have a new word', key=62)
145
+ #if y:
146
+ # write_bot("I am happy to help!")
147
+ # again = st.button('Play again')
148
+ # if again:
149
+ # write_bot("Please describe your word!")
150
+ # st.session_state.is_helpful['ask'] = False
151
+ #elif n:
152
+ # st.session_state.actions.append('cue')
153
+ # st.session_state.is_helpful['ask'] = False
154
+ # #cue_generation()
155
+ #elif new:
156
+ # write_bot("Please describe your word!")
157
+ # st.session_state.is_helpful['ask'] = False
158
 
159
  ## removed: if st.session_state.actions[-1] == "result":
160
 
 
300
  #st.session_state.is_helpful['ask'] = True
301
 
302
  if st.session_state.is_helpful['ask']:
303
+ y = st.button('Yes!', key=60)
304
+ n = st.button('No...', key=61)
305
+ new = st.button('I have a new word', key=62)
306
+ if y:
307
+ write_bot("I am happy to help!")
308
+ again = st.button('Play again')
309
+ if again:
310
+ write_bot("Please describe your word!")
311
+ st.session_state.is_helpful['ask'] = False
312
+ elif n:
313
+ st.session_state.actions.append('cue')
314
+ st.session_state.is_helpful['ask'] = False
315
+ #cue_generation()
316
+ elif new:
317
+ write_bot("Please describe your word!")
318
+ st.session_state.is_helpful['ask'] = False
319
 
320
  if st.session_state.actions[-1] == 'cue':
321
  guessed = False