Okay.
Hello sluggers and welcome to this lecture.
Sir congratulations you're almost at the end of the course.
This is the very last lab.
Then we'll go through and review everything we've learnt in this section of the course and what we're
going to do is going to go ahead and build an Alexis skill.
Now we used to build a service web site using S3 dynamo DP API Gateway S.A. as well as the poly.
But the problem was that that just kept breaking and students were always complaining about it not working.
And the reason for that is just Amazon keep changing the UI for so many different services.
It was really hard to keep that up to date.
So what we're gonna do is we're going to still use the poly service but instead of building a service
website we're actually going to send poly the poly service.
We're going to basically encode your MP three files straight to an S3 bucket and then we're going to
use and an Alexa scale we're gonna build a lambda function using the service application repository
and we're going to point that lambda function to the S3 bucket and then you'll be able to build an Alexa
skill.
And what's cool about this is this is the very first Alexa school you can go and build but I'll show
you how to read the documentation and how to use the service application repository to go and build
more and more skills you'll learn how to build Alexis skills by the end of this lecture.
So I'm sure most of you know what Alexa is this is an Amazon Echo and a lot of people confuse Amazon
Echo with Alexa and we'll talk about the differences in a second but essentially every time you're talking
to one of these devices you're talking to lambda and lambda is responding to you.
So it's a way of talking directly to the cloud and having the cloud talk back to you.
And if you know iPhones you'll realize that the voice service on there is called Siri.
So you've got your iPhone which is the physical device.
And then when you talk to your iPhone you're talking to Siri will likewise Alexa is the voice service
for the Amazon Echo so the Echo is the hardware and then you're talking to the Amazon Alexis service.
So it's very similar in terms of how it works and it doesn't need to just be an Amazon Echo.
You can build one using a Raspberry Pi.
We do have a lab on that on the cloud guru platform.
You can use the Amazon Echo you can use of Fire TV basically you just need a hardware enabled device
that has the Alexa service enabled.
And then what it does is it uses a whole bunch of different technologies so it uses automatic speaks
recognition and natural language understanding and text to speech and that allows you to create all
these different skills and you do that through developer dot Amazon dot com and if you are going to
do this lab you will need to set up an account with developer dot Amazon.com.
You need to make sure that you use the same email address that you use for your Amazon Echo.
Now if you don't have an Amazon Echo don't stress you don't need one to do this lab you can actually
just run it in the simulator as well.
So in terms of how we build our skills we always start with a skills service.
And this is our lambda functions and then we build out our skill interface and ask who interface will
consist of the invocation name.
So that's just the name that you use to enable your skill so might be Alexa open Ryan Kronenberg.
And then we have our intense schema our slot types and our utterances and again we do have an Alexa
course on the cloud guru platform.
You may want to go check that out where we start doing deep dives into all this.
But in this one we're going to build a very simple skill.
So this is a lab and you will need to log into the AWOL console.
OK.
So here we are in the adobe asset management console.
The first thing we want to do is just go ahead and create an S3 Buckets.
So we're gonna go ahead and create a bucket.
I'm going to call it a cloud guru.
Polly 2019 something like that and I'm gonna go ahead and hit create and that already exists.
So call it a guru Polly assets 2019 and go ahead and hit create.
And that has now created my bucket in here I'm going to click in here I'm gonna go edit my public access
settings.
So we do want to make this bucket public.
So I'm gonna go ahead and just type confirm and then we're gonna go and give it a bucket policy making
everything inside it public.
So it's click in here go to our permissions and go to our bucket policy and this will be available in
the resources section of the course.
Just go ahead and copy that into your clipboard and then we're gonna paste it in here and then we're
just going to change the resource a R N and we're gonna grab our R and from here so just copy that into
a clipboard and then go over to here and paste it in and go ahead and hit save.
Straight away you'll be able to see that the UI has changed saying hey everything in this bucket is
now public.
So going to use this bucket to store our MP three files and we're going to basically take some notes
and then generate MP three files using the poly service.
So go ahead and copy that into your clipboard.
This is the end for the bucket.
Actually you just need the bucket name.
I don't think you need the IRS and so just copy the bucket name into your clipboard.
And then what we're gonna do we're gonna go over to services and we're going to go down and find the
poly service so the poly service can be found on a machine learning and you'll see Amazon poly here
and in here we can go and listen to this.
Now I don't know if you're gonna be able to hear this but I will read any texts you type here.
But in any text and play it out.
So I'm going to because I'm Australian.
I'm gonna go over to Australian and I like Russell so I'm going to put Russell in here and then what
I want you to do is just paste some notes in here.
Among the easy to landing page you can write your own notes.
I'm just gonna copy this into my clipboard and go back over here in a paste this in here.
So we've basically is just saying Amazon's elastic compute cloud easy to as a web service that provides
I'm not going to read the whole thing too and then what I'm going to do is going to go down and clicked
synthesized to S3 and in here I'm gonna type in my bucket name so as a cloud guru Polly assets 2019
and I'm just going to maximise this and I'm gonna go ahead and hit synthesize and so that has now created
a task to synthesize this text into an empty three file and if we go down to our S3 synthesis task you'll
be able to see here that one is scheduled and this is one that I did earlier and that has had has now
completed.
So it does take a little bit of time can take a couple of minutes if you just hit refresh.
They actually took only a few seconds so that has now completed the task.
If we go back over to S3 we'll be able to see that MP 3 file which is sitting in our public bucket and
there it is there.
Now what we want to do is create an Alexa skill that will start playing these MP three files so you'll
be basically be able to say hey Alexa open study buddy or something like that and then it will read
you out a random AWP as fact.
So help you be able to study.
So let's go over to services and what we're gonna do is we're gonna go over to lambda and we're gonna
go and create a lambda function.
Now I would do this in Northern Virginia if I was you.
You need to do this in a region where the Alexa's triggers are enabled and they're only in certain regions
or around the world.
I think it's definitely Northern Virginia and Ireland.
I think there's one in Sydney but basically you need to do it in a region where the Alexa trigger is
enabled.
So I'm going to do this in Northern Virginia.
I'm gonna go ahead and create my function.
Now you could go over to blueprints and type in Alexa but if you do that you'll see that they all say
please use the Alexa skills no J.S. fax skill from the service application repository and just says
that for most of these skills.
So let's use the service application repository and these are basically service applications published
by H.W. as well as Adobe as partners and other developers and you can just use them for free.
You don't need to know how to go ahead and program.
You can see that today.
Right now there's 434.
And what we're gonna do is we're gonna use the Alexa skills kit.
No J.S. fax skills.
We're gonna select this one.
And then what we're going to do is we're going to just leave everything as default and here we've got
our permissions we don't need to really do anything here.
So we're just gonna go ahead and hit deploy and this will deploy our Alexis skill to lambda and then
that's it really what we need is the ARVN and then we can go ahead and connect this up to the developer
dot Amazon.com.
So in here you can see your applications being deployed you go ahead and click on lambda.
Right now I've got zero lambda functions I would if I go back and just go back into lambda or you could
just refresh a page eventually you'll see that the service has been deployed and then we go that has
now been deployed and this is basically I think it's probably using cloud formation to deploy this out.
So let's go ahead and click in here and we'll be able to see our functions and you can see that we've
got the Alexis skills kit as a trigger so that's because this region supports the Alexis skills kit
as a trigger we scroll down to our IDC we'll be able to see our code.
Now you can go in and customize this.
Essentially this is the message that's going to read out.
So it's here's your fact and then it will this is your help message.
So if you get stuck it will say hey you can tell me a space fact et cetera et cetera.
This is a reprint.
So basically if you invoke the skill and then you just stay silent or say hey what can I help you with.
And then when you say stop it or say goodbye and easy or facts here.
So it's randomly going to choose one of these lines and it is completely random and you can add more.
Just make sure that you use these.
You basically use this exact format.
You could go in here and go copy and then you just add it to the very bottom.
You go paste and then let's just add my name as a random fact and we actually use this for all kinds
of purposes like if we have a raffle we just put people's names in.
So in fact in AWP as this week we have competitions at the end of every week.
And basically if you answer a really hard question on our Facebook page you could win guru of the week
guru of the week is where you get a free sticker hand side card and T-shirt.
Out to you in the post and then you're in the draw to win a free ticket to reinvent and at the when
we do the draw for reinvent.
We use this exact skill and we just put every single person's name in here as different line.
And then we ask Alexa to pick one.
And that's how we draw the winner to reinvent.
So it is complete random.
So we use this skill personally as well.
So that is it.
I'm just gonna go ahead and hit save.
And so that has now saved our skill.
And the only thing you really need to take note of is our HRN.
We're going to need that.
So just hit that icon and you're gonna need that to be able to create your skill so need you to go over
to developer dot Amazon dot com ninjas sign up for a developer account.
If you do have an Alexa device make sure you use the same email that is registered to your Alexa device
because then you'll be able to literally use this skill straight away to go over to develop it at Amazon.com.
OK so I've signed into developer dot Amazon.com.
I'm going to go ahead and hit on Amazon Alexa and click up here and go over to my skills.
I'm going to go into my Alexa console and I'm gonna go go ahead and create a skill.
And what's really cool is we can get this skill a name so call it my study buddy something like that.
My study buddy the default language if you are in the UK or Australia or wherever.
Make sure you change this to match the default language on your Lexa device.
So if you are using the Australian one or the UK one change it if you want to keep everything simple.
Change your Alexa over to us.
English US.
I'm gonna leave this as default my Alexa is on English us and then we're just going to do custom and
self hosted so that's already selected so all you need to do is click up here and go create skill that
will then go ahead and create our skill and what's really cool is you can choose a template and we've
already used the service application repository for a fact skill and in here we just need to click on
this and that's it.
Go ahead and hit choose it is seriously that simple in here.
This is the Alexa development console.
Again if you want to learn more about this we do have an entire course on Alexa in here we've got the
invocation.
So what's the invocation name right now.
Says space facts.
I'm gonna call a cloud layer less to cloud facts something like that that might be easy.
And then we're gonna go down and we're going to go ahead and save our model before we build our model.
The only other thing we need to do is go to our end point and inhere.
This is where we give our our skill the IRS and the lambda a R N so just pasted in there.
And so this is basically pointing our skill to our lambda function.
Once you've done that hits save n points then go back over to your get new fact intent.
You don't need to add anything in here but these are your sample utterances.
So you say hey Alexa ask cloud facts a fact or a space fact we might want to change this to a cloud
factor.
In fact let's add that in a cloud fact and gonna hit plus and that adds it to our utterances.
So an utterance is just a way of saying something is gonna go ahead and save our model and we're gonna
go ahead and build our model.
Now the build will take a little bit of time.
I'm just going to pause the video because it takes a couple of minutes but as soon as it's built you'll
see a little notification down here saying that it's done.
You can see down here that the build is now successful.
I could go over to test I should be able to test this and we're just going to turn the test on to development
and that will allow us to test and then what we can do is say open cloud facts.
I think it's cloud fact.
Let's have a look.
Here's your fact Jupiter has the shortest day of all the planets so it is definitely working.
And over here you can see this is the input and then this is the output.
This is our lambda function talking back to us.
And you can see that it has speak so sort of like h t Mellon that it's actually called SSA SS M.L. which
stands for synthesis speech markup language so to speak.
Here's your fact.
Jupiter has the shortest day of all the planets and it got that from our lambda function.
If we go back over here what we can do is we can just go through and delete all these other facts.
So if I just go in and delete that.
So I've only got one fact.
Now I have a hit save and then I go back over to my developer console.
So it's over here and I say let's open cloud fact again and should just read out my now.
Right.
There we go.
Just read out my name.
So the last thing we want to do is we want to essentially point our fact to our S3 Buckets to our MP
3 file that Polly just generated.
So to do that let's go over to services and we'll go over to S3 and then all you want to do is click
on the bucket.
So a Calgary poly assets click in here and just grab this.
You are allowed to copy that into your clipboard.
Then we want to go back over to our lambda function and we're just gonna go in here and we're going
to add one little edit.
So in here if we scroll all the way down just scroll up.
So it's easy to see.
We've got we've got our data in here.
So instead of saying Ryan Kronenberg let's go ahead and paste our link in here now to make it talk.
You can see there's an example here.
So it's audio.
S R C and then the link.
This is a super useful reference guide to doing stuff with Alexis I'm gonna leave this in the resources
section of the course.
I've got our U.R.L. in here or we now need to do is go audio and then source then equals then we're
gonna do our double quotations and then a forward slash sorry backslash and then we go all the way to
the end and then another backslash and then end quotations and then forward slash and then close it
out.
And so then we're gonna go ahead and hit save and that is now save let's go ahead and test this.
So if we go over to here we can go in and just say open cloud fact and hit enter and that's there we
go.
Russell's reading it out in a Australian accent.
I'm not just going to mute it but it is now playing our facts so you can go and use police service to
output all your notes to your S3 bucket and then you can basically so long as you map back the empty
threes here as it as a individually New Line your Alexis skill then read this out to you and to open
this up in your developer account or you need to do is use the invocations you just need to say Alexa
open CloudFactory so huge congratulations you've just completed the last lab in the course and hopefully
you've learnt an awful lot.
We started out with I am.
We then started learning about S3 we then went on to learn about E.C. too then learnt about databases
we learn a whole bunch of stuff around high availability and now we've gone on to service so hopefully
it's been a lot of fun.
In the next lecture what we're gonna do is just summarize what we've learnt in the service section of
the course and then in the next section I'm gonna show you how to go on and book your exams if you've
got the time.
Please join me in the next lecture.
Thank you.