Systemy_dialogowe/system_mockup/monitor_stanu_dialogowego.py
Jakub Adamski 38e860cc67 added todo
2022-06-01 12:53:12 +02:00

25 lines
584 B
Python

dialogue_state = []
iterator = 1
#todo uporzadkować
def monitor_stanu_dialogowego(frame, questions):
global iterator
# Some frames can reset the dialogue state, like saying hello.
reset_state_if_needed(frame)
singleState = {
"iteration": iterator,
"frame": frame,
"questions": questions
}
dialogue_state.append(singleState)
iterator += 1
return dialogue_state
def reset_state_if_needed(frame):
global iterator
if frame['act'] == "hello" or frame['act'] == "bye":
dialogue_state.clear()
iterator = 1