Advancing Engineering with AI through the Next Generation of Strategic Projec...
Introduction to the Microsoft Bot Framework v4
1.
2. Expression Spectrum
Machine
Language
C, C++
C#, Java,
JavaScript,
PHP, Perl
Graphical
User
Interface
Natural
Language
• Computers need to be told what to do – exactly and
unambiguously.
• Ever since Grace Hopper, computer scientists have
been working to make it easier for humans to express
their intentions to computers.
Shell scripts,
PowerShell
Power
Platform,
Excel
RAD
tools
COBOL
3. not the one with the most AI
solves the user’s needs in the
quickest/easiest way
This Photo by Unknown Author is
licensed under CC BY-SA-NC
5. BotBuilder v3 BotBuilder v4
C#, Node.js
Inconsistent naming
Monolithic and opinionated
Complex dependency trees
Opinionated
C#, JavaScript, Python, Java
Incorporates feedback from v3
Less “opinionated”, more flexible
Modular and Extensible
Not backward compatible
9. Testing your Bot
App Service with Remote
Debugger
Run directly in Azure
Attach Visual Studio debugger
Bot Framework Emulator
Separate download
Does not require registration
Can connect to bot on localhost
Supports speech recognition
Send sample Team Member
Events
ngrok Tunnel
Tunnels internet requests
to local machine
Allows inspection of
request/response
Free version changes the
URL every time you use it
(8 hr max/use)
11. Event (C#, JavaScript) Fires when Description
OnTurnAsync,
onTurn
Any activity is received Base class calls the other handlers –
if you override w/o calling
base.OnTurnAsync(), no further
processing will happen!
OnMessageActivityAsync,
onMessage
A message is received Override to handle message
activities
OnConversationUpdateActivi
tyAsync,
onConversationUpdate
A conversation update is
received
Eg/ someone enters or leaves the
conversation
OnInvokeAsync, onInvoke An Invoke activity is
received
Used heavily in Teams for message
extensions, adaptive cards
14. • are reusable
• can be hierarchical (screens within
screens, dialogs within dialogs)
Both GUI screens and Bot dialogs:
• separate concerns
• organize the user interaction
Activities are more than receiving messages, and include Typing (user is typing) and ConversationUpdate (members added and removed from the conversation).
Text messages are always possible, but beyond that message formats vary by application; Bot needs to deal with that.
Explain that setup is in the notes; show templates
Crank up the NodeJS echobot in the emulator; explain
Show Bot service registration
Show Teams manifest
Show bot in Teams