SlideShare a Scribd company logo
1 of 46
Microsoft Bot Framework
Node.js Edition
Jens Siebert (@jens_siebert)
WebMontag Kassel, 29. Januar 2018
https://www.slideshare.net/JensSiebert1
Chatbots
A chatbot is an application, often available via messaging platforms and
using some form of intelligence, that interacts with a user via a
conversational user interface (CUI).
(Joe Mayo, Programming the Microsoft Bot Framework)
Messaging Platform
Chatbots
Chatbot
Service
Service
Service
AI Service
(z.B. NLP)
Conversational UI
Backend Business Logic User Interface
Messaging Plattformen
Conversational User Interface
VoiceUserInterface
TextUserInterface
Speech
Speech
Recognition
Text
Text
Natural Language
Processing
Intent
Intent Intent Handling Request
Response Intent Handling Text
Text Speech Synthesis Speech
Beispiel: UPS Bot auf Skype
Warum sollte ich mich damit beschäftigen?
[…] as messaging apps have grown to dominate both phones and
workplaces, we see conversations with other humans being
supplemented by intelligent chatbots. As these platforms improve, they
will learn to understand the context and intent of conversations,
making interactions more lifelike and therefore more compelling.
The explosion of interest in the marketplace and mainstream media
leads to a corresponding rise in developer interest […]
(ThoughtWorks Technology Radar, Volume 16)
Warum sollte ich mich damit beschäftigen?
http://www.businessinsider.de/the-messaging-app-report-2015-11
Warum sollte ich mich damit beschäftigen?
https://www.twilio.com/learn/commerce-communications/how-consumers-use-messaging
Warum sollte ich mich damit beschäftigen?
https://www.twilio.com/learn/commerce-communications/how-consumers-use-messaging
Warum sollte ich mich damit beschäftigen?
https://www.gartner.com/smarterwithgartner/top-trends-in-the-gartner-hype-cycle-for-emerging-technologies-2017/
Anwendungsfälle für Chatbots
• E-Commerce
• Information
• Enterprise Productivity
• Intelligent Assistant
• IoT
Vorteile und Nachteile
• Konversation: CUIs bieten, durch Nutzung geschriebener oder gesprochener Sprache,
einen natürlicheren Zugang zu Informationen.
• Kontext: Es finden keine Kontextwechsel (z.B. unterschiedliche Bedienparadigmen bei
mobilen Apps) statt.
• Bereitstellung: Die Bereitstellung eines Chatbots ist für den Anwender transparent. Keine
Installation, keine Updates, immer aktuell.
• Geräte-unabhängig: Die Interaktion mit dem Chatbot kann mit allen Geräten erfolgen,
die von einer Messaging-Plattform unterstützt werden.
• Plattform-unabhängig: Die Interaktion mit dem Chatbot kann mit allen Plattformen
erfolgen, die von einer Messaging-Plattform unterstützt werden.
• Notwendigkeit: Es gibt bereits eine erfolgreiche mobile App für einen Service. Welche
Vorteile bringt ein zusätzlicher Chatbot?
• Angemessenheit: Ist ein CUI die angemessene Benutzerschnittstelle für einen Service?
• Kritikalität: Bietet ein Chatbot die richtige Form der Interaktion für einen Service?
Bot Builder SDK
Das Microsoft Bot Framework
Bot Builder
.NET
Bot Builder
Node.js
Bot
Connector
Channels
Azure Bot Service
Chatbot
(ASP.NET/Node.js)
Backend
Services
AI Services
(LUIS)
Das Microsoft Bot Framework
• Bot Connector Client
• Messages/Activities
• Dialog-Management
• State-Management
• GUI-Elemente
• Anbindung an AI-Services (LUIS)
Das Microsoft Bot Framework
Bot
Connector
Channel Chatbot
Backend
Service
AI Service
Activity
Route
Message
Query
Query
Response
Response
Response
Route
Response
Quickstart
https://docs.microsoft.com/en-us/bot-framework/nodejs/bot-builder-nodejs-quickstart
Quickstart
npm init
npm install botbuilder --save
npm install restify --save
Chatbot-Basis
const restify = require("restify");
const builder = require("botbuilder");
let server = restify.createServer();
server.listen(process.env.port || process.env.PORT || 3979, function () {
console.log("%s listening to %s", server.name, server.url);
});
let connector = new builder.ChatConnector({
appId: process.env.MICROSOFT_APP_ID,
appPassword: process.env.MICROSOFT_APP_PASSWORD
});
server.post("/api/messages", connector.listen());
Der Wasserfall
Dialog
<Step>
Enter first
name
<Step>
Enter last
name
<Step>
Enter e-mail
address
<Step>
Enter company
name
input
input
input
Dialog-Implementierung
let bot = new builder.UniversalBot(connector, [
function(session) {
session.send("Create a new profile...");
builder.Prompts.text(session, "Please enter your first name.");
},
function(session, result) {
session.dialogData.firstname = result.response;
builder.Prompts.text(session, "Please enter your last name.");
},
[…]
function(session, result) {
session.dialogData.company = result.response;
session.send(`* ${session.dialogData.firstname} ${session.dialogData.lastname}n*
${session.dialogData.email}n* ${session.dialogData.company}`);
builder.Prompts.confirm(session, "Is this correct?");
},
function(session, result) {
if (result.response) {
// Profil speichern
}
}
]);
Eingabeaufforderungen
let bot = new builder.UniversalBot(connector, [
function(session) {
session.send("Create a new profile...");
builder.Prompts.text(session, "Please enter your first name.");
},
function(session, result) {
session.dialogData.firstname = result.response;
builder.Prompts.text(session, "Please enter your last name.");
},
[…]
function(session, result) {
session.dialogData.company = result.response;
session.send(`* ${session.dialogData.firstname} ${session.dialogData.lastname}n*
${session.dialogData.email}n* ${session.dialogData.company}`);
builder.Prompts.confirm(session, "Is this correct?");
},
function(session, result) {
if (result.response) {
// Profil speichern
}
}
]);
Prompts.attachment
Prompts.choice
Prompts.confirm
Prompts.number
Prompts.text
Prompts.time
Bot Framework Emulator
https://docs.microsoft.com/en-us/bot-framework/bot-service-debug-emulator
Bot Framework Emulator
SearchDialog
Interaktion mit mehreren Dialogen
MainDialog
<Step>
SearchOptions
<Step>
EventSelection
<Step>
EventDetails
EventRegistrationDialog
ProfileCreationDialog
[…]
[…]
search
register
create
Der Dialog-Stack
DialogStack
mainDialog
profileCreation
session.beginDialog
(′profileCreation′);
DialogStack
mainDialog
profileCreation
session.endDialog();
DialogStack
mainDialog
session.beginDialog
(′mainDialog′);
Der Dialog-Stack
bot.dialog("mainMenu", [
function(session) {
// Auswahl „Suchen“, „Registrieren“, „Profil erstellen“
},
function(session, result) {
if (result.response.entity.toLowerCase().startsWith("search")) {
session.beginDialog("search");
}
else if (result.response.entity.toLowerCase().startsWith("create")) {
session.beginDialog("create");
}
else {
session.send("Search and Profile Creation are currently the only things that you can do");
session.replaceDialog("mainMenu");
}
},
function(session, result) {
session.replaceDialog("mainMenu");
}
]);
bot.dialog(„create", [
[…]
function(session) {
session.endDialog();
}
]);
Session.beginDialog
Session.cancelDialog
Session.endConversation
Session.endDialog
Session.endDialogWithResult
Session.replaceDialog
Dialog-Actions
Enter first name
Enter last name
Enter e-mail
Enter company
name
restart()
cancel()
cancel()
cancel()
cancel()
help()
quit()
status()
?
Dialog-Actions
bot.dialog("create", [
function(session, result) {
session.send("Create a new profile...");
builder.Prompts.text(session, "Please enter your first name.");
},
[…]
])
.beginDialogAction("profileCreationHelp", "profileCreationHelp", {
matches: /^help$/i
})
.cancelAction("cancelAction", "Canceled Profile Creation.", {
matches: /^cancel$/i,
confirmPrompt: "This will cancel the Profile Creation. Are you sure?"
})
.reloadAction("reloadAction", "Restarting Profile Creation.", {
matches: /^restart$/i
})
.endConversationAction("endConversation", "Leaving Conversation…", {
matches: /^quit$/i,
confirmPrompt: "This will end the current Conversation. Are you sure?"
});
Der Dialog-Stack
DialogStack
mainDialog
profileCreation
session.beginDialog
(′profileCreation′);
DialogStack
mainDialog
profileCreation
session.beginDialogAction
(′profileCreationHelp′);
profileCreationHelp
DialogStack
mainDialog
profileCreation
session.endDialog();
profileCreationHelp
Dialoge erweitern mit UI-Elementen
Message Attachments & Rich Cards
• Animation Card
• Audio Card
• Video Card
• Hero Card
• Thumbnail Card
• Receipt Card
• SignIn Card
• Adaptive Card
Message
Attachment
Rich Card
Media
Entity
Speech
Adaptive Cards
let message = new builder.Message(session).addAttachment({
contentType: "application/vnd.microsoft.card.adaptive",
content: {
type: "AdaptiveCard",
body: [{
type: "TextBlock",
text: `### ${json.Name}`
},
{
type: "TextBlock",
text: `${turndownService.turndown(json.ShortDescription)}`
},
{
type: "Image",
url:`https://dev.virtualearth.net/REST/v1/Imagery/Map/...`,
size: "strech"
},
{
type: "TextBlock",
text: `${json.Location.Name}, ${json.Location.Street}, ${json.Location.PLZ} […]`
}]
}
});
npm install adaptivecards --save
Natural Language Processing (NLP)
bot.dialog("search", [
function(session, result) {
const options = [
"All Events",
"Upcoming Events",
"Past Events"
];
builder.Prompts.choice(
session,
"Which Events would you like too see?",
options,
{
retryPrompt: "Please select a valid option!",
listStyle: builder.ListStyle.button
}
);
},
[…]
if (result.response.entity.toLowerCase().startsWith("upcoming")) {
[…]
}
else if (result.response.entity.toLowerCase().startsWith("past")) {
[…]
}
else {
[…]
}
[…]
- „Kommando-artig“
- Keine natürliche Sprache
Language Understanding Intelligent Service
https://www.luis.ai
Utterances
„Show me a list of upcoming events“
Intents
„Search“
Entities
SearchOption.All
SearchOption.Upcoming
SearchOption.Past
Modellierung
Training & Publishing
LUIS Modell im Code einbinden
const LuisHost = "westus.api.cognitive.microsoft.com";
const ModelId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
const KeyId = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
const LuisModelUrl = `https://${LuisHost}/luis/v2.0/apps/${ModelId}?subscription-key=${KeyId}`;
let recognizer = new builder.LuisRecognizer(LuisModelUrl);
bot.dialog("search", new builder.IntentDialog({ recognizers: [recognizer] })
.onBegin(function(session) {
session.send("Welcome to LUIS event search. Here are some examples that I can recognize: "Show all events"…");
})
.matches("Search", [
function(session, result) {
let entity = builder.EntityRecognizer.findEntity(result.entities, "SearchOption");
if (!entity) {
session.endDialog("Sorry, I did not understand...");
}
else {
let searchOption = entity.resolution.values[0];
[…]
}
},
[…]
]);
Azure Bot Service erstellen
https://portal.azure.com
Deployment mit azure-cli
Azure CLI Download: https://docs.microsoft.com/de-de/cli/azure/install-azure-cli
Anleitung: https://docs.microsoft.com/de-de/azure/app-service/app-service-web-get-started-nodejs
az webapp deployment source config-zip
--resource-group <resource_group>
--name <app_name>
--src appfiles.zip
Testen in Web Chat
Kanäle konfigurieren
Beispiel: DNUGPBBot in Skype
Weitere Themen
• State Data Management
• Advanced Message Handling
• Channel-specific Functionality
• Localization
• Hand-off to Human
• Cortana Skills
Literatur (Leider nur für .NET/C#)
Ausgaben 6/2017-8/2017
Vielen Dank!
https://dev.botframework.com
https://docs.microsoft.com/bot-framework
Slides: https://www.slideshare.net/JensSiebert1
Code: https://bitbucket.org/jenssiebert/dnugpbchatbot
Demo-Bot (WebChat): http://dnugpbbot.azurewebsites.net
Twitter: @jens_siebert

More Related Content

Similar to Microsoft Bot Framework (Node.js Edition)

Chatbots - A CMD for Humans (Ort Braude 2018)
Chatbots - A CMD for Humans (Ort Braude 2018)Chatbots - A CMD for Humans (Ort Braude 2018)
Chatbots - A CMD for Humans (Ort Braude 2018)Moaid Hathot
 
Chatbots - A CMD for Humans (Global Azure Bootcamp 2018, Tel-Aviv, Israel)
Chatbots - A CMD for Humans (Global Azure Bootcamp 2018, Tel-Aviv, Israel)Chatbots - A CMD for Humans (Global Azure Bootcamp 2018, Tel-Aviv, Israel)
Chatbots - A CMD for Humans (Global Azure Bootcamp 2018, Tel-Aviv, Israel)Moaid Hathot
 
Practical Microsoft Bot Framework for Office 365 developers
Practical Microsoft Bot Framework for Office 365 developersPractical Microsoft Bot Framework for Office 365 developers
Practical Microsoft Bot Framework for Office 365 developersOlli Jääskeläinen
 
Bot & AI - A Bot for Productivity
Bot & AI - A Bot for ProductivityBot & AI - A Bot for Productivity
Bot & AI - A Bot for ProductivityMarvin Heng
 
Azure Bot Services - Malaysia
Azure Bot Services - MalaysiaAzure Bot Services - Malaysia
Azure Bot Services - MalaysiaCheah Eng Soon
 
IRJET - A Study on Building a Web based Chatbot from Scratch
IRJET - A Study on Building a Web based Chatbot from ScratchIRJET - A Study on Building a Web based Chatbot from Scratch
IRJET - A Study on Building a Web based Chatbot from ScratchIRJET Journal
 
ESPC Teams week Microsoft Teams & Bot Framework – a Developer’s Perspective
ESPC Teams week Microsoft Teams & Bot Framework – a Developer’s PerspectiveESPC Teams week Microsoft Teams & Bot Framework – a Developer’s Perspective
ESPC Teams week Microsoft Teams & Bot Framework – a Developer’s PerspectiveThomas Gölles
 
Bot-Tender: A Chat Bot Walks into a Bar - TechBash 2017
Bot-Tender: A Chat Bot Walks into a Bar - TechBash 2017Bot-Tender: A Chat Bot Walks into a Bar - TechBash 2017
Bot-Tender: A Chat Bot Walks into a Bar - TechBash 2017Eran Stiller
 
Building a bot with an intent
Building a bot with an intentBuilding a bot with an intent
Building a bot with an intentAbhishek Sur
 
Blazor + Bot Framework = a Microsoft Teams Platform Dream Team
Blazor + Bot Framework = a Microsoft Teams Platform Dream TeamBlazor + Bot Framework = a Microsoft Teams Platform Dream Team
Blazor + Bot Framework = a Microsoft Teams Platform Dream TeamThomas Gölles
 
Da 0 all'AI conversazionale usando Microsoft Azure
Da 0 all'AI conversazionale usando Microsoft AzureDa 0 all'AI conversazionale usando Microsoft Azure
Da 0 all'AI conversazionale usando Microsoft AzureMarco Parenzan
 
2019 11 26 BotTO November 2019 Meetup at TD
2019 11 26 BotTO November 2019 Meetup at TD2019 11 26 BotTO November 2019 Meetup at TD
2019 11 26 BotTO November 2019 Meetup at TDBruno Capuano
 
Build a great conversationalist using Azure Bot Service 2018
Build a great conversationalist using Azure Bot Service 2018Build a great conversationalist using Azure Bot Service 2018
Build a great conversationalist using Azure Bot Service 2018Radoslav Gatev
 
An introduction to Microsoft Bot Framework
An introduction to Microsoft Bot FrameworkAn introduction to Microsoft Bot Framework
An introduction to Microsoft Bot FrameworkTaswar Bhatti
 
Microsoft teams & bot framework - A developer's perspective
Microsoft teams & bot framework - A developer's perspectiveMicrosoft teams & bot framework - A developer's perspective
Microsoft teams & bot framework - A developer's perspectiveThomas Gölles
 
Dynamics 365 Saturday Amsterdam 02/2018 - Dynamics 365 and chatbots
Dynamics 365 Saturday Amsterdam 02/2018 - Dynamics 365 and chatbotsDynamics 365 Saturday Amsterdam 02/2018 - Dynamics 365 and chatbots
Dynamics 365 Saturday Amsterdam 02/2018 - Dynamics 365 and chatbotsJoris Poelmans
 
Introduction to Microsoft Bot Framework
Introduction to Microsoft Bot FrameworkIntroduction to Microsoft Bot Framework
Introduction to Microsoft Bot FrameworkSam Fernando
 

Similar to Microsoft Bot Framework (Node.js Edition) (20)

Chatbots - A CMD for Humans (Ort Braude 2018)
Chatbots - A CMD for Humans (Ort Braude 2018)Chatbots - A CMD for Humans (Ort Braude 2018)
Chatbots - A CMD for Humans (Ort Braude 2018)
 
Chatbots - A CMD for Humans (Global Azure Bootcamp 2018, Tel-Aviv, Israel)
Chatbots - A CMD for Humans (Global Azure Bootcamp 2018, Tel-Aviv, Israel)Chatbots - A CMD for Humans (Global Azure Bootcamp 2018, Tel-Aviv, Israel)
Chatbots - A CMD for Humans (Global Azure Bootcamp 2018, Tel-Aviv, Israel)
 
Microsoft bot framework
Microsoft bot frameworkMicrosoft bot framework
Microsoft bot framework
 
Practical Microsoft Bot Framework for Office 365 developers
Practical Microsoft Bot Framework for Office 365 developersPractical Microsoft Bot Framework for Office 365 developers
Practical Microsoft Bot Framework for Office 365 developers
 
Bot & AI - A Bot for Productivity
Bot & AI - A Bot for ProductivityBot & AI - A Bot for Productivity
Bot & AI - A Bot for Productivity
 
Azure Bot Services - Malaysia
Azure Bot Services - MalaysiaAzure Bot Services - Malaysia
Azure Bot Services - Malaysia
 
Conversational AI: What's New?
Conversational AI: What's New?Conversational AI: What's New?
Conversational AI: What's New?
 
IRJET - A Study on Building a Web based Chatbot from Scratch
IRJET - A Study on Building a Web based Chatbot from ScratchIRJET - A Study on Building a Web based Chatbot from Scratch
IRJET - A Study on Building a Web based Chatbot from Scratch
 
ESPC Teams week Microsoft Teams & Bot Framework – a Developer’s Perspective
ESPC Teams week Microsoft Teams & Bot Framework – a Developer’s PerspectiveESPC Teams week Microsoft Teams & Bot Framework – a Developer’s Perspective
ESPC Teams week Microsoft Teams & Bot Framework – a Developer’s Perspective
 
Bot-Tender: A Chat Bot Walks into a Bar - TechBash 2017
Bot-Tender: A Chat Bot Walks into a Bar - TechBash 2017Bot-Tender: A Chat Bot Walks into a Bar - TechBash 2017
Bot-Tender: A Chat Bot Walks into a Bar - TechBash 2017
 
Building a bot with an intent
Building a bot with an intentBuilding a bot with an intent
Building a bot with an intent
 
Blazor + Bot Framework = a Microsoft Teams Platform Dream Team
Blazor + Bot Framework = a Microsoft Teams Platform Dream TeamBlazor + Bot Framework = a Microsoft Teams Platform Dream Team
Blazor + Bot Framework = a Microsoft Teams Platform Dream Team
 
Whats a Chat bot
Whats a Chat botWhats a Chat bot
Whats a Chat bot
 
Da 0 all'AI conversazionale usando Microsoft Azure
Da 0 all'AI conversazionale usando Microsoft AzureDa 0 all'AI conversazionale usando Microsoft Azure
Da 0 all'AI conversazionale usando Microsoft Azure
 
2019 11 26 BotTO November 2019 Meetup at TD
2019 11 26 BotTO November 2019 Meetup at TD2019 11 26 BotTO November 2019 Meetup at TD
2019 11 26 BotTO November 2019 Meetup at TD
 
Build a great conversationalist using Azure Bot Service 2018
Build a great conversationalist using Azure Bot Service 2018Build a great conversationalist using Azure Bot Service 2018
Build a great conversationalist using Azure Bot Service 2018
 
An introduction to Microsoft Bot Framework
An introduction to Microsoft Bot FrameworkAn introduction to Microsoft Bot Framework
An introduction to Microsoft Bot Framework
 
Microsoft teams & bot framework - A developer's perspective
Microsoft teams & bot framework - A developer's perspectiveMicrosoft teams & bot framework - A developer's perspective
Microsoft teams & bot framework - A developer's perspective
 
Dynamics 365 Saturday Amsterdam 02/2018 - Dynamics 365 and chatbots
Dynamics 365 Saturday Amsterdam 02/2018 - Dynamics 365 and chatbotsDynamics 365 Saturday Amsterdam 02/2018 - Dynamics 365 and chatbots
Dynamics 365 Saturday Amsterdam 02/2018 - Dynamics 365 and chatbots
 
Introduction to Microsoft Bot Framework
Introduction to Microsoft Bot FrameworkIntroduction to Microsoft Bot Framework
Introduction to Microsoft Bot Framework
 

More from Jens Siebert

Microservices mit Rust
Microservices mit RustMicroservices mit Rust
Microservices mit RustJens Siebert
 
Backend-Services mit Rust
Backend-Services mit RustBackend-Services mit Rust
Backend-Services mit RustJens Siebert
 
TinyML – Machine Learning für eingebettete Systeme
TinyML – Machine Learning für eingebettete SystemeTinyML – Machine Learning für eingebettete Systeme
TinyML – Machine Learning für eingebettete SystemeJens Siebert
 
Deep Learning mit TensorFlow.js
Deep Learning mit TensorFlow.jsDeep Learning mit TensorFlow.js
Deep Learning mit TensorFlow.jsJens Siebert
 
Chatbots bauen mit dem Microsoft Bot Framework
Chatbots bauen mit dem Microsoft Bot FrameworkChatbots bauen mit dem Microsoft Bot Framework
Chatbots bauen mit dem Microsoft Bot FrameworkJens Siebert
 
Integrating The Things Network Applications with Azure IoT Services
Integrating The Things Network Applications with Azure IoT ServicesIntegrating The Things Network Applications with Azure IoT Services
Integrating The Things Network Applications with Azure IoT ServicesJens Siebert
 
Embedded JavaScript
Embedded JavaScriptEmbedded JavaScript
Embedded JavaScriptJens Siebert
 
Windows 10 IoT Core
Windows 10 IoT CoreWindows 10 IoT Core
Windows 10 IoT CoreJens Siebert
 
Microsoft Bot Framework (.NET Edition)
Microsoft Bot Framework (.NET Edition)Microsoft Bot Framework (.NET Edition)
Microsoft Bot Framework (.NET Edition)Jens Siebert
 
Windows 10 IoT Core
Windows 10 IoT CoreWindows 10 IoT Core
Windows 10 IoT CoreJens Siebert
 
Windows 10 IoT Core
Windows 10 IoT CoreWindows 10 IoT Core
Windows 10 IoT CoreJens Siebert
 

More from Jens Siebert (19)

WebAssembly
WebAssemblyWebAssembly
WebAssembly
 
Embedded Rust
Embedded RustEmbedded Rust
Embedded Rust
 
Embedded Rust
Embedded RustEmbedded Rust
Embedded Rust
 
Microservices mit Rust
Microservices mit RustMicroservices mit Rust
Microservices mit Rust
 
Backend-Services mit Rust
Backend-Services mit RustBackend-Services mit Rust
Backend-Services mit Rust
 
TinyML – Machine Learning für eingebettete Systeme
TinyML – Machine Learning für eingebettete SystemeTinyML – Machine Learning für eingebettete Systeme
TinyML – Machine Learning für eingebettete Systeme
 
Deep Learning mit TensorFlow.js
Deep Learning mit TensorFlow.jsDeep Learning mit TensorFlow.js
Deep Learning mit TensorFlow.js
 
Chatbots bauen mit dem Microsoft Bot Framework
Chatbots bauen mit dem Microsoft Bot FrameworkChatbots bauen mit dem Microsoft Bot Framework
Chatbots bauen mit dem Microsoft Bot Framework
 
Integrating The Things Network Applications with Azure IoT Services
Integrating The Things Network Applications with Azure IoT ServicesIntegrating The Things Network Applications with Azure IoT Services
Integrating The Things Network Applications with Azure IoT Services
 
GraphQL
GraphQLGraphQL
GraphQL
 
Embedded JavaScript
Embedded JavaScriptEmbedded JavaScript
Embedded JavaScript
 
Windows 10 IoT Core
Windows 10 IoT CoreWindows 10 IoT Core
Windows 10 IoT Core
 
Microsoft Bot Framework (.NET Edition)
Microsoft Bot Framework (.NET Edition)Microsoft Bot Framework (.NET Edition)
Microsoft Bot Framework (.NET Edition)
 
Electron
ElectronElectron
Electron
 
Windows 10 IoT Core
Windows 10 IoT CoreWindows 10 IoT Core
Windows 10 IoT Core
 
Physical Web
Physical WebPhysical Web
Physical Web
 
Windows 10 IoT Core
Windows 10 IoT CoreWindows 10 IoT Core
Windows 10 IoT Core
 
TypeScript
TypeScriptTypeScript
TypeScript
 
TypeScript
TypeScriptTypeScript
TypeScript
 

Recently uploaded

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 

Recently uploaded (20)

Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 

Microsoft Bot Framework (Node.js Edition)

  • 1. Microsoft Bot Framework Node.js Edition Jens Siebert (@jens_siebert) WebMontag Kassel, 29. Januar 2018 https://www.slideshare.net/JensSiebert1
  • 2. Chatbots A chatbot is an application, often available via messaging platforms and using some form of intelligence, that interacts with a user via a conversational user interface (CUI). (Joe Mayo, Programming the Microsoft Bot Framework)
  • 3. Messaging Platform Chatbots Chatbot Service Service Service AI Service (z.B. NLP) Conversational UI Backend Business Logic User Interface
  • 5. Conversational User Interface VoiceUserInterface TextUserInterface Speech Speech Recognition Text Text Natural Language Processing Intent Intent Intent Handling Request Response Intent Handling Text Text Speech Synthesis Speech
  • 6. Beispiel: UPS Bot auf Skype
  • 7. Warum sollte ich mich damit beschäftigen? […] as messaging apps have grown to dominate both phones and workplaces, we see conversations with other humans being supplemented by intelligent chatbots. As these platforms improve, they will learn to understand the context and intent of conversations, making interactions more lifelike and therefore more compelling. The explosion of interest in the marketplace and mainstream media leads to a corresponding rise in developer interest […] (ThoughtWorks Technology Radar, Volume 16)
  • 8. Warum sollte ich mich damit beschäftigen? http://www.businessinsider.de/the-messaging-app-report-2015-11
  • 9. Warum sollte ich mich damit beschäftigen? https://www.twilio.com/learn/commerce-communications/how-consumers-use-messaging
  • 10. Warum sollte ich mich damit beschäftigen? https://www.twilio.com/learn/commerce-communications/how-consumers-use-messaging
  • 11. Warum sollte ich mich damit beschäftigen? https://www.gartner.com/smarterwithgartner/top-trends-in-the-gartner-hype-cycle-for-emerging-technologies-2017/
  • 12. Anwendungsfälle für Chatbots • E-Commerce • Information • Enterprise Productivity • Intelligent Assistant • IoT
  • 13. Vorteile und Nachteile • Konversation: CUIs bieten, durch Nutzung geschriebener oder gesprochener Sprache, einen natürlicheren Zugang zu Informationen. • Kontext: Es finden keine Kontextwechsel (z.B. unterschiedliche Bedienparadigmen bei mobilen Apps) statt. • Bereitstellung: Die Bereitstellung eines Chatbots ist für den Anwender transparent. Keine Installation, keine Updates, immer aktuell. • Geräte-unabhängig: Die Interaktion mit dem Chatbot kann mit allen Geräten erfolgen, die von einer Messaging-Plattform unterstützt werden. • Plattform-unabhängig: Die Interaktion mit dem Chatbot kann mit allen Plattformen erfolgen, die von einer Messaging-Plattform unterstützt werden. • Notwendigkeit: Es gibt bereits eine erfolgreiche mobile App für einen Service. Welche Vorteile bringt ein zusätzlicher Chatbot? • Angemessenheit: Ist ein CUI die angemessene Benutzerschnittstelle für einen Service? • Kritikalität: Bietet ein Chatbot die richtige Form der Interaktion für einen Service?
  • 14. Bot Builder SDK Das Microsoft Bot Framework Bot Builder .NET Bot Builder Node.js Bot Connector Channels Azure Bot Service Chatbot (ASP.NET/Node.js) Backend Services AI Services (LUIS)
  • 15. Das Microsoft Bot Framework • Bot Connector Client • Messages/Activities • Dialog-Management • State-Management • GUI-Elemente • Anbindung an AI-Services (LUIS)
  • 16. Das Microsoft Bot Framework Bot Connector Channel Chatbot Backend Service AI Service Activity Route Message Query Query Response Response Response Route Response
  • 18. Quickstart npm init npm install botbuilder --save npm install restify --save
  • 19. Chatbot-Basis const restify = require("restify"); const builder = require("botbuilder"); let server = restify.createServer(); server.listen(process.env.port || process.env.PORT || 3979, function () { console.log("%s listening to %s", server.name, server.url); }); let connector = new builder.ChatConnector({ appId: process.env.MICROSOFT_APP_ID, appPassword: process.env.MICROSOFT_APP_PASSWORD }); server.post("/api/messages", connector.listen());
  • 20. Der Wasserfall Dialog <Step> Enter first name <Step> Enter last name <Step> Enter e-mail address <Step> Enter company name input input input
  • 21. Dialog-Implementierung let bot = new builder.UniversalBot(connector, [ function(session) { session.send("Create a new profile..."); builder.Prompts.text(session, "Please enter your first name."); }, function(session, result) { session.dialogData.firstname = result.response; builder.Prompts.text(session, "Please enter your last name."); }, […] function(session, result) { session.dialogData.company = result.response; session.send(`* ${session.dialogData.firstname} ${session.dialogData.lastname}n* ${session.dialogData.email}n* ${session.dialogData.company}`); builder.Prompts.confirm(session, "Is this correct?"); }, function(session, result) { if (result.response) { // Profil speichern } } ]);
  • 22. Eingabeaufforderungen let bot = new builder.UniversalBot(connector, [ function(session) { session.send("Create a new profile..."); builder.Prompts.text(session, "Please enter your first name."); }, function(session, result) { session.dialogData.firstname = result.response; builder.Prompts.text(session, "Please enter your last name."); }, […] function(session, result) { session.dialogData.company = result.response; session.send(`* ${session.dialogData.firstname} ${session.dialogData.lastname}n* ${session.dialogData.email}n* ${session.dialogData.company}`); builder.Prompts.confirm(session, "Is this correct?"); }, function(session, result) { if (result.response) { // Profil speichern } } ]); Prompts.attachment Prompts.choice Prompts.confirm Prompts.number Prompts.text Prompts.time
  • 25. SearchDialog Interaktion mit mehreren Dialogen MainDialog <Step> SearchOptions <Step> EventSelection <Step> EventDetails EventRegistrationDialog ProfileCreationDialog […] […] search register create
  • 27. Der Dialog-Stack bot.dialog("mainMenu", [ function(session) { // Auswahl „Suchen“, „Registrieren“, „Profil erstellen“ }, function(session, result) { if (result.response.entity.toLowerCase().startsWith("search")) { session.beginDialog("search"); } else if (result.response.entity.toLowerCase().startsWith("create")) { session.beginDialog("create"); } else { session.send("Search and Profile Creation are currently the only things that you can do"); session.replaceDialog("mainMenu"); } }, function(session, result) { session.replaceDialog("mainMenu"); } ]); bot.dialog(„create", [ […] function(session) { session.endDialog(); } ]); Session.beginDialog Session.cancelDialog Session.endConversation Session.endDialog Session.endDialogWithResult Session.replaceDialog
  • 28. Dialog-Actions Enter first name Enter last name Enter e-mail Enter company name restart() cancel() cancel() cancel() cancel() help() quit() status() ?
  • 29. Dialog-Actions bot.dialog("create", [ function(session, result) { session.send("Create a new profile..."); builder.Prompts.text(session, "Please enter your first name."); }, […] ]) .beginDialogAction("profileCreationHelp", "profileCreationHelp", { matches: /^help$/i }) .cancelAction("cancelAction", "Canceled Profile Creation.", { matches: /^cancel$/i, confirmPrompt: "This will cancel the Profile Creation. Are you sure?" }) .reloadAction("reloadAction", "Restarting Profile Creation.", { matches: /^restart$/i }) .endConversationAction("endConversation", "Leaving Conversation…", { matches: /^quit$/i, confirmPrompt: "This will end the current Conversation. Are you sure?" });
  • 31. Dialoge erweitern mit UI-Elementen
  • 32. Message Attachments & Rich Cards • Animation Card • Audio Card • Video Card • Hero Card • Thumbnail Card • Receipt Card • SignIn Card • Adaptive Card Message Attachment Rich Card Media Entity Speech
  • 33. Adaptive Cards let message = new builder.Message(session).addAttachment({ contentType: "application/vnd.microsoft.card.adaptive", content: { type: "AdaptiveCard", body: [{ type: "TextBlock", text: `### ${json.Name}` }, { type: "TextBlock", text: `${turndownService.turndown(json.ShortDescription)}` }, { type: "Image", url:`https://dev.virtualearth.net/REST/v1/Imagery/Map/...`, size: "strech" }, { type: "TextBlock", text: `${json.Location.Name}, ${json.Location.Street}, ${json.Location.PLZ} […]` }] } }); npm install adaptivecards --save
  • 34. Natural Language Processing (NLP) bot.dialog("search", [ function(session, result) { const options = [ "All Events", "Upcoming Events", "Past Events" ]; builder.Prompts.choice( session, "Which Events would you like too see?", options, { retryPrompt: "Please select a valid option!", listStyle: builder.ListStyle.button } ); }, […] if (result.response.entity.toLowerCase().startsWith("upcoming")) { […] } else if (result.response.entity.toLowerCase().startsWith("past")) { […] } else { […] } […] - „Kommando-artig“ - Keine natürliche Sprache
  • 35. Language Understanding Intelligent Service https://www.luis.ai Utterances „Show me a list of upcoming events“ Intents „Search“ Entities SearchOption.All SearchOption.Upcoming SearchOption.Past
  • 38. LUIS Modell im Code einbinden const LuisHost = "westus.api.cognitive.microsoft.com"; const ModelId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; const KeyId = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const LuisModelUrl = `https://${LuisHost}/luis/v2.0/apps/${ModelId}?subscription-key=${KeyId}`; let recognizer = new builder.LuisRecognizer(LuisModelUrl); bot.dialog("search", new builder.IntentDialog({ recognizers: [recognizer] }) .onBegin(function(session) { session.send("Welcome to LUIS event search. Here are some examples that I can recognize: "Show all events"…"); }) .matches("Search", [ function(session, result) { let entity = builder.EntityRecognizer.findEntity(result.entities, "SearchOption"); if (!entity) { session.endDialog("Sorry, I did not understand..."); } else { let searchOption = entity.resolution.values[0]; […] } }, […] ]);
  • 39. Azure Bot Service erstellen https://portal.azure.com
  • 40. Deployment mit azure-cli Azure CLI Download: https://docs.microsoft.com/de-de/cli/azure/install-azure-cli Anleitung: https://docs.microsoft.com/de-de/azure/app-service/app-service-web-get-started-nodejs az webapp deployment source config-zip --resource-group <resource_group> --name <app_name> --src appfiles.zip
  • 44. Weitere Themen • State Data Management • Advanced Message Handling • Channel-specific Functionality • Localization • Hand-off to Human • Cortana Skills
  • 45. Literatur (Leider nur für .NET/C#) Ausgaben 6/2017-8/2017
  • 46. Vielen Dank! https://dev.botframework.com https://docs.microsoft.com/bot-framework Slides: https://www.slideshare.net/JensSiebert1 Code: https://bitbucket.org/jenssiebert/dnugpbchatbot Demo-Bot (WebChat): http://dnugpbbot.azurewebsites.net Twitter: @jens_siebert