Spaces:
Build error
Build error
Commit
·
eda175a
1
Parent(s):
6f9d054
Update run.py
Browse files
run.py
CHANGED
|
@@ -32,11 +32,13 @@ def respond(state, chat_history, visible_elemIDs):
|
|
| 32 |
if ((str(e) != str(internal_state))|(str(e)=="1"))] # delete some buttons
|
| 33 |
if(str(state) in [str(e) for e in visible_elemIDs]): # react to Buttons
|
| 34 |
bot_message = f"I was in state \"{previous_state}\" and am now in state \"{internal_state}\". please click another button."
|
|
|
|
| 35 |
chat_history.append((state, bot_message))
|
| 36 |
else: # react to Text-Input
|
| 37 |
-
internal_state=0
|
| 38 |
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."
|
| 39 |
state="0"
|
|
|
|
| 40 |
chat_history.append((state, bot_message))
|
| 41 |
if(len(visible_elemIDs)==0): # if visible_elemIDs has zero length, reset
|
| 42 |
print("restore visibility to "+str(defaultElemIDs))
|
|
|
|
| 32 |
if ((str(e) != str(internal_state))|(str(e)=="1"))] # delete some buttons
|
| 33 |
if(str(state) in [str(e) for e in visible_elemIDs]): # react to Buttons
|
| 34 |
bot_message = f"I was in state \"{previous_state}\" and am now in state \"{internal_state}\". please click another button."
|
| 35 |
+
print("respond to button!")
|
| 36 |
chat_history.append((state, bot_message))
|
| 37 |
else: # react to Text-Input
|
| 38 |
+
internal_state="0"
|
| 39 |
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."
|
| 40 |
state="0"
|
| 41 |
+
print("respond to text!")
|
| 42 |
chat_history.append((state, bot_message))
|
| 43 |
if(len(visible_elemIDs)==0): # if visible_elemIDs has zero length, reset
|
| 44 |
print("restore visibility to "+str(defaultElemIDs))
|