Configuring Chatbots

Power Virtual Agents chatbots can be configured to identify multiple types of conversation and perform different actions.

This chapter describes how to configure and author your own chatbots. You will learn how to change the questions and responses used in your chatbot so that you can tailor your chatbot to your business scenario. By configuring the conversations your chatbots have, you will be able to handle both simple and complex interactions with users and increase customer satisfaction in relation to your chatbots.

The following topics will be covered in this chapter:

  • Defining topics
  • Configuring entities
  • Defining actions

By the end of this chapter, you will be able to create topics and entities, use a Power Automate flow with Power Virtual Agent chatbots, and use bot variables.

Defining topics

Power Virtual Agents works by identifying the subject that the user is asking about and then having a conversation about that subject.

Topics are the main subjects of the conversation. A Power Virtual Agents chatbot can have up to 1,000 topics. Each topic is a separate conversation path. It is the combination of topics in a chatbot that provides a natural conversational flow. You create topics for the tasks or requests that you need your chatbot to respond to.

Topics define the purpose of your chatbot and are the first step in authoring your chatbot.

A topic has two parts:

  • Trigger phrases: The keywords, phrases, or utterances that the user will enter
  • Conversation nodes: How your bot should respond

A topic has its own conversation flow with the bot. When a bot identifies a trigger for a topic, the conversation for that bot is initiated.

Each newly created bot includes predefined user and system topics to help you get started. Clicking on Topics in the Power Virtual Agents portal will show the sample user and system topics, as shown in the following screenshot:

Figure 16.1 – Sample topics

In the preceding screenshot, there are four lessons under User Topics that can help you understand how to author chatbot conversations. System Topics includes common interactions that can occur during a chatbot conversation.

You can use these to learn how to author your own bots or can adapt or delete them.

In this section, we will learn how to configure topics manually, create topics from existing content, and handle escalations and errors.

Configuring topics

A topic is a part of a conversation a customer has with a chatbot. You will need to create topics to handle each type of request your bot should handle. For instance, you might require a chatbot to respond to employee inquiries concerning travel and expenses.

You can start by collating a list of phrases that an employee might use and then grouping them into similar inquiries.

For example, you might collect the following sets of phrases for an organization's travel and expenses policies:

  • Accommodation: The policies for overnight hotel accommodation:
    • What level of hotel accommodation am I entitled to?
    • What else is included in my hotel stay?
  • Subsistence: The level of food and incidental expenses when working away from the office or home:
    • Is breakfast included in an overnight stay?
    • Can I claim for dinner?
    • Do I need a receipt for meals?
  • Car travel: Allowances for use of a vehicle when traveling to remote locations:
    • What is the mileage allowance for my car?
    • Can I share a car?
    • Can I hire a car?

In this example, the first-level bullets are the topics, and the second-level bullets are the trigger phrases. The end result for this example will be three topics, each having their own conversation flow. To create a new topic, select Topics in the Power Virtual Agents portal and then click on + New topic. The following page will be displayed:

Figure 16.2 – New topic

In the preceding screenshot, enter the topic in the Name field, enter the trigger phases, click on Add, and then click on Save topic.

A topic should have a minimum of 10 trigger phrases to be effective. Include phrases that mean the same thing, but are constructed in different ways. You can find guidance on collecting trigger phrases at https://docs.microsoft.com/azure/cognitive-services/luis/luis-concept-utterance.

Once you have added your trigger phrases, click on Go to authoring canvas. The authoring canvas is a graphical editor where you can add the conversation nodes for the topic. The authoring canvas starts with the trigger phrases and a welcome message. The authoring canvas allows you to add questions, messages, and other actions, as shown in the following screenshot:

Figure 16.3 – Authoring canvas

In the preceding screenshot, you can see Trigger Phrases at the top of the canvas with a blank Message field underneath. You need to provide a welcome message and then click on Add node to determine the conversation's path.

