from acts import hello_act dialogue_state = [] def monitor_stanu_dialogowego(frame): # Some frames can reset the dialogue state, like saying hello. reset_state_if_needed(frame) list(map(lambda x: dialogue_state.append(x), frame)) return dialogue_state def reset_state_if_needed(frame): if hello_act in frame: dialogue_state.clear()