SlideShare a Scribd company logo
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
 
Microsoft bot framework
Microsoft bot frameworkMicrosoft bot framework
Microsoft bot framework
Software Infrastructure
 
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
Olli 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 Productivity
Marvin Heng
 
Azure Bot Services - Malaysia
Azure Bot Services - MalaysiaAzure Bot Services - Malaysia
Azure Bot Services - Malaysia
Cheah Eng Soon
 
Conversational AI: What's New?
Conversational AI: What's New?Conversational AI: What's New?
Conversational AI: What's New?
Microsoft Tech Community
 
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
IRJET 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 Perspective
Thomas 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 2017
Eran Stiller
 
Building a bot with an intent
Building a bot with an intentBuilding a bot with an intent
Building a bot with an intent
Abhishek 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 Team
Thomas Gölles
 
Whats a Chat bot
Whats a Chat botWhats a Chat bot
Whats a Chat bot
Alexandre Marreiros
 
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
Marco 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 TD
Bruno 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 2018
Radoslav Gatev
 
An introduction to Microsoft Bot Framework
An introduction to Microsoft Bot FrameworkAn introduction to Microsoft Bot Framework
An introduction to Microsoft Bot Framework
Taswar 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 perspective
Thomas 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 chatbots
Joris Poelmans
 
Introduction to Microsoft Bot Framework
Introduction to Microsoft Bot FrameworkIntroduction to Microsoft Bot Framework
Introduction to Microsoft Bot Framework
Sam 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

WebAssembly
WebAssemblyWebAssembly
WebAssembly
Jens Siebert
 
Embedded Rust
Embedded RustEmbedded Rust
Embedded Rust
Jens Siebert
 
Embedded Rust
Embedded RustEmbedded Rust
Embedded Rust
Jens Siebert
 
Microservices mit Rust
Microservices mit RustMicroservices mit Rust
Microservices mit Rust
Jens Siebert
 
Backend-Services mit Rust
Backend-Services mit RustBackend-Services mit Rust
Backend-Services mit Rust
Jens 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 Systeme
Jens Siebert
 
Deep Learning mit TensorFlow.js
Deep Learning mit TensorFlow.jsDeep Learning mit TensorFlow.js
Deep Learning mit TensorFlow.js
Jens 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 Framework
Jens 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 Services
Jens Siebert
 
GraphQL
GraphQLGraphQL
GraphQL
Jens Siebert
 
Embedded JavaScript
Embedded JavaScriptEmbedded JavaScript
Embedded JavaScript
Jens Siebert
 
Windows 10 IoT Core
Windows 10 IoT CoreWindows 10 IoT Core
Windows 10 IoT Core
Jens Siebert
 
Microsoft Bot Framework (.NET Edition)
Microsoft Bot Framework (.NET Edition)Microsoft Bot Framework (.NET Edition)
Microsoft Bot Framework (.NET Edition)
Jens Siebert
 
Electron
ElectronElectron
Electron
Jens Siebert
 
Windows 10 IoT Core
Windows 10 IoT CoreWindows 10 IoT Core
Windows 10 IoT Core
Jens Siebert
 
Physical Web
Physical WebPhysical Web
Physical Web
Jens Siebert
 
Windows 10 IoT Core
Windows 10 IoT CoreWindows 10 IoT Core
Windows 10 IoT Core
Jens Siebert
 
TypeScript
TypeScriptTypeScript
TypeScript
Jens Siebert
 
TypeScript
TypeScriptTypeScript
TypeScript
Jens 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

Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
KrzysztofKkol1
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
NaapbooksPrivateLimi
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
XfilesPro
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
Jelle | Nordend
 

Recently uploaded (20)

Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 

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