A Bot Framework Direct Line secret can be added to the list of required connections. This will enable advanced features to be actioned from the dashboard such as 'hand-off' to human.
To get the Direct Line secret, open the bot's Channels section and under the Direct Line listing select 'Edit'. If it's empty then select 'Add new site' to generate the secret keys, or else select the existing site to show secret keys.
To enable Direct Line add 'bot-framework' and the following properties to the dashboard's connections config.
connections: {
'bot-framework': {
'directLine': "",
'conversationsEndpoint': "",
'webchatEndpoint': ""
}
}
{
'conversationId': 'XXX',
'token': 'XXX',
'expires_in': 'XXX',
'streamUrl': 'https://url',
'referenceGrammarId': 'XXX'
}
In certain cases you might want to be able to hand-off a conversation with a bot to a human agent.
- Create a bot.
- Setup Application Insights in Azure portal.
- To manage bot hand-off state you will need to create CosmosDB with MongoDB API.
- You may wish to copy the mongodb Connection String under CosmosDB account settings for later use.
- Create Cognitive Services Luis app for sentiment analysis.
- You may wish to copy the Luis App Id for later use.
You can checkout the sample QnA project or add the hand-off to human functionality into an existing bot using the botbuilder-handoff npm package.
npm install botbuilder-handoff --save
- If you need to customise the hand-off package you can checkout the Bot-HandOff source which is available on the npm-handoff branch.
- Checkout the sample Bot HandOff project and do npm install.
npm install
- In this sample the bot will need to be run using the following node environment variables:
MICROSOFT_APP_ID=app_id
MICROSOFT_APP_PASSWORD=app_password
MICROSOFT_DIRECTLINE_SECRET=direct_line_secret_key
MONGODB_PROVIDER='mongodb://cosmos_db_connection_string'
APPINSIGHTS_INSTRUMENTATIONKEY=app_insights
CG_SENTIMENT_KEY=luis_app_id
node dist/app.js
-
Open browser instance(s) at:
http://localhost:3978/webchat?s=direct_line_secret_key
You may wish to refer to the Bot HandOff readme for instructions to act as an Agent.
-
Update your Ibex dashboard config with the Bot Framework details. (Refer to the inline help section for more info.)
- Download ngrok and add 'ngrok' to your environment path.
You can verify installation with
ngrok -v
. - Run
ngrok http 3978
- Copy your ngrok Forwarding address:
https://********.ngrok.io
- In Bot Framework settings, Configuration section, paste the ngrok Forwarding address into the Messaging endpoint followed by '/api/messages' and Save changes. The messaging endpoint should look something like:
https://********.ngrok.io/api/messages