diff --git a/src/service/dialog_state_monitor.py b/src/service/dialog_state_monitor.py index 7827de7..67b15b5 100644 --- a/src/service/dialog_state_monitor.py +++ b/src/service/dialog_state_monitor.py @@ -29,27 +29,10 @@ class DialogStateMonitor: {'completed': False, 'name': 'collect_address'}, ], was_previous_order_invalid=False, - constraints={ - 'order': [ - 'sauce', - 'pizza', - ], - }, constants=constants, history=[]) self.state = copy.deepcopy(self.__initial_state) - def get_last_order_missing_fields(self) -> list[str]: - result = [] - try: - last_order = self.state['belief_state']['order'][-1] - except IndexError: - raise RuntimeError('No orders are placed') - for constraint in self.state['constraints']['order']: - if constraint not in last_order: - result.append(constraint) - return result - def get_current_active_stage(self) -> str | None: for stage in self.state['stages']: if stage['completed'] is False: diff --git a/src/test/dialog_state_monitor.py b/src/test/dialog_state_monitor.py index 363e302..5e3b5d2 100644 --- a/src/test/dialog_state_monitor.py +++ b/src/test/dialog_state_monitor.py @@ -9,11 +9,9 @@ assert dsm.state['was_previous_order_invalid'] is False frame1 = Frame('user', 'inform/order', [Slot('pizza', 'margarita'), Slot('sauce', 'ketchup')]) dsm.update(frame1) -assert dsm.get_last_order_missing_fields() == [] assert dsm.get_total_cost() == 20 frame2 = Frame('user', 'inform/order', [Slot('pizza', 'tuna')]) dsm.update(frame2) -assert dsm.get_last_order_missing_fields() == ['sauce'] assert dsm.get_total_cost() == 60 frame3 = Frame('user', 'inform/order-complete', []) dsm.update(frame3)