Spaces:
Build error
Build error
Commit
·
4a1c22a
1
Parent(s):
6169ebe
Update run.py
Browse files
run.py
CHANGED
|
@@ -33,11 +33,11 @@ def respond(state, chat_history, visible_elemIDs):
|
|
| 33 |
#print("respond to button!")
|
| 34 |
chat_history.append((state, bot_message))
|
| 35 |
else: # react to Text-Input
|
| 36 |
-
internal_state="
|
| 37 |
bot_message = f"I was in state \"{previous_state}\" and am now in state \"{internal_state}\" and ready to process \"{state}\". please click another button."
|
| 38 |
-
state="1"
|
| 39 |
#print("respond to text!")
|
| 40 |
-
chat_history.append((state, bot_message))
|
|
|
|
| 41 |
visible_elemIDs= [e for e in visible_elemIDs
|
| 42 |
if ((str(e) != str(internal_state))|(str(e)=="1")|(str(e)=="0"))] # delete some buttons
|
| 43 |
if(len(visible_elemIDs)==0): # if visible_elemIDs has zero length, reset
|
|
|
|
| 33 |
#print("respond to button!")
|
| 34 |
chat_history.append((state, bot_message))
|
| 35 |
else: # react to Text-Input
|
| 36 |
+
internal_state="1"
|
| 37 |
bot_message = f"I was in state \"{previous_state}\" and am now in state \"{internal_state}\" and ready to process \"{state}\". please click another button."
|
|
|
|
| 38 |
#print("respond to text!")
|
| 39 |
+
chat_history.append((str(state), bot_message))
|
| 40 |
+
state="1"
|
| 41 |
visible_elemIDs= [e for e in visible_elemIDs
|
| 42 |
if ((str(e) != str(internal_state))|(str(e)=="1")|(str(e)=="0"))] # delete some buttons
|
| 43 |
if(len(visible_elemIDs)==0): # if visible_elemIDs has zero length, reset
|