Bot Framework v4 Skills with Dialogs sample.
This bot has been created using the Bot Framework; it shows how to use a skill dialog from a root bot.
-
.NET Framework SDK version 6.0
# determine dotnet version dotnet --version
The solution uses dialogs, within both a parent bot (RootBot
) and a skill bot (RootBot
).
It demonstrates how to post activities from the parent bot to the skill bot and return the skill responses to the user.
-
RootBot
: this project shows how to consume a skill bot using aSkillDialog
. It includes:- A root dialog that can call different actions on a skill using a
SkillDialog
:- To send events activities.
- To send message activities.
- To cancel a
SkillDialog
usingCancelAllDialogsAsync
that automatically sends anEndOfConversation
activity to remotely let a skill know that it needs to end a conversation.
- A sample AdapterWithErrorHandler adapter that shows how to handle errors, terminate skills and send traces back to the emulator to help debugging the bot.
- A SkillsConfiguration class that can load skill definitions from the appsettings.json file.
- A startup class that shows how to register the different root bot components for dependency injection.
- A BotController that handles skill responses.
- A root dialog that can call different actions on a skill using a
-
SkillBot
: this project shows a modified CoreBot that acts as a skill. It receives event and message activities from the parent bot and executes the requested tasks. This project includes:- An ActivityRouterDialog that handles Event and Message activities coming from a parent and performs different tasks.
- Event activities are routed to specific dialogs using the parameters provided in the
Values
property of the activity. - Message activities are sent to CLU if configured and trigger the desired tasks if the intent is recognized.
- Event activities are routed to specific dialogs using the parameters provided in the
- A sample ActivityHandler that uses the
RunAsync
method onActivityRouterDialog
.
- An ActivityRouterDialog that handles Event and Message activities coming from a parent and performs different tasks.
-
Clone the repository.
git clone https://github.com/dannygar/skillsBot.git
-
Clone the template appsettings.json files in both project directories RootBot/appsettings.template.json and RootBot/appsettings.template.json into corresponding
appsettings.json
files -
Create a bot registration in the azure portal for the
RootBot
and update RootBot/appsettings.json with the AppId and password. -
Create a bot registration in the azure portal for the
SkillBot
and update SkillBot/appsettings.json with the AppId and password. -
Update the BotFrameworkSkills section in RootBot/appsettings.json with the AppId for the skill you created in the previous step.
-
(Optional) Configure the CLUEndpoint, CLUAPIKey and CLUProjectName section in the RootBot/appsettings.json if you want to run message activities through LUIS.
-
Open the
PersonalAssistantBot.sln
solution and configure it to start debugging with multiple processes.
Bot Framework Emulator is a desktop application that allows bot developers to test and debug their bots on localhost or running remotely through a tunnel.
- Install the Bot Framework Emulator version 4.8.0 or greater from here
- Launch Bot Framework Emulator
- File -> Open Bot
- Enter a Bot URL of
http://localhost:3978/api/messages
, theMicrosoftAppId
andMicrosoftAppPassword
for theRootBot
To learn more about deploying a bot to Azure, see Deploy your bot to Azure for a complete list of deployment instructions.
This repo has been populated by an initial template to help get you started. Please make sure to update the content to build a great experience for community-building.
As the maintainer of this project, please make a few updates:
- Improving this README.MD file to provide a great experience
- Updating SUPPORT.MD with content about this project's support experience
- Understanding the security reporting process in SECURITY.MD
- Remove this section from the README
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft. trademarks or logos is subject to and must follow: Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.