Directline speech node js connection - node.js

Hi I'm trying to enable the direct line speech channel with my chatbot developed in node js. I have done the settings by following https://learn.microsoft.com/en-us/azure/bot-service/bot-service-channel-connect-directlinespeech?view=azure-bot-service-4.0 also webchat sample taken from https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/03.speech/a.direct-line-speech. I'm getting the html page with microphone and the speech is converted to text but when send that is not received in my app service endpoint. Can someone guide me what may be wrong in my implementation.
or sharing any documentations that can help me in implementing this will also be very helpful.

Requirements:
We need to get the workspace and the bot installed into the workspace.
Get the bot connected into the Direct Line speech channel
Get the app services running and enable public access
Get the web app and connect it to the application services.
Build the static web app (HTML page) deploy it into the GitHub repository or any kind of repository. For this thread. Considered GitHub.
Launch the application in the browser.
Get the token from the created bot and use them to connect with bot created.
Output:
The following is the output achieved in the browser.

Related

How to set up Microsoft Bot SDK on live server with nodeJS

I've created a bot using the Microsoft Bot SDK, using some scaffolding code to create a bot that echoes your name. Doing gulp grok-serve the bot is hosted through ngrok and the messaging endpoint is at that temporary ngrok URL followed by /api/messages. Using this I've set up the bot to work with Microsoft Teams and I can successfully talk to the bot. I've now moved the code to be on a live server, however I'm not sure how to access the messaging endpoint through the live server. Using the server domain name followed by the name of the folder with the bot code in it, I get a 403 error. Following that with /api/messages gives a 404 error.

how to connect a flask chat application with dialogflow version 2 API

I want to connect my chat application with dialogflow version 2 which is already running on version 2 using client access token. But now i want to connect it with the new authorization system that the version 2 provides which includes google cloud account and google SDK system.
i have already done with the documentation that is provided by dialogflow https://dialogflow.com/docs/reference/v2-auth-setup
now please help me by sharing some code snippet that can connect my application with dialogflow V2 which is running on flask socket-io framework.

Using Azure Bot Service with non-Channel-Configurable Chat Service

When I create a bot in Slack, I can use channel configuration on Azure Bot Service to receive event/message from Slack and communicate with my Web App Bot which handles various functions.
However, when I create a bot in a chat service which is not supported in channel configuration (e.g., Discord), I need to set up a client in my Web App Bot (e.g., Discord.Net) to communicate with the service.
Then, although I guess the Direct Line channel (REST API) will handle communication between the Web App Bot and Bot Service, but am not sure if it's correct. Is my assumption right?
Also, it is not clear for me if there's an advantage of using Bot Service in this situation, because simply I may host an individual web app on Azure or another location and let it communicate with the chat service. Why do I need to add one more service to handle?
I suppose that one possible advantage could be that I can easily access various features (e.g., LUIS) via the Bot Service. Also, the bot can handle various platform like Skype or Cortana with one code.
But still I don't really understand this topic. Could anyone give me a suggestion and best practice?
Below is my current understanding, it could be wrong though.
Directline API isn't the easiest to work with, and making a Bot Framework bot work with Discord is going to take a good amount of work. But the purpose of the Directline is to be the connection between your bot (Azure Bot Service/Web App Bot) and Discord. To use the Directline API, you're going to:
1) Get your directline secret by registering your bot on Azure (Azure Bot Services)
2) Create your directline object, using above secret (this is the line of communication between ABS and Discord)
3) Use your directline object to POST activities to the bot from the user and Listen for activities from the bot
4) Additional purposes not related to conversation: your directline object will monitor connection status of your websockets, and keep the token refreshed for the conversations
The Directline-js repo has a good README and code samples, but bear in mind that the framework is constantly being improved. As of this writing, there are 8 pull requests waiting for review for the repo.
The AI Help Website wrote a preview back in July 2018 (before the release of v4) on how to use the Directline API with C#
And finally, the official documentation for the Directline API is here
As for connecting your bot with Discord, the Discord API reference has instructions on how to get your authorization token here.

How is BotFramework Emulator talking to locally hosted bot without BotConnector registration?

As far as I understand, the Emulator is using the DirectLine API to talk to the locally hosted bot, i.e. with http://localhost:3978/api/messages.
How is this possible? To use DirectLine API one needs to
register its bot in the BotConnector
provide the Messaging endpoint
enable DirectLine API and generate DirectLine API secret
The emulator fulfills only the messaging endpoint requirement (http://localhost:3978/api/messages) but still it works perfectly. Why do other channels require BotConnector registration?
So, based on the podcast linked in the GitHub issue provided by #Ezequiel Jadib, the emulator is emulating BotConnector services and as such can directly communicate to the locally hosted bot.
Dan Driscoll explains it would be possible to avoid DiretLine API and talk directly to the bot, though this would mean operating outside the BotFramework ecosystem and you would need your way to deal with security (and probably other things as well)

How to configure Node.js v3 bot on directline in a web app?

I built my bot using Node.js. It is working fine on web chat and Skype.
Now I want to use direct line to communicate my web app with my bot. I am confused on how I can maintain the URL in my node.js app.
I am trying something like that:
https://directline.botframework.com/api/conversations/abc123/how%20are%20you/BotConnector/NsNT2RG8oNA.cwA.Emk.8yB_FdFCy18b4iTcxBscDRxQVAB
Here you will find a DirectLine Node.js sample that implements a client to talk with a Node.js bot.
Remember that you also need to enable DirectLine in the Bot Developer portal in order to get the DirectLine credentials.

Resources