7. DotNetCode.IT
Microsoft .Net Coding Community
Dieci anni fa è cambiato tutto
Il 7 Gennaio 2007 veniva lanciato il primo
iphone. (un fallimento commerciale secondo
bloomberg)
Da allora, non rimporta se ci occupiamo di
applicazioni mobile o piattaforme enterprise ,
quel modello di user experience è diventato lo
standard per gli utenti.
8. DotNetCode.IT
Microsoft .Net Coding Community
App universali
Da quando le App per i cellulari sono diventate un fenomeno
di massa la chimera di tutti i produttori di software e dei
programmatori pigri è stato scrivere codice una volta sola che
potesse andare bene sempre
9. DotNetCode.IT
Microsoft .Net Coding Community
Un’app per ogni cosa
Migliaia di programmatori, me compreso, si sono dilettati a
fare app semplicissime, brutte a piacere, solo per il gusto di
pubblicare qualche cosa
• Un modo rapido per creare tonnellate di spazzatura sui
vari store ed app che nessuno userà mai
12. DotNetCode.IT
Cosa è luis
Luis è un servizio che prende in ingresso una query in
linguaggio naturale (utterance) e restituisce un intent
E’ Raggiungibile attraverso una chiamata REST
www.dotnetcode.it
13. DotNetCode.IT
Microsoft .Net Coding Community
Intent + utterance
Intent:
E 'una frase in linguaggio naturale che può o
meno essere tradotta in un intent
«prepara il caffè»
Utterance
È un comando elaborato sulla base di un
utterance
Make.coffee
Luis prepara il caffè
14. DotNetCode.IT
Microsoft .Net Coding Community
Phrase list
Sono delle parole intercambiabili che servono a
semplificare la vita a chi scrive il modello
Ad esempio questi sono sinonimi
«caffè» «espresso» «nero»
15. DotNetCode.IT
Microsoft .Net Coding Community
Entity
Sono dei parametri delle utterance (e degli
intent)
Ad esempio
«Prepara un caffè»
«prepara due caffè»
Sono sintetizzabili in
«prepara [coffeenumber] caffè»
19. DotNetCode.IT
Microsoft .Net Coding Community
• Tools for building REST websites
• Services to enrich
• Mechanisms for receive events
• Data to debug and tools to analyze
• Implements standard protocols
• Modeling conversations is hard; tools help!
• UI across multiple canvases is hard; cards rock!
• Language understanding is hard
• Common and well understood patterns
• Start simple; add complexity; no dead-ends
• Bot adapts to the user, based on context
• Composable and intelligent controls to manage complexity
What is the bot framework?
C#
20. DotNetCode.IT
Microsoft .Net Coding Community
Strumenti utili
Portale Developer bot framework
https://dev.botframework.com
Azure portal
https://portal.azure.com
Bot emulator
https://aka.ms/botemulator
Ngrok (non necessario ma utile)
https://ngrok.com/
Bot builder template
https://marketplace.visualstudio.com/items?itemName=BotBuilder.BotBuilderV3
21. DotNetCode.IT
Microsoft .Net Coding Community
Creare un bot
• CreazioneBot channel
registration
• Creazione app id e secret
• Connessione con i canali
Azure
• Creazione del template
del bot
• Collegare app id e secret
Your code • Test su emulatore
• Deploy su azure
Run
25. DotNetCode.IT
Microsoft .Net Coding Community
Sono l’unità più piccola di
elaborazione di azure
• Sono la soluzione più semplice per eseguire
piccoli pezzi di codice nel cloud
• Scrivi solo il pezzo di codice che ti serve per
risolvere il problema senza preoccuparti
dell’infrastruttura
www.dotnetcode.it
26. DotNetCode.IT
Microsoft .Net Coding Community
Principali vantaggi di Azure
function
• Potete usare qualsiasi linguaggio
• Non vi preoccupate dell’infrastruttura
• Pagate solo quello che usate
• Non vi dovete occupare della scalabilità
www.dotnetcode.it
27. DotNetCode.IT
Microsoft .Net Coding Community
Bot ed azure function
Il template è bello ma possiamo fare la stessa cosa in maniera
più economica con una azure function
• Aggiungere il pacchetto nuget: Microsoft.Bot.Builder.Azure
• Creare il corpo della funzione corretto
https://gist.github.com/sely2k/753e45773774db36757c448450
795be6
www.dotnetcode.it
30. DotNetCode.IT
Microsoft .Net Coding Community
Servizi cognitivi di azure
• Visione Artificiale
• Conoscenza
• Linguaggio
• Sintesi vocale
• Ricerca
31. DotNetCode.IT
Microsoft .Net Coding Community
Aggingere luis
Per aggiungere Luis ad una dialog basta decorare la propria classe in maniera opportuna
32. DotNetCode.IT
Microsoft .Net Coding Community
Card
Alcuni canali supportano l’invio di messaggi complessi che
contengono grafica ed azioni.
Questi messaggi complessi sono detti Card
www.dotnetcode.it
33. DotNetCode.IT
Microsoft .Net Coding Community
Esistono vari tipi di Card
Adaptive Card A customizable card that can contain any combination of text, speech, images, buttons, and
input fields. See per-channel support.
Animation Card A card that can play animated GIFs or short videos.
Audio Card A card that can play an audio file.
Hero Card A card that typically contains a single large image, one or more buttons, and text.
Thumbnail Card A card that typically contains a single thumbnail image, one or more buttons, and text.
Receipt Card A card that enables a bot to provide a receipt to the user. It typically contains the list of items
to include on the receipt, tax and total information, and other text.
Signin Card A card that enables a bot to request that a user sign-in. It typically contains text and one or
more buttons that the user can click to initiate the sign-in process.
Video Card A card that can play videos.