From e2e447a6014fca41ebf6926c2b2a39237d37dcba Mon Sep 17 00:00:00 2001 From: kb Date: Thu, 13 Jun 2024 18:10:19 +0200 Subject: [PATCH] Testy skadnikow i ilosci --- src/service/dialog_state_monitor.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/service/dialog_state_monitor.py b/src/service/dialog_state_monitor.py index aba0ad6..6b2fb84 100644 --- a/src/service/dialog_state_monitor.py +++ b/src/service/dialog_state_monitor.py @@ -156,13 +156,10 @@ class DialogStateMonitor: new_order[slot.name] = [{"drink": value}] elif slot.name in ["ingredient", "ingredient/neg"]: - if len(self.state['belief_state']['order']) != 0: - last_order = self.state['belief_state']['order'][-1] - if last_order["name"] == "pizza": - last_order[slot.name].append(value) - elif last_order["name"] == "drink": - last_order[slot.name].append(value) - + pizzas_list = new_order.get("pizza") + if pizzas_list: + pizzas_list[-1][slot.name].append(value) + if len(new_order) > 0: self.state['belief_state']['order'].append(new_order) self.complete_stage_if_valid('collect_food')