-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCareWithQnA.dialog
156 lines (156 loc) · 4.88 KB
/
CareWithQnA.dialog
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
{
"$kind": "Microsoft.AdaptiveDialog",
"$designer": {
"name": "CareWithQnA",
"description": "",
"id": "A79tBe"
},
"autoEndDialog": true,
"defaultResultProperty": "dialog.result",
"triggers": [
{
"$kind": "Microsoft.OnConversationUpdateActivity",
"$designer": {
"id": "376720",
"comment": "This trigger runs when a conversation update activity is sent to the bot. This indicates a user or bot being added or removed from a conversation."
},
"actions": [
{
"$kind": "Microsoft.Foreach",
"$designer": {
"id": "518944",
"name": "Loop: for each item",
"comment": "For each member added to the conversation."
},
"itemsProperty": "turn.Activity.membersAdded",
"actions": [
{
"$kind": "Microsoft.IfCondition",
"$designer": {
"id": "641773",
"name": "Branch: if/else",
"comment": "Checks that that member added ID does not match the bot ID. This prevents the greeting message from being sent when the bot is added to a conversation."
},
"condition": "=string(dialog.foreach.value.id) != string(turn.Activity.Recipient.id)",
"actions": [
{
"$kind": "Microsoft.SendActivity",
"$designer": {
"id": "859266",
"name": "Send a response"
},
"activity": "${SendActivity_Greeting()}"
}
]
}
]
}
]
},
{
"$kind": "Microsoft.OnUnknownIntent",
"$designer": {
"id": "mb2n1u",
"comment": "This trigger fires when an incoming activity is not handled by any other trigger."
},
"actions": [
{
"$kind": "Microsoft.SendActivity",
"$designer": {
"id": "kMjqz1",
"comment": "It is recommended to show a message to the user when the bot does not know how to handle an incoming activity and provide follow up options or a help message."
},
"activity": "${SendActivity_DidNotUnderstand()}"
}
]
},
{
"$kind": "Microsoft.OnQnAMatch",
"$designer": {
"id": "EGVXLS"
},
"actions": [
{
"$kind": "Microsoft.IfCondition",
"$designer": {
"id": "vZYV7o"
},
"condition": "count(turn.recognized.answers[0].context.prompts) > 0",
"actions": [
{
"$kind": "Microsoft.SetProperty",
"$designer": {
"id": "EIbMkG"
},
"property": "dialog.qnaContext",
"value": "=turn.recognized.answers[0].context.prompts"
},
{
"$kind": "Microsoft.TextInput",
"$designer": {
"id": "varzGP"
},
"maxTurnCount": 3,
"alwaysPrompt": true,
"allowInterruptions": false,
"prompt": "${TextInput_Prompt_PfB3ep()}",
"property": "turn.qnaMultiTurnResponse"
},
{
"$kind": "Microsoft.SetProperty",
"$designer": {
"id": "qt7fH2"
},
"property": "turn.qnaMatchFromContext",
"value": "=where(dialog.qnaContext, item, item.displayText == turn.qnaMultiTurnResponse)"
},
{
"$kind": "Microsoft.DeleteProperty",
"$designer": {
"id": "I5LFm1"
},
"property": "dialog.qnaContext"
},
{
"$kind": "Microsoft.IfCondition",
"$designer": {
"id": "E1TDf2"
},
"condition": "turn.qnaMatchFromContext && count(turn.qnaMatchFromContext) > 0",
"actions": [
{
"$kind": "Microsoft.SetProperty",
"$designer": {
"id": "iTxGY5"
},
"property": "turn.qnaIdFromPrompt",
"value": "=turn.qnaMatchFromContext[0].qnaId"
}
]
},
{
"$kind": "Microsoft.EmitEvent",
"$designer": {
"id": "6sFhCf"
},
"eventName": "activityReceived",
"eventValue": "=turn.activity"
}
],
"elseActions": [
{
"$kind": "Microsoft.SendActivity",
"$designer": {
"id": "p0kGby"
},
"activity": "${SendActivity_21zlE8()}"
}
]
}
]
}
],
"generator": "CareWithQnA.lg",
"id": "CareWithQnA",
"recognizer": "CareWithQnA.lu.qna"
}