Botbuilder 4. Few bots on one app service - botframework

We want to build SAAS platform based on ms botbuilder. Specifically now we want to have many telegram bots on one backend (web app), instrumentation such as creation Bot Registrations, if needed, should be automated (prob except of creating a bot in telegramm).
I can't find any docs on how to address that but i guess theres 3 options:
1) Use directline api and create own adapter to speak with telegram api.
2) Use Azure script to create Bot registration. But i can't find a place where in web app configure app id and secret, these now are written in env vars on azure.
3) somehow deploy varios middlewares or enviroments (or slots) for each such registration. Lacking info on this aproach too much.
Maybe also some other options i'm not aware of?

Related

How to deploy a Question Answering BERT Model as a chat bot on MS Teams

I have a Text2SQL model (EditSQL: https://github.com/ryanzhumich/editsql) which I have configured to take a sentence as input and return a SQL query as output.
Now, I want to deploy this program as a chat bot application in Microsoft Teams.
I understand there's Microsoft bot framework that enables publishing a bot and the 3 options are described here.
https://learn.microsoft.com/en-us/learn/modules/choose-bot-building-tool/
However, I am not finding any of them suitable for my use case since I need to deploy a Question-Answering Bot where the Questions from users need to be sent to an external server like AWS and the response from AWS (could be an excel file) needs to be sent back to the user. Multiple questions can be the part of a conversation, so the chat client should be able to mark start and end of a conversation.
My problem:
What are the basic steps of exposing a ml model via a server so that it can be queried in production.
What are the tools that will allow me to make a client on Teams and a server for this model on AWS?
Please let me know if I should add more information on this.
Thanks
As you've seen, there are a bunch of tools/approaches to creating bots in the Microsoft world, for Teams or otherwise. Underneath, these all use the Bot Framework, but you can develop directly (i.e. write code), or use a higher-level tool like Bot Framework Composer - the choice is yours depending on your own internal skills. If you want to work with code directly, here are a bunch of bot samples, in multiple languages: https://github.com/microsoft/BotBuilder-Samples/tree/main/samples . For isntance, here is an example of integrating the Microsoft QnAMaker service into your bot: https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/python/49.qnamaker-all-features
Basically, if you go the development approach, your bot is just a web service. Once it receives the message, it can call out to any other service behind the scenes. That means it can receive a message, call out to an AWS service, receive the response, and send a reply to the user.
For multiple questions as part of a 'set' of chats, Bot Framework provides an idea called "dialogs" that should work for you.

Building and installing a Teams bot app for on-premises softwares

I am quite new to Teams and to building bots for it.
Using NodeJS, I built a simple prototype one that can receive notifications and send requests to my software.
However, my software is installed on-premises, which means all users using it have a different domain name for it (xxx.com, abc.com…). To be able to use it, the app needs to know what is the endpoint of the requests.
I wonder how I can build my bot app in those conditions and have it in the Teams Marketplace.
My question is :
I assume I want a team admin to set the domain name in some app settings before installing it for a team and users to use.
Is that possible somehow? Is it even possible to build such an bot app?
I suppose it is possible to achieve that by having the users install a custom app, but then the app cannot be in the Marketplace.
I also suppose I can ask individual users to first enter the name of the domain, it sounds repetitive and the info would then be stored in some userData.
Isn't there some teamData instead? Could it mean having one user set those information and have them stored for everyone?

BotFramework v4 Running Multiple Bots

I need to build a single Chatbot instance using BotFramework v4 that can handle multiple endpoints, and thus multiple AppID/Secret. I have seen notes online and in BotFramework samples that it is possible to do but I cannot find any specific examples for BotFramework v4.
Can anyone provide a sample on who to handle such scenario. For example, I would need to have endpoints /messages/hr and /messages/payroll, and depending on which endpoint is used the right AppID/Secret is used and specific MainMenuHrDialog or MainMenuPayrollDialog is launched.
In general, is it recommended to handle bots for different domains in the same bot project, or is it better to have separate projects for different domains with a NuGet package shared for common tasks.
So if I understand correctly, your desire to use different appIDs and secrets is gonna require multiple web app instances of similar botframework template code which executes different functions using an extension to their already existing api/messages endpoint(the default chatbot messaging endpoint). I'd recommend setting up a couple of azure web app instances along with a couple of bot channels registrations for connecting channels to your bot logic. Here's a decent resource for that: https://learn.microsoft.com/en-us/azure/bot-service/bot-builder-tutorial-deploy-basic-bot?view=azure-bot-service-4.0&tabs=csharp
Though this doesn't apply directly to your scenario, you might want to check out this sample repo here: https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/typescript_nodejs/16.proactive-messages. It shows you how you could open up those extra endpoints of /api/messages/hr or /api/messages/payroll. Additionally, I'm not sure how necessary the extra appIDs and secrets are for you but if your requirement is to ensure authorization when accessing these endpoints, I'd recommend looking into this prebuilt sample as well: https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/javascript_nodejs/18.bot-authentication. It possesses some info about authentication and how you might differentiate between users using a combination of conversation.activity.id and tokenResponses from AzureAD.

Does a ChatBot built using QnA Maker API require Virtual Machine

While calculating the pricing for deploying a chatbot developed using QnA Maker, i am supposed to select the App Service Plan.
https://azure.microsoft.com/en-in/pricing/calculator/
In the App Service section I am supposed to enter the following details
Region, Tier, number of instances and hours.
What does the instances mean here and on what basis should i select the Tier.
Does deploying a basic QnA bot using QnA Maker API require an instance. (does the instance imply a VM instance).
Currently, the limit is a 20-MB knowledge base used by QnA Maker.
Thank you.
Back to definitions
There are 2 different things here:
Your bot
QnAMaker
In fact you are not "deploying a bot developed using QnAMaker", you are "deploying a bot developed with Microsoft Bot Framework and using QnAMaker".
Your bot is a web API, with a simple endpoint ("xxx/api/messages") accepting POST requests and which will be used by the bot connector. Then on some cases it's calling QnAMaker but this call is a bit hidden if you use QnAMakerDialog in C# for example.
Hosting / Costs
To host a Web API in Azure (called an App Service), you will need an App Service Plan. There are different levels of Azure App Service Plan, depending on your needs:
You just need to select the one corresponding to your needs, no other actions are necessary (what is behind (VMs...) is not your purpose).
For example if you just want to demonstrate the use of a bot with QnAMaker, a Free App Service Plan is enough.
For the QnAMaker part, it's only calls of your QnAMaker project in background. Your project is exposed through the web on an URL. The use of QnAMaker is free, at the time of writing this reply (it's still a preview)
Last (but not least), there can be an additional cost depending on the channels you will be using to expose your bot. See Azure calculator for bot service for that: https://azure.microsoft.com/en-us/pricing/details/bot-service/

