direct-line-botframework

Automatically send a message into the WebChat window in Bot Framework

空扰寡人 提交于 2019-12-06 16:48:21
I am using Microsoft Bot Framework and I created two bots. I am trying to build a simple HTML page that will show two webchat windows side by side, each for one of the two bots. The idea is to have an input box in the page, and when someone types into it, the text gets sent into both webchats at the same time. However, since webchats are basically iframes, there is not much I can do unless I make the webchat iframe expose some methods to the parent frame. This is the expected browser behaviour. So my question is: is there any way to control the webchat iframes from a parent frame, or the bot

How to set the User avatar dynamically in BotFramework-WebChat based on logged in user using OAuthCard

百般思念 提交于 2019-12-06 16:46:25
问题 I have developed a chat bot using Microsoft Bot Framework V4, and have used BotFramework-WebChat for providing the user to chat from website using DirectLine Token, I am able to set the bot avatar and the user avatar by assigning the static public image URL. The problem is that I want to set the user avatar dynamically in the WebChat using below steps Fetch the user icon using the Microsoft graph API after OAuthCard login Set the signed in user image in the Webchat styleSetOptions dynamically

Version compatibility issue Azure functions' Node and DirectlineJS es6 exports

拥有回忆 提交于 2019-12-06 14:19:06
End Goal: To create Azure Function running Botframework-DirectlineJS with binding to Bot (Framework) using DirectLine secret. Issue: The above mentioned Botframework-DirectlineJS uses ES6 export and Azure Functions support Node 6.5.0 max doc . Hence the question how to import successfully the DirectlineJS in the index.js file of Azure function? Error ``` 2017-05-23T07:17:45.939 Exception while executing function: Functions.adapter. mscorlib: D:\home\site\wwwroot\adapter\importexportwrapper.js:1 (function (exports, require, module, __filename, __dirname) { import { DirectLine } from

BotBuilder, Direct Line API returns “tokenParameters is missing User” with Enhanced authentication options

三世轮回 提交于 2019-12-06 12:53:20
I have a bot published on an Azure account, from which I'm trying to take the magic code out, so following the Direct Line documentation I improved the code to hide the token. But once the Enhanced authentication options are enabled I always get the same response. { "error": { "code": "BadArgument", "message": "tokenParameters is missing User." } } And I am not able to figure out how to complete the HTTP Request with the user data. The bot is based on BotFramework SDK v4, plus some controllers for requesting and refreshing the token using the encapsulted secret key. I added userId data to the

DirectLineJS receiving copies of Bot replies

自作多情 提交于 2019-12-06 04:14:26
I'm using DirectLineJS to comminucate from a custom webchat through a website. I'm using the format posted from Microsoft's github https://github.com/Microsoft/BotFramework-DirectLineJS how I have it implemented is var directLine; directLine= new DirectLine.DirectLine({ secret: "My_DirectLine_Secret", }); function sendReceiveActivity(msg) { document.getElementById("inputtext").value = ""; conversation.innerHTML = conversation.innerHTML + "ME - " + msg + "<br/><br/>"; directLine.postActivity({ from: { id: 'myUserId', name: 'myUserName' }, // required (from.name is optional) type: 'message',

Pass Custom Parameters from webchat control to bot framework

微笑、不失礼 提交于 2019-12-02 22:08:16
问题 So, I'm currently using this: <!DOCTYPE html> <html> <body> <div id="webchat"></div> <script src="https://cdn.botframework.com/botframework-webchat/preview/botchat.js"></script> <script> window.WebChat.renderWebChat({ directLine: window.WebChat.createDirectLine({ secret: 'YOUR_BOT_SECRET_FROM_AZURE_PORTAL' }) }, document.getElementById('webchat')); </script> </body> </html> and it works fine, however I have multiple QnA Knowledge base for different client applications. SO I would like to pass

How to pass real-time audio stream to the Direct Line Speech endpoint?

£可爱£侵袭症+ 提交于 2019-12-01 00:58:44
I am trying to use Direct Line Speech (DLS) in my custom voice app. The Voice app has access to the real-time audio streams which I want to (pcm encoded) it directly to Direct Line Speech that allows a back and forth communication in real-time. From the DLS Client sample code ( https://github.com/Azure-Samples/Cognitive-Services-Direct-Line-Speech-Client ), I see that the method ListenOneAsync() in Microsoft.CognitiveServices.Speech.Dialog.DialogServiceConnector namespace, but looks like it's capturing media from local microphone. But looking at the reply here ( Is new ms botbuilder directline

How to pass real-time audio stream to the Direct Line Speech endpoint?

爷,独闯天下 提交于 2019-11-30 19:54:20
问题 I am trying to use Direct Line Speech (DLS) in my custom voice app. The Voice app has access to the real-time audio streams which I want to (pcm encoded) it directly to Direct Line Speech that allows a back and forth communication in real-time. From the DLS Client sample code (https://github.com/Azure-Samples/Cognitive-Services-Direct-Line-Speech-Client), I see that the method ListenOneAsync() in Microsoft.CognitiveServices.Speech.Dialog.DialogServiceConnector namespace, but looks like it's

How to store & retrieve Bot Data in Azure Table storage with directLine channel?

℡╲_俬逩灬. 提交于 2019-11-29 08:31:32
I'm using Microsoft Bot Framework with directLine channel. My Bot is a part of company's customer portal from where I fetch some user information and store it in BotState using stateClient as shown below public ActionResult Index() { var userId = ClaimsPrincipal.Current.FindFirst(ClaimTypes.NameIdentifier).Value; GetTokenViaBootStrap().Wait(); var botCred = new MicrosoftAppCredentials( ConfigurationManager.AppSettings["MicrosoftAppId"], ConfigurationManager.AppSettings["MicrosoftAppPassword"]); var stateClient = new StateClient(botCred); BotState botState = new BotState(stateClient); BotData

how to connect to Microsoft bot framework from android cilent

笑着哭i 提交于 2019-11-28 12:18:40
I created a simple android app which sends a message though JSON format using restfull jersey WS which URL should i enter in my app that connects the bot? and how does that bot receive message and send back the response? As of now I am using bot emulator by Microsoft Thanks in advance. You can connect your android client with DirectLine Rest API, before that enble web chat in your bot dashboard. Please refer documentation about direct line approach for Bot framework. What you have to do is use https://directline.botframework.com/api/conversations as your endpoint and call those API as shown in