Muokkaa

Jaa


Summarize Knowledge Base articles with GPT for efficient customer support

Applies to: Dynamics 365 Customer Service

Important

Power Virtual Agents capabilities and features are now part of Microsoft Copilot Studio following significant investments in generative AI and enhanced integrations across Microsoft Copilot.

Some articles and screenshots may refer to Power Virtual Agents while we update documentation and training content.

In today's fast-paced world, customers expect quick and efficient solutions to their queries. Integrating a knowledge base search into your bots can provide customers with self-service options, allowing them to find the information they need quickly and easily.

In our blog post, we discussed the benefits of knowledge base integration and provided step-by-step instructions for adding this feature to your bots using Power Virtual Agents.

In this article, we take things a step further and explore how you can integrate the knowledge base from Dynamics 365 with ChatGPT for even more efficient and effective summarization. By combining the power of Dynamics 365's knowledge base with ChatGPT's natural language processing capabilities, you can provide customers with even more accurate and personalized responses to their queries.

Watch the video from GitHub at https://github.com/microsoft/Dynamics-365-FastTrack-Implementation-Assets/.

Add the action to your topic in your self-service bots

In our previous article, we added the search flow action to the "Greetings" topic in our bot. The "Greetings" topic has preconfigured trigger phrases and a question. At the output of the question, we had called the "Search Dynamics 365 knowledge articles" flow action, as shown in the following figure.

Screenshot of the Search Dynamics 365 knowledge articles flow action, diverting into multiple conditions.

The action's output is the result of the knowledge base search. The value is stored in the variable bot.jsonResult1 (text), and the count of the articles that were returned in the search result is stored in the variable articleCount1 (number), which is redirected to condition to check if the search returned any article or not, such as in articleCount1 (number) is greater than 0.

Create a Power Automate for summarizing the article using ChatGPT

In this example, we'll demonstrate how to use an HTTP action to process text received from the PVA bot and invoke ChatGPT's API for article summarization. The result of the action is then returned to the PVA bot.

Screenshot of the Summarize Text using Chat G P T screen, showing the connection between Power Virtual Agents to Input Text.

The following are the specifics of the HTTP action required to invoke ChatGPT's API. To use this action, you must obtain your own secret from the OpenAI portal and substitute the value of the "Authorization" header with "Bearer (replace with the actual token)". Use the following URL to go to OpenAI portal and select view API keys and follow the steps to obtain and key.

Screenshot of the H T T P screen, showing the Method, U R I, Headers, Queries, Body, and Cookie fields.

Incorporate an action into your self-service bots that triggers Power Automate

Next, we'll incorporate an action that triggers Power Automate to invoke ChatGPT's API for article summarization based on the output of the condition. The output of the flow is then redirected to the Result-dialog to display the result in an adaptive card.

Screenshot of the Greeting screen, showing the Action and Redirect fields that appear after setting conditions.

Save the topic and publish the bot

The following illustration shows the output from our example.

Screenshot of a test bot chat window with example output for booking a travel.

When the business user chooses the Show Content action, the chat displays a summary of the knowledge article with a link to view it in the portal.

Screenshot of a test bot chat window showing a message with details for booking a travel.

For more information about showing the results in an adaptive card, go to Render results in the documentation.

Artifacts

Download the solution zip file from https://github.com/microsoft/Dynamics-365-FastTrack-Implementation-Assets/.