Difference between Microsoft Bot Framework and Azure Bot Service?

I want to create a bot, but I am confused what is exactly Bot Framework and Azure Bot service? Can anyone explain in detail?
The best way to understand the difference is going through the docs. The Azure Bot Service documentation is available here.
In a nutshell, Azure Bot Service provides a set of templates to get started with the creation of Bots and accelerate the development since it provides an integrated environment. Of course, the templates that it creates are based on the BotFramework. With Azure Bot Service, you can even code your bot directly from the Azure Portal Editor, from the comfort of your browser.
If you don't want to start with Azure right way, and want to develop your Bot locally first, etc, you might want to use the BotFramework builder bits; but as I said; once you se Azure Bot Service, you are able to download the generated bot and continue the development from your machine if you want.
Admittedly you asked your question a year and a half ago, but in early 2018 it seems as though Microsoft uses the two terms interchangeably for one product.
Take, for example the documentation link from the bot framework home page, the title of this page is Bot Service Documentation:
https://learn.microsoft.com/en-us/bot-framework/
Also, in the Azure pricing calculator only Azure Bot Service is listed (under both "Analytics" and "AI + Machine Learning"). "Azure Bot Service" is what appears on the invoice.
Finally, when you go to create a new resource and search for "bot" the only related items that you will see are for Azure Bot Service, there is no mention of Azure Bot Framework there either.
Bot Framework - is comprised of an open-source SDK and tools for end-to-end bot development.
Azure Bot Services - a cloud platform that hosts bots, helps you manage, connect, and deploy your bot across devices and popular channels
Bot Framework Service - a component of Azure Bot Service, that responsible to sending the info between the app and the channel
Microsoft Bot Service SDK

Resources