From 3d820e8d6d73417bd3582f42dff59271e97cc5a1 Mon Sep 17 00:00:00 2001 From: Patryk Date: Mon, 10 Jun 2024 00:46:52 +0200 Subject: [PATCH] =?UTF-8?q?Usuni=C4=99cie=20sprawdzania=20poprawno=C5=9Bci?= =?UTF-8?q?=20zam=C3=B3wienia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/service/dialog_state_monitor.py | 17 ----------------- src/test/dialog_state_monitor.py | 2 -- 2 files changed, 19 deletions(-) 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)