forked from mawasile/CopilotStudioSamples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConversational boosting.yml
More file actions
81 lines (70 loc) · 2.93 KB
/
Conversational boosting.yml
File metadata and controls
81 lines (70 loc) · 2.93 KB
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
kind: AdaptiveDialog
beginDialog:
kind: OnUnknownIntent
id: main
priority: -1
actions:
- kind: SearchAndSummarizeContent
id: search-content
latencyMessageSettings:
allowLatencyMessage: false
userInput: =System.Activity.Text
autoSend: false
variable: Topic.Answer
additionalInstructions:
responseCaptureType: FullResponse
- kind: ConditionGroup
id: has-answer-conditions
conditions:
- id: has-answer
condition: =!IsBlank(Topic.Answer)
actions:
- kind: SetVariable
id: setVariable_eWQVoG
variable: Topic.FormattedAnswer
value: |-
=If(
// If there are no citations
CountRows(Topic.Answer.Text.CitationSources) = 0,
// Render the original answer
Topic.Answer.Text.MarkdownContent,
// If there are citations, rebuild the Markdown answer entirely
Topic.Answer.Text.Content & Char(10) & Char(10) &
// Concatenate citations in Markdown format
Concat(
Topic.Answer.Text.CitationSources,
// Recreate the Url if there isn't one
"[" & Id & "]: " &
If(
// If there is no URL
IsBlank(Url),
If(
Left(Name,8) = "https://",
Substitute(Name, " ", "%20"),
"cite:" & Id
),
// Else use the returned URL Value.
Url
) &
// Improve file name formatting
" """ &
// Extract the file name, remove query if present
Substitute(
If(
Find("?", Last(Split(Name, "/")).Value) > 0,
Left(Last(Split(Name, "/")).Value, Find("?", Last(Split(Name, "/")).Value) - 1),
Last(Split(Name, "/")).Value
),
"%20", " "
)
& """",
// Line breaks between citations
Char(10) & Char(10)
)
)
- kind: SendActivity
id: sendActivity_skwikk
activity: "{Topic.FormattedAnswer}"
- kind: EndDialog
id: end-topic
clearTopicQueue: true