This document discusses building a chat bot named Beer Bot using the Microsoft Bot Framework. It covers the bot's architecture including integrating with the Beer API and Bot Framework services. It demonstrates the bot recommending beers, taking orders, and using forms, cards, state management, and LUIS. The document emphasizes the importance of conversation design and provides resources for building bots.
10. About Me
Eran Stiller (@eranstiller)
CTO & Founder at CodeValue
Software architect, consultant and instructor
Microsoft Azure MVP
Many years of hands-on experience
Expert in large-scale, server-side, highly-concurrent
systems
Founder of Azure Israel Meetup
10
11. Cloud Computing
Advanced Mobile
Technologies
UI/UX & Graphic
Design
Cross Platform
Development
Advanced Web
Technologies
ALM & DevOps Software Architecture
IOT & Embedded
Software
Training & Mentoring
Development
Management &
Methodology
CodeValue
12. Debug like a wizard Quit debugging, spend more time writing brilliant software
Magic Glance / Figure out complex expressionsLINQ Debugging / Know the flow of your LINQ queries
Reveal / Focus on data that actually matterSearch/ Find that needle in a haystack of data
With our Visual Studio extension for C#, follow the road to a bug-free world
oz-code.com | @oz_code
13. Introduction to Chat Bots
16
Natural Language User Interface (NLUI)
Not to be confused with NUI
Another form of UX/UI
Conversation design is key
Building a conversation tree/graph
The hardest part
14. Introducing Beer Bot
17
Your friendly bartender bot
Or Bot-Tender
Beer-Bot can:
Recommend a beer
Order you a beer with a chaser and side dish
Remember your last drink
25. Conversation Flow
The active dialog takes control of conversation flow
Using the SDK you can:
Context.Wait()
Context.Done()
Context.Fail()
Context.Foreward()
Context.Call()
28
26. Chain API
A Fluent API for building dialogs
Available using the Chain class
29
public static readonly IDialog<Beer> Dialog = Chain
.From(() => new PromptDialog.PromptChoice<RecommendationOptions>(
new[] { RecommendationOptions.Category, RecommendationOptions.Origin, RecommendationOptions.Name },
"How would you like me to recommend your beer?",
"Not sure I got it. Could you try again?",
3, descriptions: new [] { "By Beer Category" , "By Beer Origin", "By Beer Name" }))
.Switch(
Chain.Case<...>(option => option == RecommendationOptions.Category, (context, option) => CategoryRecommendation),
Chain.Case<...> (option => option == RecommendationOptions.Origin, (context, option) => CountryRecommendation),
Chain.Case<...> (option => option == RecommendationOptions.Name, (context, option) => NameRecommendation)
)
.Unwrap();
29. Form Flow
32
public class BeerOrder
{
[Prompt("What beer would you like?")]
public string BeerName { get; set; }
[Prompt("Which chaser would you like next to your beer? {||}")]
public Chaser Chaser { get; set; }
[Prompt("How about something to eat? {||}")]
public SideDish Side { get; set; }
}
public static IDialog<BeerOrder> CreateDialog(string beerName = null)
{
return new FormDialog<BeerOrder>(
new BeerOrder { BeerName = beerName }, ...);
}
38. Bot State
Use the session object
User Data
Conversation Data
Private Conversation Data
Dialog Data
Persisted and managed by the Bot Framework State Service
IBotStorage
41
49. SSML
Speech Synthesis Markup Language
52
The rental car you reserved <break strength="medium" /> a mid-size sedan
<break strength="medium" /> will be ready for you to pick up at <break
time="500ms" /> <say-as interpret-as="hms12"> 4:00pm </say-as> today.
For English, press 1.
<voice xml:lang="fr-FR" gender="female"> Pour le français, appuyez sur 2 </voice>
<prosody volume="x-loud"> This is extra loud volume. </prosody>
<audio src=“http://somewhere.com/mymusic.mp3"> Here's today's weather forecast. </audio>
https://msdn.microsoft.com/en-us/library/jj127898.aspx
51. Takeaways
54
Chat bots are another form of UI (NLUI)
Microsoft Bot Framework makes it easier to write your bot
Standard connection to various channels
Bot Builder SDK
Integration with Cognitive Services
The trickiest part is still designing the conversation
CodeValue is rooted in the Israeli High-tech ecosystem and expertise
Founded by a team of visionary technical experts and consultants in 2010
A team of 200 experts (over 30 leading architects), and growing…
Built around nurturing talents, hiring experts and developing potentials
Growing through a track record of solving complex technical challenges
Successfully implementing software development processes in companies of all scales
CodeValue is at the leading edge of advanced software development
Community of experts globally recognized by Microsoft, Google and Amazon
Early access to new technologies, hands-on practice at all levels
Decades of “real world” development experience
1 Microsoft MRD, 3 Microsoft MVP, 2 Google GDE & Mentors, AWS certified
CodeValue is rooted in the Israeli High-tech ecosystem and expertise
Founded by a team of visionary technical experts and consultants in 2010
A team of 200 experts (over 30 leading architects), and growing…
Built around nurturing talents, hiring experts and developing potentials
Growing through a track record of solving complex technical challenges
Successfully implementing software development processes in companies of all scales
CodeValue is at the leading edge of advanced software development
Community of experts globally recognized by Microsoft, Google and Amazon
Early access to new technologies, hands-on practice at all levels
Decades of “real world” development experience
1 Microsoft MRD, 3 Microsoft MVP, 2 Google GDE & Mentors, AWS certified