Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added page redirect to sharepoint link #278

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions DataverseIndexer/Conversational boosting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ beginDialog:
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,
Expand All @@ -51,10 +51,24 @@ beginDialog:
// Else use the returned URL Value.
Url
) &

With(
{
firstPos: Find("value=", Text) + 7, // we add 7 to make up for value="
lastPos: Find(">", Text, 1) // find the closing bracket
},
// only add "#page=<page number>" if brackets are found and document is pdf
If(
firstPos > 0 && lastPos > 0 && EndsWith(Lower(Name), ".pdf"),

"#" & "page=" & Mid(Text, firstPos, (lastPos - firstPos) - 1),
"" //add nothing if not found
)
)
&

// Improve file name formatting
" """ &

// Extract the file name, remove query if present
Substitute(
If(
Expand All @@ -64,14 +78,13 @@ beginDialog:
),
"%20", " "
)

& """",

// Line breaks between citations
Char(10) & Char(10)
)
)

- kind: SendActivity
id: sendActivity_skwikk
activity: "{Topic.FormattedAnswer}"
Expand Down