What are the benefits of using CloudAdapter over the deprecated BotFrameworkAdapter? - botframework

BotFrameworkAdapter has been deprecated and CloudAdapter is the replacement so we must port our bots.
Have searched all the Microsoft and BotBuilder sites and can not locate any documentation describing the benefits of the new adapter and any porting guidelines. (Yes, there is sample echobot code but no background or context for the change)
For example, for a self-hosted C#/.NET Teams Bot built using the Botbuilder using Azure AD for Authentication, what new functionality is gained when we port to the new adapter?
Are there any performance gains?
For those who have successfully ported their Teams bots to the CloudAdapter, any gotchas or learning that would benefit others starting this task?

Related

Integrating Microsoft Web Chat without using Azure Bot Service

I am currently looking at using Microsoft Web Chat to interact with my existing Node Js application built on MS Bot Framework Core but uses DialogFlow as NLU.
Current implementation: Web Page -> Custom UI Widget -> Connects to Node.js app built on MS Botframework Core -> Queries DialogFlow NLU to identify Intent -> Node.js app constructs the Dialog -> Gives response to user.
Looking at the Web Chat component, I cannot find references using any other NLU except Azure Bot Service. Is it mandatory to use Azure Bot Service/LUIS NLU to integrate with Web Chat?
I have also looked at offline-directline npm module but the last dev on the module is more than 3 years ago.
Firstly, responding with a quick message about using offline-directline, you should feel reasonably comfortable with it. It is a few years old, but seems to stand the test of time with continued use and little in the way of issues that I have heard.
Another option would be to use a 'browser bot'. In this scenario, the bot is contained within the hosting page's html/scripts. So, there is no reliance on using Direct Line. I don't know your whole setup, so this may or may not align with your overall needs and architecture.
As for using Web Chat with something other than the Azure Bot Service, this would be an uphill battle. In theory, this is probably achievable to some degree. The issue is that Web Chat is heavily integrated with the BotFramework-DirectLineJS library. You might be able to cherry pick specific components from Web Chat, replace the Direct Line library with a make of your own, and modify the remaining code to work with your 'service'. But, I'm not certain the effort is worth it. That is something you would have to decide for yourself.
If you do go this direction, you will likely need to configure your 'service' to send messages that conform to the BotFramework schemas when communicating with Web Chat. Even without the dependency on Direct Line for connecting to the service, much of Web Chat is still oriented towards what an incoming message looks like (i.e. a BotFramework Activity) and handling it according to the properties it contains.
To start, here are a few areas you should review in order to correctly configure you service to handle inbound and outbound messages going to and coming from Web Chat:
BotFramework Activity schema
BotFramework Card schema
BotFramework Transcript schema
Web Chat's Activity, Card, Attachments, etc. Types - at present, these are loosely defined. I would expect that to change at some point in the future which may prove to be a changing break in your specific scenario.
This is not exhaustive and would require greater research as there are likely other considerations than the few I've listed above. But, again, this may not be necessary if you decide to utilize offline-directline.

OpenWhisk support of websockets and static websites

I'm choosing a serverless platform for my projects. I have explored AWS and found it excessively complicated: they provide an enormous bunch of settings but some basic scenarios are been too hard to implement.
The other platform looking promising for me is IBM Cloud with its OpenWhisk. And I'd like to check if the necessary capabilities are either implemented or in close plans for implementation.
Questions
Can I use websocket for my functions as a trigger for connect, message and disconnect? I found only a half year old discussion and nothing more. But this feature is demanded for real time applications.
Can I have static websites in both my custom domain and in subpath? I saw recipes where a docker container and lambda functions were employed. But writing my own implementation of Nginx looks nonsense. But this feature is also strongly demanded for single page applications (SPA) and there can be multiple such SPAs on one domain.
This blog with an IBM Cloud Functions overview has links and answers to your second question. There are tutorials on how to use custom domains with IBM Cloud Functions as backend for applications (see this tutorial with static page / SPA custom domain, and recipes for Express and Flask).
IBM Cloud Functions also has a package to post to Websockets. AFAIK there is functionality to listen to Websockets. My understanding is that serverless is incompatible with the "always on" nature of Websockets and the serverless runtime would need an API gateway or similar to manage the communication. If something is received, the action would be invoked.
Support for websockets for the ActionLoop proxy (used by Go,Swift,Python,PHP,Rust and Java) is here: https://github.com/sciabarracom/incubator-openwhisk-runtime-go/tree/websocket-support.
It can be used to build runtimes that support websocket but you need to deploy the runtime by yourself using Kubernetes. The support had ben postponed as an integration of OpenWhisk with Knative is a better path to include it in OpenWhisk.

MS Botbuilder and SMS using Bandwidth.com

I'm developing chatbots on MS botbuilder SDK (4). My new client have requirement to create chatbot that is connected to SMS, I was using twilio earlier for that very well but they using Bandwidth.com, so I would like to know what are my options: as i get it botbuilder SDK dont have out of the box connection to this provider, but maybe I can use directline or other approach somehow?
Another option I see is don't use botbuilder and just develop c# web app using Bandwith API.
And in general I'm interested in how we can connect to custom platforms if it's not web-based?
In order to accomplish this, you have a few options. Here is a couple of possibilities. Hopefully, others can chime in with more options for you.
One option is to build what is referred to internally as a "connector". Essentially you need to translate what bot framework speaks activity into whatever bandwidth.com speaks.
Another option is to build an adapter like this one for Alexa.

LUIS Offline Support

This might be a basic query but I wanted to confirm if there is any way of using the LUIS services/functionality offline without consuming the online APIs and generating the public key online. By offline, I mean to say if there are any supporting libraries/DLLs available for on-premise solutions by which we can build the Intends/Utterences/Entities and train the NLP system offline.
(The reason for asking this question is that I want to integrate LUIS with my existing Microsoft Bot application. However, our organization limits the software usage to utilize only on-premise offline software and any online software/services/APIs such as Azure APIs are restricted.)
Assuming that there is no such offline support for LUIS AI, are there any other libraries that would provide such support for .NET apps. I have come across Apache OpenNLP but that seems to more of Java-oriented offering.
Any inputs/suggestions on this would be appreciated.
Luis now has the ability to be fully off-cloud and on-premise through a docker container pull. This would be available for on-premise and Azure's IoT Edge (intelligent Edge) products.
Keep in mind
The described solution still requires a connection for Azure LUIS billing purposes that at the time of this writing is at a 15 minute interval. I believe this will be adjusted at some point in the future but it is something to keep in mind and plan for.
Link to Container Support in Azure Cognitive Services
As well, specifically, LUIS has full integration via this scenario. Where you can install and run LUIS docker containers. Please, keep in mind at the time of this writing this is ONLY for LUIS. Not QNA, not Bing Spell Check, *not analytics from the LUIS endpoints but there is a container work around for that.
Also, not speech priming or sentiment analysis and a few other features listed in the article.
Lastly, you can look into "Azure Stack" and IoT Edge here
It's a promising start. There are work arounds you may have to engineer while these services bare out more fruit but keep asking questions and keep raising concerns and more features will surely come!
LUIS is based on an online use, like almost all Microsoft Cognitive Services (except Custom vision compact models for example). There is no possibility for offline use, even if it may be useful for some cases like mobile use also.
Moreover (see here in the official documentation):
Is LUIS available on-premises or in private cloud? => No
For your 2nd question, StackOverflow may not be the right place for this (see https://stackoverflow.com/help/on-topic) and... I don't have a good solution! But would be interested to know one

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