Skip to content
Merged
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
26 changes: 19 additions & 7 deletions copilot-studio/citations-topic/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# Citations (Topic)

This is a snippet that demonstrates how you can generate better looking citations in Copilot Studio.
This snippet demonstrates how you can generate better looking citations in Copilot Studio for [uploaded documents](https://learn.microsoft.com/microsoft-copilot-studio/nlu-documents).

This allows to both display a **title** for the document, but also to point to a **URL** when the citation link is clicked, for example to download or open the document.

> [!IMPORTANT]
> **This assumes that you're responsibe for storing the files in a location where they are accessible to your users, when clicked.**

The sample works both for uploaded files and other knowledge sources (e.g. public website, SharePoint / OneDrive).

With this sample, you have two options, that can be used indepently from each other:
1. Set a URL pointing to a folder where files are expected to be available to your users, when no URLs are available. For this, set the URL for your base folder in `Topic.UploadedFilesRootUrl`.
1. Set a mapping between each document and a URL location for the file. For this, udpdated the `Topic.FilesSources` table. Make sure that each file name is encoded in the same way as returned as citation when an answer is generated (e.g. use %20 instead of spaces, etc.)

![View of the citations](./assets/citations.png)

Expand All @@ -16,14 +27,15 @@ Citations (Topic) | [Henry Jammes](https://github.com/HenryJammes) ([@HenryJamme

1. Open a copilot in **Copilot Studio**
1. Select **Topics**
1. Select **+ Create**
1. Select **Topic**
1. Select **Create from blank**
1. Select the **...** in the upper right corner and select **Open code editor**
1. Select **System**
1. Select **Conversational boosting**
1. Select the **... More** in the upper right corner and select **Open code editor**
1. Click inside the code editor and **CTL + A for Windows** or **Command-A** for Mac to select all rows.
1. Paste the contents of the **[YAML-file](./source/citations.yaml)** inside the code editor.
1. Enter a **Name** for your Topic.
1. Select **Save**
1. Select **Close code editor**
1. If you're using a folder to store all of your documents, set the URL for your base folder in the `Topic.UploadedFilesRootUrl` string variable.
1. If you're using a different locations for each file, update the `Topic.FilesSources` table variable accordingly.
1. **Save**

## Disclaimer

Expand Down
Loading