Microsoft Copilot Studio legacy bots

This section describes Microsoft Copilot Studio legacy bots.

Microsoft Copilot Studio legacy bots was formerly known as Power Virtual Agents (PVA).

From VoiceAI Connect Version 3.20, you can't create new Copilot Studio legacy bots (formerly known as Microsoft Power Virtual Agents or PVA). However, your existing Copilot Studio legacy bots are still supported. To create new bots, use Microsoft Copilot Studio, as described in Microsoft Copilot Studio.

The Microsoft Copilot Studio legacy platform lets you build a bot without code. To integrate VoiceAI Connect functionality with a Copilot Studio legacy bot, you need to use a tool called Bot Framework Composer. This tool enables you to send Activities to VoiceAI Connect and receive notifications from VoiceAI Connect to the bot.

For an introduction to Copilot Studio legacy, including basic concepts which will provide you with a better understanding of how to integrate VoiceAI Connect with a Copilot Studio legacy bot, go to Microsoft's documentation.

Receiving notifications from VoiceAI Connect

To receive notifications from VoiceAI Connect, you need to create a shared variable in Copilot Studio legacy (shared between Bot Framework Composer and Copilot Studio legacy) and create a trigger in Composer.

Create a shared variable

  1. Open a new topic in the web UI and leave the trigger phrases empty (this makes the topic unreachable for the caller).

  1. Add an 'Ask a question' to create a variable:

  1. Edit the variable name and type according to your needs. Change its usage to 'Bot' and then select the 'External sources can set values' option. This enables you to use this variable in Composer, which can be accessed in Composer using virtualagent.<variable name>.

Create a new trigger in Bot Framework Composer

  1. Open your bot in Composer:

  1. Create a new trigger:

  1. Select the trigger type as Activities (Activity received):

  1. Create a new condition (use if/else for one notification type and switch for multiple notifications):

  1. Use turn.dialogEvent.name to extract the notification name:

  1. Compare the received event name with the desired event name. (in the example, it's noUserInput).

  2. Save the requested property in virtualagent object. virtualagent.<param name> (this saves the parameter in the variable that you created in the web UI).

Using a shared variable

After creating the shared variable, it's accessible in all of the Copilot Studio legacy under bot.<variable name>:

 

Sending actions to VoiceAI Connect

Each time you want to send an action to VoiceAI Connect and not to the user, you need to do the following:

Create an event in Bot Framework Composer

  1. Open your bot in Composer.

  1. Add a new dialog to your bot (three dots near the bot name):

  1. In the 'begin dialog', add 'Send a response':

  1. Click 'show code' to add AudioCodes custom actions:

  1. Add the desired action lets, for example, start call recording:

  1. Publish this section in Composer and tie it up in the web UI. Note that you must publish the changes from Composer to use them in the web UI:

  1. In the desired topic, add 'redirect to another topic', and then select the topic that you created in Composer. Topics created in Composer are displayed in light blue:

  1. Save the topic and then publish it.

Activity structure:

[Activity
  type = event
  name = <event name>
  channelData = ${json(`
  {
    "activityParams": {
      "<parameter name 1>": "<parameter value>",
      "<parameter name 2>": "<parameter value>"
    }
  }
`)}
]

Saving Channel Data

Channel data is an object that VoiceAI Connect sends in the start of the conversation (see Call initiation for details) In order to save and use channel Data we need to follow these steps:

To save channel data in bot framework composer:

  1. Open your bot in the bot framework composer.

  1. Create a new trigger.

  1. Select trigger type as Activities (Activity received).

  1. Create a new condition (use if/else for one notification type and switch for multiple notifications).

  1. Use turn.activity.name to catch the channel event.

  1. Save the JSON object using json(turn.activity.channelData).

Here the JSON is saved to a composer variable.

  1. Save the requested property in virtualagent object. virtualagent.<param name> (this will save the parameter in the variable created in the web UI).

    A full list of the parameters exist in customizing call initiation behavior.

  1. Redirect from channel event to a Copilot Studio legacy topic. By default, VoiceAI Connect sends two consecutive events to a Copilot Studio legacy bot in the start of a conversation - a channel event and a startConversation event to start the greeting topic. If your bot handles the channel event, and redirects it to a Copilot Studio legacy topic or responds with a greeting, you may disable the startConversation event (see Call initiation for the configuration and more details)

  2. After consuming the channel event, select Begin a Power Virtual Agents topic.

  1. Select your desired topic.