This commit is contained in:
s495727 2024-06-13 15:56:23 +02:00
parent 24f75db1d8
commit bfefbfe847

View File

@ -70,14 +70,16 @@ class DialogStateMonitor:
if stage['name'] == "collect_food":
for order in self.state['belief_state']['order']:
if len(order) > 0:
stage['completed'] = True
return
for k, v in order:
if k == 'pizza':
stage['completed'] = True
return
elif stage["name"] == "collect_drinks":
for order in self.state['belief_state']['order']:
if order.get("drink"):
stage['completed'] = True
return
for k, v in order:
if k == 'drink':
stage['completed'] = True
return
elif stage["name"] == "collect_address":
if not len(self.state['belief_state']['address']):
return
@ -142,7 +144,7 @@ class DialogStateMonitor:
return
self.state['was_previous_order_invalid'] = False
self.state['total_cost'] += self.state['constants'][slot.name][value]['price']
new_order.append((slot.name, value))
new_order.append({slot.name: value})
if len(new_order) > 0:
self.state['belief_state']['order'].append(new_order)
self.complete_stage_if_valid('collect_food')