-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmid_result.json
75 lines (75 loc) · 2.41 KB
/
mid_result.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
[
{
"Variable": {
"fruit_type": "''",
"weight": "0",
"unit_price": "0",
"cnt": "0"
}
},
{
"ID": 0,
"name": "buy",
"type": "Start",
"Variable": [],
"logic": [
{
"condition": "intent == 'buy' and 'type' in slot and slot['type'] == 'fruit'",
"operation": "",
"output": "'Please show the fruit information, including type, weight and unit price.'",
"nextState": "1"
}
]
},
{
"ID": 2,
"name": "pay",
"type": "General",
"Variable": [],
"logic": [
{
"condition": "intent == 'pay' and 'state' in slot and bool(slot['state']) == True",
"operation": "",
"output": "'Successful! Thanks for your application.'",
"nextState": "4"
},
{
"condition": "True",
"operation": "",
"output": "'No pay. Your order failed. Thanks for your application.'",
"nextState": "3"
}
]
},
{
"ID": 1,
"name": "select",
"type": "Slot",
"Variable": [
{
"Variable": "money",
"Value": "0"
}
],
"logic": [
{
"condition": "intent == 'buy' and 'fruit_type' in slot and 'weight' in slot and 'unit_price' in slot",
"operation": "self.fruit_type = slot['fruit_type'] ; self.weight = slot['weight']; self.unit_price = slot['unit_price']; money = int(slot['unit_price']) * int(slot['weight'])",
"output": "'This is your order: \\n \\n fruit: %s \\n weight: %s \\n unit_price: %s \\n Total: %d \\n Please pay.' %(slot['fruit_type'], slot['weight'], slot['unit_price'], money)",
"nextState": "2"
},
{
"condition": "self.cnt > 3",
"operation": "",
"output": "'Too many times. Your order failed. Thanks for your application.'",
"nextState": "3"
},
{
"condition": "True",
"operation": "self.cnt += 1",
"output": "'Wrong request.Please show your order again.'",
"nextState": "1"
}
]
}
]