Clicking on Add node gives the following options:

  • Ask a question: Adds a new question node with the aim of getting a response from the user. The question can be from a string or number as a multiple-choice question, or an entity. 
  • Call an action: Calls a Power Automate flow or an authentication node to force the user to sign in.
  • Show a message: Displays a message in a textbox.
  • Add a condition: Available after a question node to control the flow of the conversation.
  • Go to another topic: Switch to a different topic. Only available on the last node.
  • End the conversation: There are two options. You can end with a survey or transfer to an agent. Only available on the last node.

The following screenshot shows a question node: 

Figure 16.4 – Question node

You add nodes to the canvas to build the topic's conversation path until you have completed your question flow. If you have existing questions and answers, you can extract the details and create new topics automatically.

Extracting topics from existing content

Many organizations will have procedures, product information, frequently asked questions, and other information in documents or on websites. 

Power Virtual Agents can extract information and create topics with trigger phrases. Selecting Suggest topics from the top of the Topics page, as shown in Figure 16.1, will open a window where you can specify the URL to your content. 

You can only use online content. Files should be added to OneDrive or another cloud service to be used for suggested topics.

After you have extracted the content, you can review the suggested topics and add them to your chatbot.

If you are using Dynamics 365 Customer Service Insights, you can select the topics from within Customer Service Insights and add the topics and trigger phrases to your chatbot.

There are several topics that handle conversations, such as Greetings, Thank you, and Goodbye. These are system topics.

Adding greetings and other system topics

A Power Virtual Agents chatbot includes several system topics to improve the usability of your chatbot. For example, there are topics for Greetings, Goodbye, and Thank you

You cannot edit the trigger phrases for system topics.

Your chatbot uses the most appropriate topic based on user input. If the chatbot cannot determine which topic to use, then the chatbot will prompt the user again. If the chatbot still cannot determine the user's intent, then the chatbot will use the Escalate system topic.

You may want to handle the escalation differently by prompting the user with different questions to try and pinpoint their intent. To change the default escalation behavior, add a fallback topic.

Your chatbot will have multiple topics and Power Virtual Agents will choose the most appropriate topic by matching the phrase entered by the user with the trigger phrases in the topics. You will then start on the conversation path defined in the authoring canvas, prompting the user with questions, and handling the responses.

A significant part of the success of a chatbot is language understanding. Power Virtual Agents includes AI to understand a user's intent and entities that define real-world concepts and objects.

Configuring entities

Power Virtual Agents attempts to extract information from the phrases entered by the user. This extracted information can be used to control the conversation's path. Power Virtual Agents uses entities to identify information in a textual phrase, for instance, names, dates, and numbers. Your chatbot can then use this information to decide on the appropriate next step in the conversation.

Entities are people, places, and things that a chatbot can identify from the phrases entered into a chatbot. Power Virtual Agents includes a set of pre-built entities for the most commonly used objects.

The benefit of entities is to reduce the number of questions asked by the chatbot. The following screenshot shows some of the pre-built entities included with Power Virtual Agents:

Figure 16.5 – Entities

The pre-built entities include the ability to identify simple things such as colors, or yes/no and true/false. The Date and time entity can identify a date from phrases such as tomorrow, next week, on Friday, as well as first week next year.

You can create custom entities for the domain-specific knowledge of your industry or organization to extend your chatbot's ability to recognize user input. 

Creating custom entities

If your chatbot handles a specific process or business scenario, you may need to provide the chatbot with assistance by teaching it the objects and terminology your organization uses. You do this by creating a custom entity. 

To create a new entity, select Entities in the Power Virtual Agents portal and click on + New custom entity. The following page will be displayed:

Figure 16.6 – Creating a custom entity

In the preceding screenshot, enter the topic in the Name field, enter each of the terms in List items, click on Add, and then click on Save.

You can add synonyms to assist the chatbot in matching. For instance, for travel expenses, you might add a receipt as an item and add the bill as a synonym.

