Training
Learning path
Create agents with Microsoft Copilot Studio - Online Workshop - Training
Learn how to create agents with Microsoft Copilot Studio.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
APPLIES TO: Composer v1.x and v2.x
This article explains how to create a root bot and local skill in the same Composer session, and test their interaction locally.
Composer creates the root and skill bot files in separate projects. When you create the local skill, Composer adds to the root bot project a reference to the skill bot project.
Note
Each dialog can have its own recognizer. A recognizer is a component of your bot that examines incoming messages to determine the users intention by evaluating all predefined intents. Each recognizer type uses a different technique to determine which intent, if any, best matches the user's input.
The bots in this article use the Orchestrator and Regular expression recognizers.
Create your initial, root bot. It will consume the skill you create later.
In the Home view, create a new empty bot:
RootBot
.The Get started panel contains links to more information about creating bots. You can close it for now.
Orchestrator, an intent recognizer, can recognize intents without LUIS or the need for extra Azure resources. In later steps, you'll change the recognizer type and add an Intent recognized trigger to allow the user to start the skill.
EchoSkill
.At this point, Composer has created the skill and added it to your project.
Tip
Composer includes a warning, that your skill doesn't yet have a manifest. The manifest isn't needed to complete this article. Composer will create a manifest for you when you publish your skill to Azure.
The greeting is triggered when the skill bot is accessed directly by the user—when used as a root bot. This greeting won't be triggered when the skill bot is invoked as a skill from another bot.
Select the EchoSkill dialog's Greeting trigger.
Select the Send a response action and change the greeting to:
Welcome to the **EchoBot**. I will repeat what you enter.
You can define an event the root bot should initially send when it starts the skill.
Every event activity should have a name
property assigned.
Add a "startSkill" event trigger to the skill to work as a greeting when the skill is invoked from a skill consumer.
Add a new trigger to the EchoSkill dialog. On the Create a trigger page:
Select the new Event received trigger.
In the properties pane, set the trigger's Condition property to:
=turn.activity.name == "startSkill"
On the authoring canvas, add a Send a response action to the trigger.
Set the response to:
I will repeat what you enter, until you enter **stop**.
This response is the first message the user will receive when another bot uses a "startSkill" event to start the skill.
Update the unknown intent trigger to echo the user's utterance.
Select the EchoSkill dialog's Unknown intent trigger.
On the authoring canvas, select the Send a response action.
In the properties pane, change the Responses under Bot Responses to:
You said, ${turn.activity.text}
false
to let the skill loop. By default, Auto end dialog is true
.Since the echo skill will now loop, you need to give the user a way to exit from the skill and return to the root bot.
Select the EchoSkill dialog.
Change the Recognizer/Dispatch type to Regular expression, which can recognize intents without LUIS or the need for extra Azure resources.
To the EchoSkill dialog, add an Intent recognized trigger.
Name it stop
and set its regEx pattern to stop|cancel|quit
.
This trigger will fire for any message that contains the strings "stop", "cancel", or "quit" anywhere in the utterance.
To the new stop trigger, add a Send a response action to respond to the user's input. Set the bot response to:
Thanks for using the echo skill
Then add a second action. Select the Dialog management > End this dialog action.
Now, your local skill is ready! The next step is to call the skill from the root bot.
Update the root bot to start the skill when the user enters "echo".
Select the RootBot dialog and add an Intent recognized trigger.
Name it echo
and use the following trigger phrases:
- echo
To the new echo trigger, add a Send a response action to respond to the user's input. Set the bot response to:
Forwarding you to the echo skill
Add an Access external resources > Connect to a skill action.
In the properties pane for the Connect to a skill action, set the following properties:
In the Skill Dialog Name field, select the skill you want to connect to, the EchoSkill.
By default, the Skill Endpoint field is set to Local Composer. Composer will connect to the skill running locally on your machine. Composer doesn't need a manifest to call a local skill.
Verify that Allow interruptions is false
.
This prevents the root bot from starting new conversations with the skill if the use enters "echo" while the skill is active.
Verify that Activity processed is true
.
When the root bot calls the skill, it will consume the original activity and send a different one to the skill bot.
Switch the Activity to Show code and use this template:
[Activity
type = event
name = startSkill
]
See the Structured response template section in the Language generation article for more information.
This will help the user tell the root bot responses apart from the echo skill's.
Update the Unknown intent trigger in the RootBot dialog.
Select the Send a response action and change the response to:
Enter **echo** to access the echo skill
You now can test the skill bot and its connection with the consumer bot.
Start the bots locally. This allows you to test access to the echo skill from the root bot and that the echo skill can end and return control to the root bot.
You don't need Azure resources for the local bot-to-bot connection.
Select Start all in the upper-right corner of the screen. This tells Composer to start all local bots in the project.
Once the bots have started, the Local bot runtime manager opens. Use Start and stop local bot runtimes ( ) to show or hide the manager.
In the Local bot runtime manager, open the RootBot in Web Chat.
Interact with the root bot, then enter echo
to have the root bot start the skill.
Interact with the skill, then enter stop
to have the echo skill end and return control to the root bot.
To make your skill available to other bots, you need to publish it. For more information, see how to Publish a skill. Once you do so, you'll have a remote skill that other bots can consume.
To connect your bot to a remote skill, see how to Connect to a remote skill. The remote skill can be one you published, or one another developer has made available.
Training
Learning path
Create agents with Microsoft Copilot Studio - Online Workshop - Training
Learn how to create agents with Microsoft Copilot Studio.