For example, you might add the following entity for an organization's travel and expenses policies:

  • ExpenseType with the following items:
    • Mileage
    • Subsistence
    • Train fare
    • Hospitality

The example custom entity can be created as shown in the following screenshot:

Figure 16.7 – Example custom entity

Your entity can be used in the Ask a question node in the authoring canvas. Instead of multiple choice, you can select either a pre-built or custom entity, as shown in the following screenshot:

Figure 16.8 – Using a custom entity

In the preceding screenshot, an Ask a question node has been added and the custom entity chosen for Identify. You can then select which of the list options to use. In this example, three of the options have been chosen. The chatbot will use these list items to prompt the user in the conversation. The advantage of entities is that if the user had already used one of these terms earlier in the conversation, this question will be skipped, improving the conversation flow.

Entities are crucial to your chatbot being able to determine what a user is saying. You can use the many pre-built entities for dates, places, and numbers, and you can create custom entities to teach your chatbot about the terminology used within your organization or industry.

Your chatbot can also perform actions using the Call an action node.

Defining actions

A chatbot sometimes needs to perform actions on other systems or to retrieve data from other systems. You use Power Automate flows to perform actions. Power Virtual Agents can pass parameters to a Power Automate flow and receive data back from the flow and use that data in the conversation flow. For instance, a chatbot may handle customer order updates and so will use a Power Automate flow to fetch the order's status from the relevant system. In this section, you will learn how to use Power Automate flows from within a chatbot.

To call a Power Automate flow, use the Call an action node and select Create a flowas shown in the following screenshot:

Figure 16.9 – Call an action

Clicking on Create a flow will launch the Power Automate editor using the Power Virtual Agents flow template. There is a Power Virtual Agents connector that you use within a Power Automate flow. If there are Power Automate flows that use the Power Virtual Agents connector, they will be listed here and will be available to select.

The responses a user enters and the choices they make can be stored and used in the conversational flow. Variables are used to save the responses. Variables can control the conversational flow or be displayed in messages to users.

Using variables

Variables let you save responses from your users in a conversation so that you can reuse them later in conversations. You can also use variables as input parameters to Power Automate flows and save the output results to parameters.

The response for each question asked in a conversation is stored as a variable. You can then pass the variable to a Power Automate flow or use the variable later in the topic, or even in other topics, to control the questions being asked. For example, you can use a variable to decide to skip a question if you have the information you need at that point.

Variables can be defined as either of the following:

  • Topic: The variable can only be used within its topic. 
  • Bot: The variables can be used by any topic. 

Many chatbots need to interact with other systems, either to record the outcome of the conversation, or to retrieve information and display it to the user. You have learned that a Power Automate flow is the way you achieve these requirements. You have also learned that variables are a good way of making your chatbot simpler and improving the friendliness of your chatbot.

Summary

This chapter described how you can configure chatbots to handle different business scenarios.

You should now understand how to author chatbots. You should be able to add topics with trigger phrases, add entities identifying the customer intent, and then perform actions using Power Automate. Configuring the conversations with these elements will build chatbots that are more relevant to the users' requests and will increase the customer satisfaction of your chatbots. 

In the next chapter, we will learn how to use Power BI to create visualizations of your data and use those visualizations with the other components of the Power Platform.

Questions

After reading this chapter, test your knowledge with these questions. You will find the answers to these questions under Assessments at the end of the book:

  1. Which component of Power Virtual Agents is used to define the conversation path in a chatbot?

A) Entities
B) Topics
C) Actions
D) Variables

  1. What should you define in Power Virtual Agents to identify the intent in the phrases used by customers?

A) Entities
B) Topics
C) Actions
D) Variables

  1. What should you add to your Power Virtual Agents to prevent escalations to a human agent when your chatbot cannot determine the user's intent?

A) Fallback topic
B) System topic
C) Variable
D) Entity

  1. How many times will a Power Virtual Agents chatbot prompt a user by default before escalating to a human agent?

A) One
B) Two
C) Three
D) Five

Further reading

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.141.6