WEBVTT

00:00:00.001 --> 00:00:05.000
Voice assistants and voice interfaces are quickly becoming the new hot way to interact with computers.

00:00:05.000 --> 00:00:09.540
Two of the more notable ones are Amazon Echo devices and Google Home devices.

00:00:09.540 --> 00:00:12.540
Wouldn't it be great if we could program these with Python?

00:00:12.540 --> 00:00:16.300
And even better if we could use well-known APIs such as Flask?

00:00:16.300 --> 00:00:20.440
This week you'll meet Eric Cho, Dave Botella, and Cam Sweeney,

00:00:20.440 --> 00:00:24.500
who discuss their frameworks and apps they built around Amazon and Google devices.

00:00:24.500 --> 00:00:30.260
This is Talk Python To Me, episode 146, recorded December 20th, 2017.

00:00:30.260 --> 00:00:50.900
Welcome to Talk Python To Me, a weekly podcast on Python, the language, the libraries, the ecosystem, and the personalities.

00:00:50.900 --> 00:00:53.040
This is your host, Michael Kennedy.

00:00:53.300 --> 00:00:55.020
Follow me on Twitter where I'm @mkennedy.

00:00:55.020 --> 00:00:58.900
Keep up with the show and listen to past episodes at talkpython.fm.

00:00:58.900 --> 00:01:01.420
And follow the show on Twitter via at Talk Python.

00:01:01.420 --> 00:01:06.300
This episode is brought to you by Datadog and us here at Talk Python Training.

00:01:06.300 --> 00:01:08.960
Be sure to check out what we're offering during the segments.

00:01:08.960 --> 00:01:10.340
It really helps support the show.

00:01:10.340 --> 00:01:12.360
Hey, everyone.

00:01:12.360 --> 00:01:15.060
Quick bit of news before we get started on the episode.

00:01:15.060 --> 00:01:22.060
First, it's 2018, and we have announced some of our 2018 courses over at training.talkpython.fm.

00:01:22.100 --> 00:01:28.860
So there's a bunch of cool ones that are listed, and we've already shipped our first course, Mastering PyCharm.

00:01:28.860 --> 00:01:35.600
If you're trying to get better with PyCharm, if you've tried this application that can do so much for your Python code and kind of got overwhelmed,

00:01:35.600 --> 00:01:41.840
well, here's an eight-hour course with hands-on exercises that can really help you get better and more productive with PyCharm.

00:01:41.980 --> 00:01:43.240
So be sure to check that out.

00:01:43.240 --> 00:01:49.660
And if you are interested in the course or any of the other courses, we announced a new way to buy them, the Everything Bundle.

00:01:49.660 --> 00:01:55.300
So now you can pay just one price and own every course at Talk Python Training forever.

00:01:55.300 --> 00:01:58.380
It's way better than a subscription and about the same price.

00:01:58.380 --> 00:02:02.000
Be sure to check both of these out over at training.talkpython.fm.

00:02:02.100 --> 00:02:03.440
Thanks for checking out the courses.

00:02:03.440 --> 00:02:05.080
Now let's get to the interview.

00:02:05.080 --> 00:02:08.180
Eric Dave Kam, welcome to Talk Python.

00:02:08.180 --> 00:02:09.160
Hey, good to be here.

00:02:09.160 --> 00:02:09.560
Thanks.

00:02:09.560 --> 00:02:10.580
Yeah, thanks for having me.

00:02:10.580 --> 00:02:14.140
Yeah, I'm really looking forward to talking about talking to computers.

00:02:14.140 --> 00:02:14.980
It's going to be a good time.

00:02:15.800 --> 00:02:16.400
For sure.

00:02:16.400 --> 00:02:17.460
Yeah.

00:02:17.460 --> 00:02:19.100
So we're going to talk about Alexa.

00:02:19.100 --> 00:02:26.760
And just a warning to everyone out there listening, if you have some kind of Echo device, some kind of Alexa-enabled device,

00:02:26.760 --> 00:02:36.560
it's a really good time to mute it because while sometimes on podcasts we can avoid saying things like Alexa or Siri or those types of activation words,

00:02:36.560 --> 00:02:38.780
that's not going to work for this one.

00:02:38.780 --> 00:02:39.320
It's just not.

00:02:39.320 --> 00:02:40.600
So put yourself on mute.

00:02:40.600 --> 00:02:42.160
Just fair warning there.

00:02:42.160 --> 00:02:43.840
So let's start at the beginning.

00:02:43.840 --> 00:02:45.400
I guess we'll start with you, Eric.

00:02:45.400 --> 00:02:46.940
How did you get into programming in Python?

00:02:46.940 --> 00:02:48.100
Thanks for having me.

00:02:48.100 --> 00:02:50.560
And how did I get into programming?

00:02:50.560 --> 00:02:55.080
So you know how there are people who knew they wanted to be a programmer since they were age seven?

00:02:55.080 --> 00:02:56.820
I'm definitely not one of those.

00:02:56.820 --> 00:02:58.580
I'm a super late bloomer.

00:02:58.580 --> 00:03:04.520
I think I remember not long ago I was on your show talking about getting your first gig as a software developer.

00:03:04.520 --> 00:03:07.080
So that's kind of the timeline.

00:03:07.080 --> 00:03:09.180
Yeah, that was episode 39.

00:03:09.180 --> 00:03:11.160
That's like almost two years ago.

00:03:11.160 --> 00:03:12.180
But yeah, that's awesome.

00:03:12.180 --> 00:03:13.460
Yeah, almost two years ago.

00:03:13.460 --> 00:03:14.960
And so I used to use...

00:03:14.960 --> 00:03:18.220
So I've been a network engineer for most of my adult working life.

00:03:18.220 --> 00:03:22.260
And I used Python to solve network engineering problems.

00:03:22.260 --> 00:03:24.160
And I just kind of never looked back.

00:03:24.160 --> 00:03:25.000
Okay, awesome.

00:03:25.000 --> 00:03:25.280
Yeah.

00:03:25.280 --> 00:03:29.620
And networking is increasingly becoming a programming job itself, isn't it?

00:03:29.620 --> 00:03:30.000
Absolutely.

00:03:30.000 --> 00:03:38.360
So, you know, software-defined networking, although the original idea of OpenFlow never took off, but it actually puts, you know, software to front and center of network engineering.

00:03:38.360 --> 00:03:45.520
So without going too much deep into it, you know, I think it's just this fundamental shift that's going to be around for a long time.

00:03:45.640 --> 00:03:46.140
Yeah, absolutely.

00:03:46.140 --> 00:03:47.320
Dave, how about you?

00:03:47.320 --> 00:03:57.900
Oh, I've always been really a hobbyist, mostly starting with my parents' TRS-80 color computer back in the day when I was a kid, working with BASIC and fiddling around with that.

00:03:57.900 --> 00:04:01.820
Coming to Python, I honestly can't quite remember when I got started.

00:04:01.820 --> 00:04:06.080
I think it might have been towards the end of high school, maybe sometime early in college.

00:04:06.440 --> 00:04:12.620
I do vividly remember I kind of made a personal choice not to learn Perl and instead picked up Python.

00:04:12.620 --> 00:04:14.640
So sometime around then.

00:04:14.640 --> 00:04:19.780
If I look at the popularity of those two languages, I would say that was probably a good fortuitous choice there.

00:04:19.780 --> 00:04:20.860
Yeah, most likely.

00:04:20.860 --> 00:04:22.580
Yeah.

00:04:22.580 --> 00:04:24.220
And Cam, how about yourself?

00:04:24.220 --> 00:04:25.400
I'm kind of like Eric.

00:04:25.400 --> 00:04:29.040
I didn't really get into programming until later in life.

00:04:29.040 --> 00:04:45.080
I went to school to become a biologist and probably like the last few months of college, I just started picking up Python with automate the born stuff and just decided that's what I wanted to do.

00:04:45.080 --> 00:04:46.800
So yeah, it's only been a few years.

00:04:46.800 --> 00:04:52.580
I remember listening to that show with Eric on about getting your first job and that's actually really helpful.

00:04:52.580 --> 00:04:53.840
No, that's really awesome.

00:04:53.840 --> 00:04:54.080
Yeah.

00:04:54.080 --> 00:04:57.020
What a crazy way to circle back, right?

00:04:57.020 --> 00:04:57.620
Yeah, seriously.

00:04:57.620 --> 00:04:58.500
Small world.

00:04:58.500 --> 00:05:01.240
And now you're on this podcast with Eric.

00:05:01.240 --> 00:05:01.760
Yeah.

00:05:01.760 --> 00:05:02.860
Yay!

00:05:02.860 --> 00:05:03.400
It's nuts.

00:05:03.400 --> 00:05:05.100
Yeah, it totally is.

00:05:05.100 --> 00:05:09.780
And so do you still do any biology or are you just doing programming these days?

00:05:09.780 --> 00:05:13.680
Yeah, I'm just doing biology or programming.

00:05:13.680 --> 00:05:18.060
Never even stepped foot into a lab after school.

00:05:18.060 --> 00:05:19.140
You know what?

00:05:19.140 --> 00:05:22.380
There's a place better for creating stuff out of bits.

00:05:22.380 --> 00:05:23.020
Let's do that.

00:05:23.020 --> 00:05:24.080
Yeah, definitely.

00:05:24.080 --> 00:05:24.400
All right.

00:05:24.520 --> 00:05:28.600
So maybe let's go with you, Kim, since we're just talking about it.

00:05:28.600 --> 00:05:30.060
What do you do day to day these days?

00:05:30.060 --> 00:05:30.460
Yeah.

00:05:30.460 --> 00:05:35.540
So currently I'm freelancing and doing contract work for this company called Produvia.

00:05:35.540 --> 00:05:41.680
It's basically using AI and chat services for just different industries.

00:05:42.360 --> 00:05:46.820
Currently we're working on something for the hotel industry and things.

00:05:46.820 --> 00:05:47.320
That's cool.

00:05:47.320 --> 00:05:52.060
Is it voice assistant stuff or is it more like chatbots, like a Facebook messenger type thing?

00:05:52.060 --> 00:05:52.400
Yeah.

00:05:52.400 --> 00:05:57.400
So it's just been more messenger, like Slack based and like web app based.

00:05:57.400 --> 00:06:00.400
But we're planning on moving into the voice space pretty soon.

00:06:00.400 --> 00:06:01.600
So that's pretty exciting.

00:06:01.600 --> 00:06:03.440
It's definitely an exciting time for that.

00:06:03.440 --> 00:06:04.640
Dave, how about you?

00:06:04.640 --> 00:06:13.340
I'm an independent software consultant, mostly in the enterprise space and the kind of the sexy realm of knowledge management and enterprise search.

00:06:13.340 --> 00:06:16.040
So definitely not.

00:06:16.040 --> 00:06:18.000
Search all the things inside of your company.

00:06:18.000 --> 00:06:18.380
Yeah.

00:06:18.380 --> 00:06:22.380
Not as marketable as like AI and actual chat stuff.

00:06:22.460 --> 00:06:23.920
Yeah, but that's an important thing.

00:06:23.920 --> 00:06:30.720
Like these companies are huge and stuff gets crammed into SharePoints that people don't know about and Excel and access.

00:06:30.720 --> 00:06:32.040
And it's insane, right?

00:06:32.040 --> 00:06:35.680
The back end, like real world, as I kind of call it, it's predominantly Excel.

00:06:35.680 --> 00:06:37.800
I mean, that's the reality.

00:06:37.800 --> 00:06:42.040
So that's where I spend most of my time, mostly in the realm of Java.

00:06:42.040 --> 00:06:45.920
But when I get a chance to choose, I usually choose Python for some projects.

00:06:45.920 --> 00:06:50.060
So I've got most of my experience is sort of Java and Python.

00:06:50.300 --> 00:06:56.280
How do I get them to talk to each other, especially when dealing with interacting with any of these legacy enterprise systems?

00:06:56.280 --> 00:06:56.660
Okay.

00:06:56.660 --> 00:06:59.960
And you said you contribute to this thing called JPY.

00:06:59.960 --> 00:07:01.920
What's the story of that?

00:07:01.920 --> 00:07:03.260
JPY, yeah.

00:07:03.260 --> 00:07:12.960
Yeah, I had a particular request from a client to deal with an old kind of proprietary binary format from a, I'm not going to say the vendor's name, but a statistical software package.

00:07:12.960 --> 00:07:16.360
And this format had been around for a long time.

00:07:16.360 --> 00:07:19.700
Needless to say, somebody had reverse engineered it already, which was great.

00:07:19.860 --> 00:07:21.540
And published their findings.

00:07:21.540 --> 00:07:27.640
And it was really wrangling bits and bytes, dealing with pages of data inside this file format.

00:07:27.640 --> 00:07:33.940
And since this had to all be plugged into a Java program, long story short, I found it easier to solve the problem in Python.

00:07:33.940 --> 00:07:38.180
And then I just needed to find a way to stick that inside this Java app.

00:07:38.700 --> 00:07:47.680
Luckily, JPY, I came across as written by a consultancy in, I think, Germany, contracted to like the European Space Agency.

00:07:47.680 --> 00:07:57.720
And they wrote it originally to deal with this kind of data interchange between some other application that the ESA uses for the scientists and everything to get data in and out.

00:07:57.920 --> 00:08:01.920
And they wanted to use Python, like a lot of folks in the scientific community.

00:08:01.920 --> 00:08:02.480
Right.

00:08:02.480 --> 00:08:07.400
So I was able to take that and figure out a way to plug it in and solve some problems along the way.

00:08:07.400 --> 00:08:07.960
That's pretty cool.

00:08:07.960 --> 00:08:12.240
The only way that I knew about, I was aware of to do that before was with Jython.

00:08:12.600 --> 00:08:13.960
And so is it kind of like Jython?

00:08:13.960 --> 00:08:16.260
So it doesn't run on the JVM.

00:08:16.260 --> 00:08:23.100
It's nice and simple in that it's basically automation and kind of data passing between the JVM and a Python interpreter.

00:08:23.100 --> 00:08:24.700
And you can do it bidirectionally.

00:08:24.700 --> 00:08:35.520
So from Java, you can spin up a Python interpreter and run Python code, get data back in Java using the Java native interface.

00:08:36.340 --> 00:08:45.700
And the really cool thing is since I can't remember the person's name, but somebody did a fantastic job in the last year or so with the Windows distribution of Python.

00:08:45.700 --> 00:08:46.060
Right.

00:08:46.060 --> 00:08:47.200
That would be Steve Dower.

00:08:47.200 --> 00:08:48.040
Thank you, Steve.

00:08:48.040 --> 00:08:48.460
Yes.

00:08:48.460 --> 00:08:48.780
Yeah.

00:08:48.780 --> 00:08:57.280
And it's great because you can easily bundle it with something like this and pretty much ship it with your product and have an embedded Python instance.

00:08:57.280 --> 00:09:01.880
And it's funny that it works great on Windows, yet most of the time it's a headache on Linux.

00:09:01.880 --> 00:09:02.960
I just don't get it.

00:09:02.960 --> 00:09:03.720
Yeah.

00:09:03.720 --> 00:09:04.160
How funny.

00:09:04.160 --> 00:09:05.040
That's kind of the opposite.

00:09:05.040 --> 00:09:06.180
All right, Eric.

00:09:06.520 --> 00:09:08.400
You're doing network stuff, right?

00:09:08.400 --> 00:09:09.460
Like you said, just a little bit ago.

00:09:09.460 --> 00:09:09.760
Yeah.

00:09:09.760 --> 00:09:11.520
So mostly networking stuff.

00:09:11.520 --> 00:09:18.240
But lately, I think for the past two years ago, it's been very focused on network security kind of accidentally.

00:09:18.240 --> 00:09:30.120
And so within network security, very focused on distributed denial of service and use quite a bit of Python, but also other tools, whatever works for us to glean a little bit for that threat intel piece for DDoS.

00:09:30.120 --> 00:09:31.040
Oh, that's really cool.

00:09:31.040 --> 00:09:31.340
Yeah.

00:09:31.340 --> 00:09:31.340
Yeah.

00:09:31.340 --> 00:09:31.340
Yeah.

00:09:31.340 --> 00:09:31.400
Yeah.

00:09:31.400 --> 00:09:35.680
The whole computer security stuff around just both sides.

00:09:35.680 --> 00:09:39.340
The white hat, black hat, whole thing is really Python heavy.

00:09:39.340 --> 00:09:40.440
So that's pretty cool.

00:09:40.440 --> 00:09:41.080
Yeah, absolutely.

00:09:41.080 --> 00:09:47.540
And I think for us, since we're sort of a startup-ish company and certainly a small operation.

00:09:47.540 --> 00:09:52.440
So we choose to be very focused on solving this DDoS space well.

00:09:52.440 --> 00:09:56.540
And, you know, people talk about 10x better, and that's why we shoot for it, right?

00:09:56.540 --> 00:10:06.660
Like if we could do 10x better than our competitor, then we're able to, people, our customers, potential customers will be able to grasp the benefits of our stuff rather than our competitors.

00:10:06.880 --> 00:10:08.060
So that's why we shoot for it.

00:10:08.060 --> 00:10:08.260
Yeah.

00:10:08.260 --> 00:10:09.800
Sounds like a fun project.

00:10:09.800 --> 00:10:10.620
All right.

00:10:10.620 --> 00:10:13.880
So let's start out by talking about these voice assistants in general.

00:10:13.880 --> 00:10:14.920
We're going to focus on Alexa.

00:10:14.920 --> 00:10:16.460
They've got a really good developer story.

00:10:16.460 --> 00:10:18.860
They've got a really good Python developer story.

00:10:18.860 --> 00:10:25.940
And you guys have all either created some skills or worked on frameworks for creating skills.

00:10:25.940 --> 00:10:32.080
But let's say maybe, Dave, can you give us kind of a survey of the various options we have?

00:10:32.140 --> 00:10:33.060
We've got Alexa.

00:10:33.060 --> 00:10:35.520
We've got Google Voice and so on.

00:10:35.520 --> 00:10:37.300
There's Alexa Google Assistant.

00:10:37.300 --> 00:10:39.100
Can't remember exactly what they're calling it.

00:10:39.100 --> 00:10:40.640
Anyone can jog my memory here.

00:10:40.640 --> 00:10:46.680
I'm more well-versed in the Amazon ecosystem or ecosystem, if you will.

00:10:46.680 --> 00:10:51.040
Would you guys count Apple's Siri or Microsoft's Cortana in this space?

00:10:51.040 --> 00:10:54.680
Have they opened those up with APIs and SDKs?

00:10:54.680 --> 00:10:56.500
I actually don't know.

00:10:56.500 --> 00:10:57.420
You know, they have so many.

00:10:57.420 --> 00:10:58.300
Apple's so weird.

00:10:58.300 --> 00:11:01.720
They have like NDAs for developers and stuff, right?

00:11:01.780 --> 00:11:03.520
I haven't been paying attention for Apple.

00:11:03.520 --> 00:11:07.220
And I also haven't been paying attention to Cortana.

00:11:07.220 --> 00:11:07.720
Yeah.

00:11:07.720 --> 00:11:08.560
So I don't know.

00:11:08.560 --> 00:11:08.800
Yeah.

00:11:08.800 --> 00:11:13.900
I would say that's probably a no last time I checked, but it was a few months ago.

00:11:13.900 --> 00:11:16.000
For Siri and Cortana, definitely not.

00:11:16.000 --> 00:11:18.120
But for Google, yes.

00:11:18.120 --> 00:11:19.700
But they don't really promote it.

00:11:19.700 --> 00:11:26.480
So it wasn't until I actually got a physical Google, I guess, mini, then I started looking at it.

00:11:26.540 --> 00:11:32.480
And they do have a developer platform that opened up with third parties, whatever they call it, skills equivalent of Google.

00:11:32.480 --> 00:11:39.760
So, but that's, you know, Amazon's been really at the front and center for catering to our third-party developers, I would say.

00:11:39.760 --> 00:11:40.800
Yeah, that's interesting.

00:11:41.020 --> 00:11:46.880
I mean, on one level or another, all of those companies have been pretty good towards developers.

00:11:46.880 --> 00:11:53.720
But yeah, Amazon with AWS and all the stuff going on there, they're really kind of built for that, right?

00:11:53.720 --> 00:12:00.280
You can, you know, leverage their Lambda computing to implement your Alexa skill, for example, and things like that.

00:12:01.080 --> 00:12:02.820
Yeah, so pretty interesting.

00:12:02.820 --> 00:12:03.540
Yeah, totally.

00:12:03.540 --> 00:12:05.860
And also, I think they're actively going out.

00:12:05.860 --> 00:12:10.560
So you don't see as much, say, meetup groups or trainings.

00:12:10.560 --> 00:12:16.080
And I know they actually contracted Bignor Ranch to do Alexa trainings to bring people up to speed.

00:12:16.080 --> 00:12:19.660
And you see, you know, a lot of Twitter feeds from their evangelists.

00:12:19.660 --> 00:12:28.420
So I think all those feeds into the funnel of people, you know, maybe you could reach a thousand developers and, you know, maybe 10% to 1% of them actually take up.

00:12:28.420 --> 00:12:32.040
And then you funnel it down to the people who actually were public skills.

00:12:32.040 --> 00:12:40.960
So I think Amazon is the biggest, I guess, spread out the biggest net for these developers and then trying to catch those who are interested in the space.

00:12:40.960 --> 00:12:41.220
Yeah.

00:12:41.220 --> 00:12:42.680
Kim, what do you think?

00:12:42.680 --> 00:12:43.360
Yeah, definitely.

00:12:43.360 --> 00:12:45.360
Google, they have it open.

00:12:45.360 --> 00:12:49.820
And it's actually, it's gotten a lot easier to develop for the Google Assistant.

00:12:49.820 --> 00:12:53.780
But like Eric was saying, they don't really advertise out anything.

00:12:53.780 --> 00:12:59.860
Whereas, you know, Alexa is like, they're just like reaching out for like anyone to develop.

00:12:59.860 --> 00:13:04.780
Like they're really pushing it as something anyone can get into, which is really cool.

00:13:04.780 --> 00:13:10.020
And then, yeah, Siri, I don't, I'm pretty sure they don't really even have that open or anything.

00:13:10.020 --> 00:13:17.780
I've never heard of any third party Siri skills or whatever, which is pretty surprising just because they're, you know, they were the first to the space.

00:13:17.780 --> 00:13:20.340
And I feel like they kind of maybe dropped the ball with that.

00:13:20.340 --> 00:13:21.160
I totally agree.

00:13:21.160 --> 00:13:25.900
There's no way they can't have some sort of programming API though, right?

00:13:25.900 --> 00:13:27.840
Since they're going to have their HomePod thing.

00:13:27.840 --> 00:13:34.660
And I just looked, Microsoft has the Cortana Skills Kit, which came out in September, but it's in public preview.

00:13:34.660 --> 00:13:37.760
So, you know, that's also, I guess, a thing.

00:13:37.760 --> 00:13:40.500
But they don't, their devices aren't really out yet.

00:13:40.500 --> 00:13:42.440
Although there's some interesting places, I guess it shows up.

00:13:42.440 --> 00:13:55.120
Yeah, I think Cortana, even though like the development kit's not really out there, I'm pretty sure they do have a good amount of like integrations with different services aren't strictly aimed at Cortana.

00:13:55.120 --> 00:13:55.740
Right.

00:13:55.740 --> 00:13:56.660
So that's kind of cool.

00:13:56.660 --> 00:13:59.940
Yeah, they definitely are trying to integrate that into Azure and all their cloud stuff.

00:13:59.940 --> 00:14:04.640
So let's maybe just go down the list of the hardware that's available.

00:14:05.160 --> 00:14:10.880
So, you know, by way of contrast, like for Apple, I guess you have your phone.

00:14:10.880 --> 00:14:14.680
You guess you have your Mac if you turn that on and you have this HomePod thing.

00:14:14.680 --> 00:14:19.820
If you look at Alexa, I'll just go through the list kind of quick because there's tons of it.

00:14:19.820 --> 00:14:23.960
There's the Echo, which is like this tall speaker thing.

00:14:23.960 --> 00:14:28.780
There's Echo Plus, which is the same speaker, but is also a smart home hub.

00:14:28.780 --> 00:14:33.300
There's Echo Show, which is like a touchscreen video type of version.

00:14:33.620 --> 00:14:37.460
There's the Kinect, which will turn it into a landline.

00:14:37.460 --> 00:14:42.060
There's the Echo Spot, which will let you make video calls and stuff.

00:14:42.060 --> 00:14:43.200
That one's kind of cool.

00:14:43.200 --> 00:14:45.300
It's got a little screen on it.

00:14:45.300 --> 00:14:46.360
There's the Dot.

00:14:46.360 --> 00:14:47.900
That's like the little mini one.

00:14:47.900 --> 00:14:51.260
There's the Tap, the Look, the Fire TV.

00:14:51.260 --> 00:14:54.980
And they actually are integrating them into cars as well, which is pretty cool.

00:14:54.980 --> 00:14:58.940
So Ford Sync is coming out with Alexa integration.

00:14:59.220 --> 00:15:05.080
So you can say, ask it for driving directions and playing music and stuff like that, which is cool.

00:15:05.080 --> 00:15:10.480
And BMW and Mini are also integrating it as well for the 2018 models.

00:15:10.480 --> 00:15:15.600
So that's just some of the devices that these skills run on, right?

00:15:15.600 --> 00:15:17.360
I would also add to that.

00:15:17.360 --> 00:15:24.000
So the Spot, so we're recording this on the 19th of December, and that's when the Spot will actually come out.

00:15:24.000 --> 00:15:31.980
So I think outside of a few tech reviewers and on-site reviews, website reviewers, nobody has seen the Spot yet.

00:15:31.980 --> 00:15:32.640
Yeah.

00:15:32.640 --> 00:15:34.140
And then Show is kind of expensive.

00:15:34.340 --> 00:15:40.540
So I would say mostly in the wild, you would see the Echo and the Echo Dot, especially if you're talking about cars.

00:15:40.540 --> 00:15:46.080
There's a bunch of YouTube videos showing people how they fit like the Dot directly into the cup holder.

00:15:46.080 --> 00:15:47.880
And that's kind of cute and neat.

00:15:47.880 --> 00:15:49.860
And I know a bunch of my friends have done that.

00:15:49.860 --> 00:15:50.880
That is really cool.

00:15:50.880 --> 00:15:52.000
I've actually done that too.

00:15:53.080 --> 00:15:55.240
I would do that if it wouldn't freak out my wife.

00:15:55.240 --> 00:15:57.320
She doesn't like it around so much.

00:15:57.320 --> 00:15:57.820
She's not...

00:15:57.820 --> 00:16:00.520
We'll talk about the thing, constant listening, right?

00:16:00.520 --> 00:16:04.420
But my car has four USB plugs, and it runs off USB.

00:16:04.420 --> 00:16:06.380
It could just put it in one of those little cup holders.

00:16:06.380 --> 00:16:06.960
It'd be awesome.

00:16:06.960 --> 00:16:10.380
But no, it doesn't go in the car in my house, I'm afraid.

00:16:10.380 --> 00:16:17.080
I guess we should make the distinction between Alexa and all those pieces of hardware I talked about.

00:16:17.080 --> 00:16:19.500
So there's all this hardware, and then there's Alexa.

00:16:19.500 --> 00:16:22.140
Dave, do you want to maybe talk about the two?

00:16:22.140 --> 00:16:26.220
I mean, the hardware is really just the gateway to interact with the Alexa service.

00:16:26.220 --> 00:16:35.280
And the primary kind of concept is this idea of an utterance or a user's intent.

00:16:35.280 --> 00:16:39.820
So what is the user intending to try to do when they talk to the device?

00:16:39.820 --> 00:16:45.920
I believe Amazon splits the technology up into at least two or three different services now in the back end.

00:16:46.340 --> 00:16:53.660
That as a developer at scale, you could use individually for different things like voice recognition or text to speech.

00:16:53.980 --> 00:16:57.020
So it's kind of like the front end and back end of the Alexa service.

00:16:57.020 --> 00:17:02.820
But to the consumers, they really interact with just sort of the combination of all of that.

00:17:02.820 --> 00:17:03.120
Right.

00:17:03.120 --> 00:17:09.380
And can you take the Alexa AI piece, the software piece, and put it on your device?

00:17:09.380 --> 00:17:15.780
It's like if I was on Kickstarter and making some smart bike that would, I don't know, turn on the blinkers when I would tell it to turn.

00:17:15.780 --> 00:17:16.400
It's like, you know, whatever.

00:17:16.400 --> 00:17:17.000
Something stupid.

00:17:17.000 --> 00:17:18.660
Could I get that and plug it in?

00:17:18.660 --> 00:17:18.900
Yeah.

00:17:19.100 --> 00:17:21.900
A couple of folks have done some interesting projects like that.

00:17:21.900 --> 00:17:34.240
A while back, I know one of the initial kind of popular hacks that appeared online was somebody taking a Teddy Ruxpin and making it speak and basically becoming kind of a conduit for Alexa.

00:17:34.240 --> 00:17:37.580
And it was both exciting and creepy at the same time.

00:17:37.580 --> 00:17:39.740
That's exactly how I imagined it would be.

00:17:39.740 --> 00:17:41.980
There's still some videos on YouTube.

00:17:41.980 --> 00:17:43.780
You can even use it piecemeal.

00:17:43.780 --> 00:17:48.640
So if there are things where you wanted to build a service that did text-to-speech, you could use that portion.

00:17:48.640 --> 00:17:57.320
If you just needed to deal with sort of understanding and matching with some confidence what the user's utterance was, they have that as a service as well.

00:17:57.320 --> 00:17:58.320
That sounds pretty cool.

00:17:58.320 --> 00:18:00.980
It's definitely some really neat services that they have.

00:18:00.980 --> 00:18:06.640
And it seems like it makes it really easy to plug in your logic into their kind of text and sentiment understanding.

00:18:06.640 --> 00:18:14.920
Yeah, and like most Amazon services, you can either use them as individual piecemeal kind of components or pull them together into a solution.

00:18:14.920 --> 00:18:26.560
I guess one of the things I want to do is give people a sense of some of the skills that you can have on an Alexa device and then talk about ones that you have all either contributed to or worked on or something like that.

00:18:27.240 --> 00:18:28.700
So let me just run down the list.

00:18:28.700 --> 00:18:33.060
So there's over 20,000 Alexa skills now, which is pretty awesome.

00:18:33.060 --> 00:18:39.780
It definitely seems like the place where developers are building new things compared to all these other places we talked about.

00:18:39.780 --> 00:18:41.600
So you can have them for finance.

00:18:41.600 --> 00:18:44.100
You can ask what your credit card balance is.

00:18:44.100 --> 00:18:45.720
You can ask what the stock price is.

00:18:45.720 --> 00:18:47.620
You've got if this, then that integration.

00:18:47.620 --> 00:18:52.880
So if I get an email from this person that says this, put it on, edit them.

00:18:52.880 --> 00:18:55.380
You can speak to it about all the if this, then that.

00:18:55.380 --> 00:18:56.580
You basically integrate with that.

00:18:57.220 --> 00:18:59.100
It integrates with like electric cars.

00:18:59.100 --> 00:19:03.020
So I have a charge point charger from my car and I can ask it.

00:19:03.020 --> 00:19:05.520
You've got to direct it towards the skill.

00:19:05.520 --> 00:19:05.680
Right.

00:19:05.680 --> 00:19:10.700
So you say like ask charge point how many miles were added last time when I charged or something like that.

00:19:10.700 --> 00:19:11.460
So that's really cool.

00:19:11.460 --> 00:19:13.320
Got smart home drinks.

00:19:13.320 --> 00:19:16.320
You could ask it for like what cocktail you should have and how to make it.

00:19:16.320 --> 00:19:18.580
Flash briefing, travel.

00:19:18.580 --> 00:19:22.500
Like you could ask it where you could go for $400 or Lyft, all sorts of stuff.

00:19:22.500 --> 00:19:22.720
Right.

00:19:22.720 --> 00:19:25.040
Maybe go around each one of you.

00:19:25.040 --> 00:19:26.540
Like what's your favorite skill?

00:19:27.200 --> 00:19:35.800
Not sure what my favorite skill would be, but I've never published a skill to like the Alexa marketplace or whatever it's called.

00:19:35.800 --> 00:19:40.140
But I've mainly just created like little personal ones for my own use.

00:19:40.140 --> 00:19:48.180
Back before I found out about this project called Home Assistant, which basically connects different smart appliances.

00:19:48.180 --> 00:19:51.100
I use Alexa to like control some lights and stuff.

00:19:51.100 --> 00:19:58.640
And then for my old job, I would just ask Alexa to trigger like some scripts to run my computer like nightly.

00:19:58.640 --> 00:20:00.160
Alexa, is my server up?

00:20:00.320 --> 00:20:05.660
Alexa, am I still employed?

00:20:05.660 --> 00:20:06.940
Exactly.

00:20:06.940 --> 00:20:07.240
Yeah.

00:20:07.240 --> 00:20:13.960
And then I also created the audio sample skills for the Flaskask repo, which we'll be talking about in a little bit.

00:20:13.960 --> 00:20:15.420
And that was pretty fun.

00:20:15.420 --> 00:20:16.000
Yeah.

00:20:16.000 --> 00:20:21.380
I really like how Alexa allows you to stream audio, like good sized audio streams.

00:20:21.380 --> 00:20:22.500
That makes it really cool.

00:20:22.620 --> 00:20:22.780
Yeah.

00:20:22.780 --> 00:20:24.660
I do a lot of listening to music on my Alexa.

00:20:24.660 --> 00:20:25.060
It's cool.

00:20:25.060 --> 00:20:25.420
Yeah.

00:20:25.420 --> 00:20:26.220
Yeah, definitely.

00:20:26.220 --> 00:20:26.960
How about your...

00:20:26.960 --> 00:20:27.100
Yeah.

00:20:27.100 --> 00:20:29.320
My favorite skill is my skill.

00:20:29.940 --> 00:20:39.280
So I published several skills and the ones that are my favorite and certainly attract the most unique users per month is Seattle English Tutor.

00:20:39.280 --> 00:20:50.760
So if you imagine, you know, just having this person or this assistant who would help you train your English skill, if English was your second language, which was my case, then that's what it is.

00:20:50.760 --> 00:20:58.340
So actually, the first time I heard how Alexa operates and how, you know, see a few examples, this just springs to mind.

00:20:58.340 --> 00:21:02.040
And of course, you know, this was also inspired by Mandy Chen.

00:21:02.040 --> 00:21:05.780
So she was one of the earlier developers slash evangelist.

00:21:05.780 --> 00:21:11.960
And she put out this beta and just kind of took it from there and published this skill and working on version two of that.

00:21:11.960 --> 00:21:12.640
That's pretty exciting.

00:21:12.640 --> 00:21:13.220
Very cool.

00:21:13.220 --> 00:21:13.840
Dave?

00:21:13.840 --> 00:21:14.660
It's a toss up.

00:21:14.660 --> 00:21:18.620
So, you know, there's your favorite is usually the one you have published if you've got one published.

00:21:18.760 --> 00:21:31.400
So I worked with Vermont Public Radio to help them basically create an Alexa skill that would allow users to stream their live streams as well as the episodic podcast content that they release.

00:21:31.400 --> 00:21:32.020
Yeah, that's cool.

00:21:32.020 --> 00:21:37.380
I'm thinking about doing that for the various podcasts, like especially around Python Bytes, because it's got all these little pieces.

00:21:37.380 --> 00:21:42.620
And there's a lot of cool things you can do with audio because that's the native format of this thing, right?

00:21:42.620 --> 00:21:43.320
It's quite awesome.

00:21:43.320 --> 00:21:51.820
You can just kind of point the Alexa service at a stream and it can handle kind of starting and stopping and just kind of knowing a little bit where it left off.

00:21:51.820 --> 00:21:53.760
Then you also had another one that got banned, right?

00:21:53.760 --> 00:21:54.060
Yeah.

00:21:54.060 --> 00:21:54.940
Like you were a rebel.

00:21:56.420 --> 00:21:59.660
So this was when I first got my dot, it was almost a year ago.

00:21:59.660 --> 00:22:01.380
It was about, I think it was Christmas last year.

00:22:01.380 --> 00:22:16.760
The very first thing I did was make a skill that would interact with Twitter, go to Donald Trump's Twitter feed, grab a random tweet of his last, you know, 100 or 200, whatever is accessible via the API, and read it out loud.

00:22:16.760 --> 00:22:23.480
So you could ask Alexa, you know, what's, you know, either his latest tweet or to ask Alexa to read a random one.

00:22:23.480 --> 00:22:24.920
And it was almost always comical.

00:22:24.920 --> 00:22:27.720
But after submitting it...

00:22:27.720 --> 00:22:28.540
They wouldn't put it up there, huh?

00:22:28.540 --> 00:22:28.940
No.

00:22:28.940 --> 00:22:34.540
So they were running, this kind of goes back to the idea of Amazon having done a pretty good job in developer outreach.

00:22:34.540 --> 00:22:38.680
They were offering a free Amazon hoodie or something like that.

00:22:38.880 --> 00:22:44.120
If you got a skill published in the store before maybe January 10th or something like that.

00:22:44.120 --> 00:22:49.660
And I submitted it and they rejected it because of copyright infringement, allegedly.

00:22:49.660 --> 00:22:56.340
So I didn't know you could own your tweets, but that's sort of news to me.

00:22:56.340 --> 00:23:01.220
My guess is they were just sort of afraid of the litigious Donald Trump at the time.

00:23:01.220 --> 00:23:04.320
Yeah, it must be because that is the public thing.

00:23:04.440 --> 00:23:09.480
And especially now, it's, you know, communication of the United States government in a sense.

00:23:09.480 --> 00:23:14.220
So that, right, that's kind of in one sense, all ours, I guess.

00:23:14.220 --> 00:23:14.720
I don't know.

00:23:14.720 --> 00:23:15.880
It turned out I did some digging.

00:23:15.880 --> 00:23:18.040
There were some already in the skill store.

00:23:18.040 --> 00:23:20.440
They avoided using Trump's name.

00:23:20.440 --> 00:23:23.260
So they said things like presidential tweets or something like that.

00:23:23.260 --> 00:23:27.580
This portion of Talk Python To Me was brought to you by Datadog.

00:23:27.580 --> 00:23:31.980
Datadog is a monitoring solution that provides deep visibility into your Python apps.

00:23:32.160 --> 00:23:36.340
So you can understand why certain requests are slow or what caused a specific error.

00:23:36.340 --> 00:23:41.700
Datadog's open source tracing client auto instruments popular libraries like Flask and Redis,

00:23:41.700 --> 00:23:44.300
as well as async libraries like async.io.

00:23:44.300 --> 00:23:46.980
So you can get started without making any code changes.

00:23:46.980 --> 00:23:53.280
Within minutes, you'll be able to investigate bottlenecks in your code by exploring interactive flame graphs and rich dashboards.

00:23:53.280 --> 00:23:55.840
Start a free trial to see for yourself.

00:23:55.840 --> 00:23:58.760
As a bonus, Datadog will send you a free t-shirt.

00:23:58.760 --> 00:24:03.080
Just visit talkpython.fm/Datadog for more details.

00:24:03.080 --> 00:24:09.660
The certification process and all that is kind of evolving, just like everybody.

00:24:09.660 --> 00:24:12.360
You know, they're kind of evolving as we go.

00:24:12.360 --> 00:24:21.340
So if you put the name unofficial or like fan or fans of or whatever, then you get, not to guarantee it,

00:24:21.420 --> 00:24:26.340
but you know, you get, you have an easier time getting it approved if it was, you know, something of that nature.

00:24:26.340 --> 00:24:26.680
Okay.

00:24:26.680 --> 00:24:26.940
Yeah.

00:24:26.940 --> 00:24:27.620
That's good advice.

00:24:27.620 --> 00:24:30.620
The president of the United States is not a matter, but yeah.

00:24:30.680 --> 00:24:35.260
But just like normal companies, like fan of Disney of, you know, whatever it is.

00:24:35.260 --> 00:24:36.460
So something like that.

00:24:36.460 --> 00:24:36.700
Cool.

00:24:36.700 --> 00:24:37.360
All right.

00:24:37.360 --> 00:24:38.820
Well, let's talk about how you build these things.

00:24:38.820 --> 00:24:43.540
So obviously Python is a good way to do it, which is pretty awesome.

00:24:43.540 --> 00:24:52.880
And I guess the first thing people might wonder is, do they have to commit to going and buying an Echo device, piece of hardware, so that they can do this?

00:24:52.960 --> 00:24:53.640
The answer is no.

00:24:53.640 --> 00:24:55.760
It's like developing for Android apps.

00:24:55.760 --> 00:24:56.860
You could use the simulator.

00:24:56.860 --> 00:25:04.800
It's not as good as a real thing, but it's, it'll get you closer until you feel like you were committing, you feel like committing to a hardware purchase.

00:25:04.800 --> 00:25:07.520
And of course the hardware is getting cheaper and cheaper and so on.

00:25:07.520 --> 00:25:18.480
But, so the software that you could use is echo sim.io for the website to, you know, kind of click on it and then speak and just behave just like Alexa, except you can't do video stream, voice streaming.

00:25:18.480 --> 00:25:20.760
So I don't know if you do podcasts and so on.

00:25:21.180 --> 00:25:26.260
And another tool is your Revert mobile app that you could download and then behave just like Alexa.

00:25:26.260 --> 00:25:34.280
That's like an iOS app, but then you can talk to it and it basically, it is an Alexa, but it's just a software one, huh?

00:25:34.280 --> 00:25:34.840
Yeah, absolutely.

00:25:34.840 --> 00:25:38.380
So it's like, you know, it's both Android and iOS as far as I know.

00:25:38.380 --> 00:25:41.240
And so when you launch it, it just has this big dot, right?

00:25:41.240 --> 00:25:49.760
Like the whole screen just filled with the dots and you click on it and then, you know, it listens for whatever input using your microphone and then, you know, dishes out the response that way.

00:25:49.760 --> 00:25:51.800
And you link it to your Amazon account, of course.

00:25:51.800 --> 00:25:52.080
Cool.

00:25:52.080 --> 00:26:00.920
So one thing that I ran across getting ready for this show that I had seen a couple of years ago and I kind of forgot, but it seems so super helpful here is Ngrok.

00:26:00.920 --> 00:26:02.860
Have any of you guys used Ngrok for this?

00:26:02.860 --> 00:26:03.100
Yeah.

00:26:03.100 --> 00:26:05.060
Ngrok is a great tool.

00:26:05.060 --> 00:26:05.800
Tell people what it is.

00:26:05.840 --> 00:26:17.620
It exposes a local port on your computer and basically tunnels, provides you a public URL that will tunnel traffic through that into your local port.

00:26:18.040 --> 00:26:31.640
So if you're like developing a skill or some other type of application that needs to receive requests from the outside, you just fire up Ngrok and point it, give it the port you want to expose.

00:26:31.640 --> 00:26:37.040
And then you get this temporary Ngrok.io URL.

00:26:37.040 --> 00:26:41.360
And that's basically just the public URL that you get for free.

00:26:41.360 --> 00:26:42.160
Yeah, that's really cool.

00:26:42.160 --> 00:26:47.100
Because one of the reasons you need that is you basically have two choices when you set up an Alexa skill.

00:26:47.340 --> 00:26:50.380
There's as you go through the Amazon dashboard.

00:26:50.380 --> 00:26:55.840
And one of them is where do we invoke this, the logic of your skill?

00:26:55.840 --> 00:27:05.600
And it could either be an AWS Lambda, which is the serverless computing thing, which you can definitely do in Python, or it could be some HTTP endpoint.

00:27:06.520 --> 00:27:18.100
And so if you want to do like a dev version testing on your machine, you can run, say, like Flask or Flask Ask, for example, on localhost on a certain port.

00:27:18.100 --> 00:27:25.580
And then you can use Ngrok to map that localhost only port out to Ngrok.com, IO, whatever it is.

00:27:25.580 --> 00:27:30.000
And then that becomes a public HTTPS URL that you can tell Amazon is how to get to it.

00:27:30.000 --> 00:27:31.240
And it actually hits your dev server.

00:27:31.240 --> 00:27:35.280
I guess you could even like have breakpoints and all sorts of crazy stuff when you talk to Alexa, right?

00:27:35.280 --> 00:27:41.980
I think for Ngrok, the free version, because I actually look into Ngrok for not for Alexa skills, but for my day job.

00:27:41.980 --> 00:27:46.460
So I think for the free version, you could have your familiar ports when you launch.

00:27:46.460 --> 00:27:50.160
And if you pay, I think, $10 a month, you get two reserved ports.

00:27:50.160 --> 00:27:55.120
And you could even use custom domains for you to fix them when you launched Ngrok.

00:27:55.120 --> 00:28:05.200
So but yeah, you know, if you don't use Ngrok, I guess let's just say you have your own HTTP server, you have to worry about like certs, and you have to worry about trusting issues and so on.

00:28:05.200 --> 00:28:09.860
So Ngrok, it's kind of what I've seen people do if they don't use Lambda and use your own server.

00:28:09.860 --> 00:28:11.100
Okay, that makes a lot of sense.

00:28:11.100 --> 00:28:12.220
All right.

00:28:12.220 --> 00:28:14.880
So I guess, Eric, I'll stick with you for a sec.

00:28:14.880 --> 00:28:17.060
What do you use when you're writing these skills?

00:28:17.060 --> 00:28:18.800
Like what's the tech stack look like?

00:28:18.800 --> 00:28:29.780
I just use the, I think other people would echo this, the front part, like the interaction with Alexa to resolve whatever your voice stream is into an intent.

00:28:29.780 --> 00:28:35.560
There's no other way than to just using their templates, using the ask Alexa skill kit.

00:28:35.560 --> 00:28:41.480
And then like you mentioned, I use the triggering for Alexa as the input to trigger my Lambda function.

00:28:41.480 --> 00:28:44.980
And then Lambda function, if I need a database, I use DynamoDB.

00:28:44.980 --> 00:28:46.400
And that's kind of the whole flow.

00:28:46.400 --> 00:28:47.200
Yeah, that's pretty cool.

00:28:47.200 --> 00:28:52.540
And DynamoDB is a really interesting NoSQL as a service inside AWS, which is cool.

00:28:52.540 --> 00:28:53.360
Yeah, super fast.

00:28:53.360 --> 00:28:54.580
Yeah, it's crazy fast.

00:28:54.580 --> 00:28:55.460
That's cool.

00:28:55.460 --> 00:28:56.440
Cam, how about you?

00:28:56.440 --> 00:29:01.060
Yeah, so I don't use Lambda or AWS or anything.

00:29:01.060 --> 00:29:05.100
I just typically, since I haven't published, it's usually just through NCROC.

00:29:05.100 --> 00:29:08.200
But I write all the code using Flaskask.

00:29:08.200 --> 00:29:15.020
And then once I'm ready to kind of just have that running, I host it on Heroku, just like the free tier.

00:29:15.020 --> 00:29:17.580
So it's kind of just two steps.

00:29:17.580 --> 00:29:18.600
Yeah, that's nice and easy.

00:29:18.600 --> 00:29:19.080
Yeah.

00:29:19.080 --> 00:29:22.380
We'll definitely, we'll talk more about Flaskask in just a second.

00:29:22.380 --> 00:29:23.200
Dave, how about yourself?

00:29:23.300 --> 00:29:25.320
Yeah, it's Flaskask in Heroku.

00:29:25.320 --> 00:29:39.060
And with Heroku, the free tier for most skills, especially if it's sort of just a personal skill, and you don't expect it to become like a top 10 skill in the skill store, you can pretty much run the free tier indefinitely.

00:29:39.060 --> 00:29:42.440
I can imagine like how much traffic could Alexa possibly generate?

00:29:42.560 --> 00:29:46.020
That's sort of the good thing is that it's very kind of quick in the interactions.

00:29:46.020 --> 00:29:57.060
And even if you're doing something with audio and audio directives and opening a stream, the stream actually goes from the stream source to Amazon and then to the endpoint, whether it's a dot or something else.

00:29:57.060 --> 00:29:58.280
So you don't have to worry about it.

00:29:58.280 --> 00:29:59.060
You don't have to flow it.

00:29:59.060 --> 00:29:59.240
Yeah.

00:29:59.240 --> 00:30:00.860
You don't have to pass that through.

00:30:00.860 --> 00:30:01.980
Yeah, that makes it really nice.

00:30:02.160 --> 00:30:02.320
Yeah.

00:30:02.320 --> 00:30:05.460
So your Heroku instance or something else could spin down for a while.

00:30:05.460 --> 00:30:07.060
That stream could play for a half hour.

00:30:07.060 --> 00:30:09.960
The user might then pause it or stop it.

00:30:09.960 --> 00:30:15.000
And then you'll get the call to your server from Amazon saying that the user stopped the stream.

00:30:15.000 --> 00:30:15.300
Yeah.

00:30:15.380 --> 00:30:18.460
So it seems like a lot of stateless, really quick, short type of things.

00:30:18.460 --> 00:30:19.060
Yep, definitely.

00:30:19.060 --> 00:30:23.300
And that's sort of the catch is the stateless part is that this is probably getting a little too far ahead.

00:30:23.300 --> 00:30:31.340
But I mean, that's really the hardest part in dealing with the skill development is that Amazon assumes you're going to wrangle all the statefulness.

00:30:31.340 --> 00:30:31.960
Right.

00:30:31.960 --> 00:30:35.400
And that might be why you might want a database, for example, like Eric was saying.

00:30:35.400 --> 00:30:36.460
Right.

00:30:36.460 --> 00:30:39.340
More or less push the session into the database.

00:30:39.340 --> 00:30:44.660
The next request comes in from that user and you can like kind of infer where you might want to pick up again.

00:30:44.780 --> 00:30:49.040
Because it's not like normal web application development where you might have a cookie or a session or something.

00:30:49.040 --> 00:30:52.980
And then all this middleware you can use, it'll automatically pick that up.

00:30:52.980 --> 00:30:55.780
What do you use to trigger off of to identify the user?

00:30:55.780 --> 00:30:58.140
Do you have their account, their device ID, something like that?

00:30:58.140 --> 00:31:00.380
From my experience, there are a couple different things.

00:31:00.380 --> 00:31:05.520
And they change based on basically what part of the Alexa skills API you're using.

00:31:05.520 --> 00:31:13.960
For things like audio, it's once the user actually starts a stream and they start hearing audio on their Echo device, it actually closes the session.

00:31:14.180 --> 00:31:19.760
So your session that you might be tracking with a session ID actually is no longer.

00:31:19.760 --> 00:31:30.680
When that user, that same user issues a stop or a pause or a skip, it'll look like a brand new request to your Echo application in Heroku, for instance.

00:31:30.920 --> 00:31:33.600
So there's like a special, I believe, context ID.

00:31:33.600 --> 00:31:44.640
This is an area I actually caused me to give a whole 45-minute talk at a local Burlington Python meetup here around the oddities of this.

00:31:44.640 --> 00:31:48.500
But for a while, there's even discrepancies in Amazon's only.

00:31:49.240 --> 00:31:50.300
I don't believe so, unfortunately.

00:31:50.300 --> 00:31:51.600
All my materials are online.

00:31:51.600 --> 00:31:52.440
Okay.

00:31:52.440 --> 00:31:53.420
We haven't been recording them.

00:31:53.420 --> 00:31:56.100
But Amazon's documentation was also kind of incorrect.

00:31:56.540 --> 00:32:14.940
And for those who had been doing skill development maybe for a while or kind of tried their hand at it like a year ago, if you tried to do any of the audio stuff with Amazon's actual formal test suite that they have in their developer web app, it didn't work because it didn't have this proper kind of unique context ID generation.

00:32:15.580 --> 00:32:19.200
So you just have to hold on to that, and then you need to hold on to the stream ID.

00:32:19.200 --> 00:32:30.800
There are certain things you can give to Amazon saying, you know, if you're doing a dialogue with a user and you're not closing the session, the user chooses, I think, you know, common example skills or like pick your, tell me your favorite color.

00:32:30.800 --> 00:32:33.520
And then you use that later on in the conversation.

00:32:33.520 --> 00:32:37.020
Amazon can hold that session-based information.

00:32:37.020 --> 00:32:40.400
But once you start playing a stream, the session's gone.

00:32:41.060 --> 00:32:49.340
So it's on you to have a caching layer or a database that says, okay, for this particular interaction, they started this stream.

00:32:49.340 --> 00:32:53.960
So that way, when you get the stop or the pause or the skip, you know what it refers to.

00:32:53.960 --> 00:32:54.260
Okay.

00:32:54.260 --> 00:32:54.920
Yeah, that's cool.

00:32:54.920 --> 00:32:57.080
It sounds challenging, but you can make it work.

00:32:57.080 --> 00:32:59.880
It's one of the newer areas for playing streams.

00:32:59.880 --> 00:33:04.040
So from day one, you always get the user ID and the session ID.

00:33:04.040 --> 00:33:07.460
So the session ID obviously just, you know, as good as the session goes.

00:33:07.460 --> 00:33:11.960
And the user ID is what, it's a string that associated with your Amazon account.

00:33:11.960 --> 00:33:19.480
So say if you use have multiple like Echo and Echo Dot, you will get the same user ID for both devices when they launch the same skill.

00:33:19.480 --> 00:33:22.340
So later on, I think you face a challenge.

00:33:22.340 --> 00:33:30.240
If you want to differentiate between Echo and Echo Dot, then you want to use the, there's a newer checkbox to say, ask for a user's locale.

00:33:30.380 --> 00:33:33.300
And if you do that, then you actually get past the device ID.

00:33:33.300 --> 00:33:37.800
And that's how you get by for identifying unique devices versus just the user ID.

00:33:37.800 --> 00:33:38.080
Right.

00:33:38.080 --> 00:33:45.320
If you have like one in your kitchen and one in the living room and the kids are messing with it in the living room and you're in the kitchen, right?

00:33:45.320 --> 00:33:45.900
Like, yeah.

00:33:45.900 --> 00:33:47.700
You might want to differentiate between those.

00:33:47.700 --> 00:33:54.480
There are instances that you want to have a frictionless experience between, you know, different devices that you have as long as you have the same ID.

00:33:54.980 --> 00:34:01.640
Like say, for example, if you enable a skill set, you know, for your one device, then you automatically enable it because it's associated to your Amazon account.

00:34:01.640 --> 00:34:06.220
But there are other times when you need to differentiate between devices because of device limitation.

00:34:06.220 --> 00:34:12.800
You know, for example, you know, Echo Show will show you a little screen and while the Echo itself doesn't.

00:34:12.800 --> 00:34:14.800
So there are different use cases for them.

00:34:14.800 --> 00:34:20.620
And because this is so new and Amazon's learning as we go, they definitely try to iterate based on that.

00:34:20.820 --> 00:34:31.500
And one thing that I would kind of just stand my soapbox and sing the praises for Amazon is they do listen to developers, arguably more so than Apple and Google and all the other platforms.

00:34:31.500 --> 00:34:32.540
That's how I feel about it.

00:34:32.540 --> 00:34:33.040
That's pretty cool.

00:34:33.040 --> 00:34:39.140
So let's talk about what Dave and Cam have brought up, this thing called Flask Ask.

00:34:39.140 --> 00:34:45.900
So Flask Ask is, is that the ASK, Alexa Skill Kit is what the ask stands for?

00:34:45.900 --> 00:34:46.440
Right.

00:34:47.040 --> 00:34:47.720
Okay, cool.

00:34:47.720 --> 00:34:51.060
So Cam, tell us what Flask Ask is.

00:34:51.060 --> 00:34:53.200
It's a Flask extension.

00:34:53.200 --> 00:34:55.340
It's made by this guy, John Wheeler.

00:34:55.340 --> 00:34:59.960
And it's a really cool Python package to get started with Alexa.

00:34:59.960 --> 00:35:05.460
Basically, he created, he provides some decorators with Flask.

00:35:05.460 --> 00:35:09.320
You know, you would route your view functions with at app.route.

00:35:09.320 --> 00:35:12.640
You do the same thing, but it's with like ask.

00:35:12.860 --> 00:35:19.180
And then you basically just write your code as if you're doing typical Flask web app.

00:35:19.180 --> 00:35:20.380
You just have your view function.

00:35:20.380 --> 00:35:28.680
And when you return your response, it provides special response classes to either ask or tell the user.

00:35:29.140 --> 00:35:34.180
So you can like ask something and then expect a response back to that question.

00:35:34.180 --> 00:35:37.420
Or you can just send a message to the user.

00:35:37.420 --> 00:35:40.900
And it just makes it really simple to get going.

00:35:40.900 --> 00:35:42.920
And I've seen that it's pretty cool.

00:35:42.920 --> 00:35:52.400
It's brought in a lot of people who are new to Python or programming in general or just diving in, which is pretty good for the Python ecosystem.

00:35:52.400 --> 00:35:59.060
A lot of people know Flask or they know some Python web framework, which is super similar to Flask in a way or another.

00:35:59.060 --> 00:36:09.200
And if you can just write a Flask app and instead of put, you know, the view decorator or whatever, the route decorator, you can just say at ask.intent.

00:36:09.680 --> 00:36:14.700
And name basically the intents of your app, which is pretty cool.

00:36:14.700 --> 00:36:17.320
So it seems like it's really, really approachable.

00:36:17.320 --> 00:36:18.720
Dave, what would you add to it?

00:36:18.720 --> 00:36:23.960
It adds templating as well for the dialogues and the interactions with the user.

00:36:23.960 --> 00:36:25.820
I know what templating looks like in the website.

00:36:25.820 --> 00:36:27.920
Like that's the HTML.

00:36:27.920 --> 00:36:30.980
But what does that mean in the context of a voice assistant?

00:36:31.080 --> 00:36:32.380
It's extremely similar.

00:36:32.380 --> 00:36:39.060
So you can define your basically the spoken portion of Alexa when she talks back to you.

00:36:39.060 --> 00:36:40.980
She or it or whatever you want to call it.

00:36:40.980 --> 00:36:45.580
And you can also use different pluggable variables as well.

00:36:45.580 --> 00:36:51.660
So it's sort of like if you were building a web application with Flask or Django or any of the other Python frameworks.

00:36:51.660 --> 00:37:01.080
They typically have some sort of templating engine where you can write your HTML, but then have some programmatic logic in there and do some dynamic substitution when it renders it.

00:37:01.080 --> 00:37:04.720
You can do the same thing with the spoken responses back.

00:37:04.720 --> 00:37:14.460
So it makes it a lot easier because the big nicety of Flask ask, other than it fits right into the kind of the Flask model of building web applications,

00:37:14.460 --> 00:37:20.740
is that it also deals with wrangling all the nasty JSON that you need to send back to Alexa.

00:37:20.740 --> 00:37:23.060
Yeah, that's pretty awesome that you can kind of forget about that.

00:37:23.060 --> 00:37:24.380
Yeah, you can take Flask ask.

00:37:24.380 --> 00:37:32.600
You can be up and running and never have to really, you have to know a little bit about the sort of how the API works with the idea of the requests and the responses.

00:37:32.600 --> 00:37:36.740
But you don't need to know the JSON format, which is pretty lengthy.

00:37:36.740 --> 00:37:42.440
The templating and the stuff for the responses, what's also cool is it also allows for SSML.

00:37:42.740 --> 00:37:51.360
So you can kind of give like the actual voice response some more kind of customization.

00:37:51.360 --> 00:37:55.900
Yeah, like the inflections, the way you can kind of tailor how things are pronounced.

00:37:55.900 --> 00:37:57.620
So it's not as robotic.

00:37:57.620 --> 00:37:58.460
Yeah, that's cool.

00:37:58.520 --> 00:38:03.440
So you can make it sound like it's a question like go to the store versus go to the store.

00:38:03.440 --> 00:38:06.700
Yeah, I think some of that Amazon does pretty well by default.

00:38:06.700 --> 00:38:17.000
But for, you know, if you have the name of a product or something, I had a heck of a time with the Vermont Public Radio skills, just making it sound kind of conversational.

00:38:17.280 --> 00:38:17.760
I can imagine.

00:38:17.760 --> 00:38:22.880
A good thing for SSML is besides, you know, like you want to change the default behavior.

00:38:22.880 --> 00:38:26.800
Like if you want to, instead of say cat, you want to spell out the C-A-T.

00:38:26.800 --> 00:38:29.220
That's where you invoke your SSML.

00:38:29.220 --> 00:38:32.400
They also have a bunch of what they call the speechlets.

00:38:32.400 --> 00:38:42.460
So that when you want to add more speechlets, but you don't want to worry about like encoding your audio into a specific format that Amazon likes.

00:38:42.780 --> 00:38:52.120
So, for example, you could have SSML go, wow, or like, hey, you just open a door, making a door sound like that kind of door sound if you want to play like a voice game.

00:38:52.120 --> 00:38:54.700
And that's exactly what you use SSML for.

00:38:54.700 --> 00:39:02.220
You just use a little tag, like XML tag, and then you find out the list of ever-growing list of speechlets that they have.

00:39:02.220 --> 00:39:06.200
And then you could start having interactions that way without worrying.

00:39:06.200 --> 00:39:17.780
Like I said, like the biggest challenge for encoding your own audio for Amazon is the bunch of restrictions that they place to just because for their consideration and for a speed of getting that file and play back.

00:39:17.780 --> 00:39:20.600
For voice, you don't have the luxury of visual.

00:39:20.600 --> 00:39:23.520
So you always have to short, concise, and fast.

00:39:23.520 --> 00:39:28.940
So that's kind of cool that they have these, you know, I would say about 30 speechlets.

00:39:28.940 --> 00:39:30.620
And of course, they're adding in more every day.

00:39:30.620 --> 00:39:31.420
That sounds really cool.

00:39:31.420 --> 00:39:42.060
One of the things you made me think of when you're talking about your door and stuff is you could do a pretty awesome audio replacement of like a text-based game, right?

00:39:42.060 --> 00:39:43.680
You walk into the room and you see this.

00:39:43.680 --> 00:39:44.400
What do you want to do?

00:39:44.400 --> 00:39:49.740
Like all those types of games like Leisure Shoot Larry or The Muds or whatever.

00:39:49.740 --> 00:39:53.180
You could probably have a really awesome little skill that is like that game, right?

00:39:53.180 --> 00:39:55.760
That is exactly the example they give.

00:39:55.760 --> 00:40:05.880
So if you have gone through some of the later, not the beginning, but the later like Amazon workshops and stuff, and that is exactly the example that will walk you through.

00:40:05.880 --> 00:40:17.600
And the JSON example, I'm sorry, the JavaScript example that they give online that they publish open source is the game that you interact with people and especially kids.

00:40:17.600 --> 00:40:21.640
They don't have a lot of patience and they don't have a lot of white vocabularies.

00:40:21.640 --> 00:40:23.480
So they use that as an example.

00:40:23.480 --> 00:40:28.900
So, you know, you open up a box and do you either take a look at it or you close it right away?

00:40:28.900 --> 00:40:32.040
And then you wait for the kids to respond and then you'll go from there.

00:40:32.040 --> 00:40:36.480
So you have all these, you know, interactions that, like you said, the gaming aspect of it.

00:40:36.480 --> 00:40:37.280
That sounds pretty fun.

00:40:38.280 --> 00:40:43.540
You know, with this Flask ask thing, it makes it so much sense, like where ngrok fits in.

00:40:43.540 --> 00:40:50.760
So basically you write your code as a Flask application, which, you know, you can run.

00:40:50.760 --> 00:40:52.960
It's going to run on localhost on port 5000.

00:40:52.960 --> 00:41:02.820
But then in order to actually test and develop and debug that, you need to be able to let Amazon services directly call that service, right?

00:41:02.820 --> 00:41:03.540
Right.

00:41:04.140 --> 00:41:08.300
You can do some local testing because it is a Flask application.

00:41:08.300 --> 00:41:08.660
I see.

00:41:08.660 --> 00:41:16.100
So if you know what to send, what to expect, you can like send it that over and over just through like Postman or a unit test or something, right?

00:41:16.100 --> 00:41:16.540
Exactly.

00:41:16.540 --> 00:41:21.520
And you can do it programmatically in your unit tests and you can always look at the response that comes back.

00:41:21.520 --> 00:41:30.620
But I mean, from my experience, nothing, if you're going to submit something and not use it just for personal use, nothing beats actually using a hardware device.

00:41:30.620 --> 00:41:36.280
Cool. Is there a way to make like personal skills that your Alexa has that are not public?

00:41:36.280 --> 00:41:38.940
It's like associated with your Amazon account.

00:41:38.940 --> 00:41:42.200
Like, I think it's in development or something.

00:41:42.200 --> 00:41:43.840
That's what the skill is marked as.

00:41:43.840 --> 00:41:52.040
But do you guys know if that like persists or is there like a limit to how long you can keep it like running privately?

00:41:52.040 --> 00:41:57.420
I don't think there's a limit because I definitely have some old ones lingering that I haven't cleared out.

00:41:57.420 --> 00:42:00.480
Until Lambda starts to charge money, I would just keep all of my skills.

00:42:00.480 --> 00:42:05.600
And so you could, you know, for sure, you know, keep a skill in development.

00:42:05.600 --> 00:42:15.900
And I think more recently, I don't know how long it's been, but definitely more recent than day one is that you could start inviting your people to, you know, beta test that skill set.

00:42:15.900 --> 00:42:20.960
So you have their Amazon, I think you either you get their email address associated with their Amazon account.

00:42:20.960 --> 00:42:28.220
And then you could submit it to, you know, a little page or portal to say, I want to have, you know, my code test, beta test my skill.

00:42:28.220 --> 00:42:31.560
So that way I could share that skill without having to publish it in the marketplace.

00:42:31.560 --> 00:42:32.380
That's pretty cool.

00:42:32.380 --> 00:42:37.700
I can just imagine you might want to automate some stuff for you, but it's too specific.

00:42:37.900 --> 00:42:38.020
Yeah.

00:42:38.020 --> 00:42:41.620
Once my grandma started turning on my living room lights, I would just like cut her off.

00:42:41.620 --> 00:42:41.880
Right.

00:42:41.880 --> 00:42:45.280
That's right.

00:42:45.280 --> 00:42:51.560
Like if my robot lawnmower finishes and then goes in the garage, first open the garage.

00:42:51.560 --> 00:42:54.580
And when it's in the garage, close the garage and then turn on the sprinklers.

00:42:54.580 --> 00:42:57.660
Like that's probably not a skill everyone wants, but that'd be really cool to say.

00:42:57.660 --> 00:43:00.420
Go mow the yard and then water it.

00:43:00.480 --> 00:43:05.100
You know, what's super creepy is that for the new Amazon show, you actually have a drop-in mode.

00:43:05.100 --> 00:43:10.220
So they could actually call you like a Skype call with video without you knowing.

00:43:10.220 --> 00:43:12.220
I think you could, it has to be opt-in.

00:43:12.220 --> 00:43:16.620
But if you have two shows blown to the same account, you can actually do that drop-in thing.

00:43:16.620 --> 00:43:17.840
And which is just super creepy.

00:43:17.840 --> 00:43:21.400
I mean, it's almost up there as Amazon keys, but you know, that's another story.

00:43:21.400 --> 00:43:21.920
Another day.

00:43:21.920 --> 00:43:23.400
Yeah.

00:43:23.400 --> 00:43:28.380
The Amazon keys, where you basically give Amazon a key for the delivery people.

00:43:28.380 --> 00:43:29.160
Interesting.

00:43:29.360 --> 00:43:32.160
Two, third-party contractors for Amazon as well.

00:43:32.160 --> 00:43:33.040
That's right.

00:43:33.040 --> 00:43:33.940
Not even Amazon.

00:43:33.940 --> 00:43:34.860
Yeah, exactly.

00:43:34.860 --> 00:43:35.960
But anyways.

00:43:35.960 --> 00:43:36.780
Quite interesting.

00:43:36.780 --> 00:43:37.460
Yeah.

00:43:37.460 --> 00:43:38.740
That's a whole nother level.

00:43:38.740 --> 00:43:44.160
So Dave and Cam, you guys both contributed various things.

00:43:44.160 --> 00:43:45.300
Cam, let's start with you.

00:43:45.300 --> 00:43:47.260
What do you do for Flask Ask?

00:43:47.260 --> 00:43:47.600
Yeah.

00:43:47.600 --> 00:43:51.800
So Flask was like my first real step into the open source world.

00:43:52.400 --> 00:43:57.220
I started by just going through the code base and trying to document everything.

00:43:57.220 --> 00:43:59.480
Or like the doc strings and everything.

00:43:59.480 --> 00:44:03.980
And that kind of just gave me a really good understanding of how the whole thing worked.

00:44:03.980 --> 00:44:16.060
And then at the time, there was no support for audio streaming besides through SSML, which is, it's limited to like, I don't know, 30 seconds or a minute or something.

00:44:16.060 --> 00:44:32.120
And once Amazon announced like basically the audio streaming capability, I implemented the, basically the response classes for streaming like audio streams from some URL.

00:44:32.580 --> 00:44:36.300
So that you just say return audio and then whatever.

00:44:36.300 --> 00:44:45.620
Dave came along later and really made that much more solid for working across with that whole session issue here speaking of.

00:44:45.620 --> 00:44:46.080
Yeah, cool.

00:44:46.080 --> 00:44:47.040
And Dave, how about you?

00:44:47.040 --> 00:44:50.660
I basically built off of a lot of the groundwork that Cam had laid.

00:44:50.660 --> 00:44:55.140
So I had, I found Flask Ask when I first started doing skill development.

00:44:55.140 --> 00:44:59.680
And I used it as the basis for the streaming skill for Vermont Public Radio.

00:44:59.680 --> 00:45:01.860
And everything was working great.

00:45:02.180 --> 00:45:06.060
And we went and pushed out kind of a testable version into Heroku.

00:45:06.060 --> 00:45:14.100
And as we were manually testing it, we found that every once in a while, the stream would just sort of get interrupted or stop.

00:45:14.100 --> 00:45:19.840
After some debugging, I found out that it was because with running it in Gunicorn.

00:45:19.840 --> 00:45:21.260
I never know how to pronounce it.

00:45:21.340 --> 00:45:25.480
It had multiple sort of workers.

00:45:25.480 --> 00:45:30.000
And one worker would retreat or respond to a request from Amazon.

00:45:30.000 --> 00:45:31.240
And then the other one would.

00:45:31.240 --> 00:45:35.060
And they didn't have any sort of shared state.

00:45:35.060 --> 00:45:37.100
They were just using kind of thread local storage.

00:45:37.100 --> 00:45:39.800
I think that's basically what the default behavior was at the time.

00:45:40.020 --> 00:45:47.040
So I had to find a way to get them to use some shared state to be able to solve the problem of starting and stopping the streams.

00:45:47.360 --> 00:45:54.820
And luckily, all it required was digging into sort of work sub, the underlying kind of underpinnings of Flask, figuring out how that worked.

00:45:54.820 --> 00:45:57.320
And conveniently, there was a caching layer already there.

00:45:57.320 --> 00:46:01.900
So it was a matter of just kind of bringing that up into the Flask ask world, making it simpler.

00:46:01.900 --> 00:46:02.500
Yeah, that's cool.

00:46:02.500 --> 00:46:04.520
Using the simple cache, I think, is the actual name.

00:46:04.780 --> 00:46:06.640
So it's as simple as that, where it'll do it in memory.

00:46:06.640 --> 00:46:09.540
And that solved the streaming problem.

00:46:09.540 --> 00:46:12.200
Let's say push across the different request threads, right?

00:46:12.200 --> 00:46:12.600
Right.

00:46:12.600 --> 00:46:14.800
Because you can never guarantee who's going to respond to it.

00:46:14.800 --> 00:46:22.540
And if you did spin up multiple, let's say you did have a massively popular skill, or maybe your skill is actually part of a larger application.

00:46:22.540 --> 00:46:26.180
It also just happens to be an Alexa skill endpoint.

00:46:26.180 --> 00:46:28.940
You might not even know which server responds to it.

00:46:28.940 --> 00:46:29.400
Interesting.

00:46:29.400 --> 00:46:34.600
So something that's similar to this that you created, Cam, is called Flask Assistant.

00:46:34.600 --> 00:46:35.400
All right.

00:46:35.400 --> 00:46:36.780
Tell people quickly about that.

00:46:36.780 --> 00:46:41.560
Yeah, it's basically just the Flask ask for Google Assistant.

00:46:41.560 --> 00:46:54.080
And rather than using the Alexa Skills Kit and basically the whole Amazon ecosystem, it uses something called Dialogflow, which used to be called API.ai.

00:46:54.080 --> 00:47:02.400
And what that is, is basically a NLP, a natural language processing platform owned by Google.

00:47:03.260 --> 00:47:06.960
And so it's pretty analogous to Flask ask.

00:47:06.960 --> 00:47:24.000
It's got a very similar API and everything and allows you to integrate your, it's not called a skill for Google Assistant or API.ai, but basically your little voice app with things like Google Assistant or Skype or Facebook Messenger.

00:47:24.000 --> 00:47:25.700
Do they have to run in different processes?

00:47:25.700 --> 00:47:31.380
Or could I host both a Flask Assistant and Flask ask app in the same code on the same server?

00:47:31.380 --> 00:47:36.320
I actually haven't tried that, but it should be possible just by basically stacking decorators.

00:47:36.320 --> 00:47:41.520
And then one cool thing about Dialogflow is that Alexa is actually one of the integrations.

00:47:42.380 --> 00:47:48.360
So if you were to do it that way, you could basically export your project into the Alexa Skills Kit.

00:47:48.360 --> 00:47:52.580
But I mean, if you're going to do that, it makes more sense to just use Flask ask since it's...

00:47:52.580 --> 00:47:52.780
Right.

00:47:52.780 --> 00:47:53.120
Yeah.

00:47:53.120 --> 00:47:53.440
Yeah.

00:47:53.440 --> 00:47:56.640
And maybe you just run two processes on two different ports or whatever.

00:47:56.640 --> 00:47:57.900
But yeah, it's still pretty cool.

00:47:57.900 --> 00:47:58.180
Yeah.

00:47:58.180 --> 00:47:59.660
It's been fun working on that.

00:47:59.760 --> 00:48:02.220
We're getting sort of near the end of our time together.

00:48:02.220 --> 00:48:06.140
Let's talk about maybe a few higher level questions.

00:48:06.140 --> 00:48:09.000
First, maybe Eric, you can go with this one first.

00:48:09.000 --> 00:48:12.460
How do you make money as an Alexa developer?

00:48:12.460 --> 00:48:17.080
So if I was working on an iPhone app, an iPhone game, I know how I make money there.

00:48:17.080 --> 00:48:20.340
Or Android, just not as much per user.

00:48:20.340 --> 00:48:22.920
But still, you put it in the store, people buy it.

00:48:22.920 --> 00:48:24.040
You don't buy these skills.

00:48:24.040 --> 00:48:26.760
You just tell Alexa to install them or you go to your phone and install them, right?

00:48:26.920 --> 00:48:28.560
Yeah, that was my question from day one.

00:48:28.560 --> 00:48:30.500
It's like, how do you make money from it?

00:48:30.500 --> 00:48:33.540
And so they recently announced an in-app purchase.

00:48:33.540 --> 00:48:38.600
So essentially, you could make purchase just very much like what you do in an iPhone app.

00:48:38.600 --> 00:48:39.980
But I haven't...

00:48:39.980 --> 00:48:42.620
Because it's so new, I don't know the details on that.

00:48:42.620 --> 00:48:45.340
But currently, you have two ways to make money.

00:48:45.340 --> 00:48:46.360
Well, three ways, I guess.

00:48:46.360 --> 00:48:53.180
So one is you could get Alexa credits, AWS credits if your Alexa skill invoke charges.

00:48:53.820 --> 00:48:59.540
But since I tie my end to Lambda, and currently the first million calls per month in Lambda is free.

00:48:59.540 --> 00:49:03.100
So basically, it's $100 per month and it's month-to-month basis.

00:49:03.100 --> 00:49:07.240
So I basically just use that to fund my other AWS usage.

00:49:07.240 --> 00:49:08.240
So that's pretty cool.

00:49:08.240 --> 00:49:11.960
And the second way that you can make money is you could be a top skill.

00:49:11.960 --> 00:49:18.980
I've seen people who post on their Twitter tweets that they've made like $1,100 per month of being top skills.

00:49:19.560 --> 00:49:22.220
But I don't know what the selection criteria is.

00:49:22.220 --> 00:49:27.320
So I can't say for sure like how to do it or how not to do it, what gets you there.

00:49:27.320 --> 00:49:32.780
But that's certainly another way that they've announced and you can make money from it.

00:49:32.780 --> 00:49:38.620
And the third way is basically just use Alexa as a front end for your voice user interface.

00:49:38.620 --> 00:49:41.060
And you tie that into external account.

00:49:41.160 --> 00:49:46.360
And that's what the majority of the companies are doing, whether it's public radio, maybe they do charge people.

00:49:46.360 --> 00:49:50.380
I'm sure in this case they don't, but for Vermont, public radio.

00:49:50.380 --> 00:49:52.720
But like say Uber, for example, right?

00:49:52.720 --> 00:49:59.900
Then you use Alexa to order your Uber rides or Domino's Pizza, which is a US pizza chain that you could use that to order pizza.

00:49:59.900 --> 00:50:01.420
And tie into your account.

00:50:01.420 --> 00:50:04.060
And then that you make money that would increase your usage.

00:50:04.060 --> 00:50:04.940
That's a third way.

00:50:04.940 --> 00:50:05.160
Right.

00:50:05.200 --> 00:50:06.440
It's just a funnel, right?

00:50:06.440 --> 00:50:08.160
To an existing business model.

00:50:08.160 --> 00:50:08.360
Yeah.

00:50:08.360 --> 00:50:08.840
Exactly.

00:50:08.840 --> 00:50:09.880
And I don't know.

00:50:09.880 --> 00:50:11.480
I don't think there's any studies.

00:50:11.480 --> 00:50:22.860
I'm sure Amazon's more than happy to tell you how much increase of usage that, you know, people increase their, you know, monthly spending on Uber or Domino's Pizza by 20% just by having your Alexa skill or whatnot.

00:50:22.860 --> 00:50:24.840
But I haven't seen any studies like that.

00:50:24.840 --> 00:50:25.720
So I can't say for sure.

00:50:25.720 --> 00:50:32.260
But the third way seems to be most common for business today outside of just hobbyists or some other companies.

00:50:32.260 --> 00:50:32.600
Yeah.

00:50:32.600 --> 00:50:32.880
Right.

00:50:32.880 --> 00:50:34.960
I mean, Dave, that sounds more like what you're doing.

00:50:34.960 --> 00:50:40.320
I know public radio doesn't necessarily directly make money, but increasing listenership is a key goal, right?

00:50:40.320 --> 00:50:40.740
Right.

00:50:40.740 --> 00:50:42.220
There's sort of two sides to this.

00:50:42.220 --> 00:50:44.140
One is being able to engage.

00:50:44.140 --> 00:50:53.800
In this case, since it's Vermont Public Radio, it's engaging listeners and building awareness and also helping drive contributions during fundraisers.

00:50:54.140 --> 00:50:57.360
So obviously having the ability, you're using the stream.

00:50:57.360 --> 00:50:58.860
So you're delivering your product.

00:50:58.860 --> 00:51:03.180
In this case, they're live content and they're episodic content.

00:51:03.180 --> 00:51:07.620
And in doing so, they also have the ability to advertise and promote their own offerings.

00:51:07.620 --> 00:51:11.840
So that's sort of one approach where it's sort of more of a marketing channel.

00:51:12.360 --> 00:51:24.520
And I think in what Eric was saying is really sort of what I describe as like the post-walled garden economy where you no longer get rich in the app store within the walled garden.

00:51:24.740 --> 00:51:31.960
You really have to use it as a way to accelerate your business model outside of it and just meet the customer where they are.

00:51:31.960 --> 00:51:42.840
You know, if they're in their kitchen and they're trying to cut vegetables and corral a kid with one arm, being able to have the conversation with them over Alexa is sort of the way to meet them in their time of need.

00:51:42.960 --> 00:51:43.440
That's pretty awesome.

00:51:43.440 --> 00:51:52.500
The other thing that I think we're touching on is these devices, except for mine when I just turned off the microphone so we could actually have this without being interrupted.

00:51:52.500 --> 00:51:53.420
Are you sure, Michael?

00:51:53.420 --> 00:51:56.460
I mean, that's a good question, right?

00:51:56.460 --> 00:52:02.300
These things are generally always listening to us, but maybe they don't process everything we're listening.

00:52:02.300 --> 00:52:03.500
Maybe they don't share everything we're listening.

00:52:03.500 --> 00:52:05.140
But Cam, maybe you start first.

00:52:05.140 --> 00:52:08.220
What are your thoughts on the privacy around always listening devices?

00:52:08.220 --> 00:52:14.660
When you get one of these devices, you just got to be aware of that and personally be okay with it.

00:52:15.000 --> 00:52:26.700
I'm not sure if Alexa provides this, but I know with the Google Home, you can go to your account activity and see and listen to everything that it has recorded.

00:52:26.700 --> 00:52:29.260
And I know you can delete that.

00:52:29.260 --> 00:52:36.280
I'm not sure if Amazon is as transparent, but I think it's just something you got to accept if you're going to buy one of these.

00:52:36.280 --> 00:52:36.620
Yeah.

00:52:36.620 --> 00:52:37.600
Eric, what do you think?

00:52:37.600 --> 00:52:38.700
I think the answer is yes.

00:52:38.820 --> 00:52:49.200
So I know I have been going into my Amazon or the Alexa app and listening to what Alexa knows about me and deleting the voice bits and so on.

00:52:49.200 --> 00:52:54.280
But of course, you know, this is a big topic and it's been the news recently just because of the murder case.

00:52:54.280 --> 00:52:55.920
I forgot which state it was in.

00:52:55.920 --> 00:52:59.180
Basically, you know, you could go, we'll probably include it in the show notes or whatnot.

00:52:59.180 --> 00:53:04.840
But so I actually went out and looked at the official response from Amazon regarding this.

00:53:04.840 --> 00:53:07.740
You'd never know, like, how much do you trust Amazon, right?

00:53:07.780 --> 00:53:08.920
Back to the Amazon key issue.

00:53:08.920 --> 00:53:15.180
But the official word is that they do a one second buffering to detect your wake word.

00:53:15.180 --> 00:53:17.960
And then they constantly delete that one second buffering.

00:53:17.960 --> 00:53:24.280
So unless you hear one of the wake words in today's setting is one of the four, right?

00:53:24.280 --> 00:53:28.040
You could choose to have Alexa, Amazon, computer or Echo as your wake word.

00:53:28.040 --> 00:53:33.600
So they do that one second thing to do echo cancellation and they do to detect false positives.

00:53:34.140 --> 00:53:38.440
But the wake word and then only if you speak the wake word, then you start recording and so on.

00:53:38.440 --> 00:53:46.300
Obviously, like you did, Michael, is to put on the mute button when you really don't want anything to, when you don't want Echo or Alexa to participate anything.

00:53:46.300 --> 00:53:46.580
Yeah.

00:53:46.580 --> 00:53:47.420
And Dave, what do you think?

00:53:47.420 --> 00:53:48.620
I've really got two sides to this.

00:53:48.700 --> 00:53:52.640
One is I'm less concerned about what Amazon or somebody else is hearing.

00:53:52.640 --> 00:53:55.540
But I do like to play around with it because I'll use funny voices.

00:53:55.540 --> 00:53:59.420
Like even with Comcast, they now have like voice control and the remotes.

00:53:59.420 --> 00:54:03.960
And I just try to see how good it can recognize the weirdest voice it can come up with.

00:54:03.960 --> 00:54:05.500
And it's shockingly good.

00:54:05.500 --> 00:54:07.660
And if they want to record that, feel free.

00:54:07.660 --> 00:54:09.120
They can keep that on a server somewhere.

00:54:09.120 --> 00:54:18.740
I'm more concerned about sort of the secondary kind of proliferation of all the connected things that people are going to run out and buy and plug into this ecosystem.

00:54:18.800 --> 00:54:24.280
Because, you know, you look at, you know, the smart home things, even just a smart home outlet.

00:54:24.280 --> 00:54:25.580
That was like the big thing.

00:54:25.580 --> 00:54:29.520
I know my family went out and bought last year when we all got Echo Dots.

00:54:29.520 --> 00:54:40.860
Usually you have to sign up for a third party service or something from that consumer electronics manufacturer who's not skilled at securing a software based environment.

00:54:40.860 --> 00:54:41.220
Yeah.

00:54:41.220 --> 00:54:42.820
And that's what integrates with Amazon.

00:54:42.820 --> 00:54:53.000
So I'm less concerned about Amazon and more concerned about all these kind of secondary vendors that are going to do a poor job and they're just going to create these holes in our homes.

00:54:53.000 --> 00:55:04.960
Because, I mean, Amazon actually is pretty good at making sure even the media that you play, like the streams and everything, are done through a kind of, it's kind of annoying.

00:55:04.960 --> 00:55:13.060
But it has to be a, I believe, a TLS based encrypted connection and it has to have the appropriate headers in the communication.

00:55:13.060 --> 00:55:20.860
So it's hard to, you know, even get media to play in an unsecure way via the Echo devices.

00:55:20.860 --> 00:55:22.000
Yeah, that's a good point.

00:55:22.000 --> 00:55:29.780
I definitely think the Internet of Things is, the cheaper the device, the more likely you're going to have trouble with it exposing you to things.

00:55:29.860 --> 00:55:32.520
As somebody who deals with DDoS the whole time, right?

00:55:32.520 --> 00:55:41.800
Like, so, so like, I mean, we do thread Intel and, you know, like the, of course, the Mariah botnet that you heard about last year was all on IoT devices and so on.

00:55:41.800 --> 00:55:55.460
So this is a big concern, you know, instead of being an infected host with, you know, something that the user look at every day, it's now becoming all these unmanaged, relatively powerful devices that spread around like monitoring temperatures, right?

00:55:55.460 --> 00:56:23.100
Yeah, like, aside from just, you know, the things you talk about, like, as this all progresses with all these different smart sensors, like, either activating or deactivating based on your, like, daily routine, whatever entity is, like, in control of all this, all this information, they can build, like, a really good picture of what your life is like, just by all these small little adjustments you make with your smart appliances and stuff, you know?

00:56:23.100 --> 00:56:26.420
Like, they can tell when you're home or, like, when you cook and all these things.

00:56:26.420 --> 00:56:28.020
So it's something to be aware of.

00:56:28.020 --> 00:56:28.220
Yeah.

00:56:28.220 --> 00:56:32.940
How many people live in your house based on how many unique voices does it hear, for example?

00:56:32.940 --> 00:56:38.360
But remember, it's, as they said, I think it was the NSA after the whole Edward Snowden thing.

00:56:38.360 --> 00:56:39.700
It's just metadata.

00:56:39.700 --> 00:56:41.020
What are they going to do with it?

00:56:41.020 --> 00:56:41.400
That's right.

00:56:41.400 --> 00:56:41.980
It's just metadata.

00:56:41.980 --> 00:56:42.560
Come on.

00:56:42.560 --> 00:56:43.660
Come on.

00:56:43.660 --> 00:56:44.500
No problem.

00:56:44.500 --> 00:56:45.500
I don't see how that could go.

00:56:45.500 --> 00:56:45.680
Right.

00:56:45.680 --> 00:56:47.140
All right.

00:56:47.140 --> 00:56:47.660
Very cool.

00:56:47.660 --> 00:56:58.820
Even all that stuff said, it sounds like most of us, maybe all of us, have some kind of Alexa device that's generally on or more or less okay with it, at least in limited parts of our life.

00:56:58.820 --> 00:56:59.180
Yeah.

00:56:59.180 --> 00:57:00.120
For me, at least it is.

00:57:00.120 --> 00:57:00.420
Yeah.

00:57:00.420 --> 00:57:08.280
I don't have any smart appliances outside of, I've tried them and then I unplug them just to see how they work, but then I don't use them on a daily basis.

00:57:08.280 --> 00:57:08.540
Yeah.

00:57:08.540 --> 00:57:12.840
And I've got my Alexas in both the first and second floor here and use them daily.

00:57:12.840 --> 00:57:13.840
They're really, really nice.

00:57:14.840 --> 00:57:15.300
All right.

00:57:15.300 --> 00:57:19.700
Well, I guess we're pretty much out of time, so I'll have to leave it there for the Alexa stuff.

00:57:19.700 --> 00:57:22.860
But let's go down the two questions.

00:57:22.860 --> 00:57:24.300
So Dave, we'll go with you first.

00:57:24.300 --> 00:57:24.980
Favorite editor?

00:57:24.980 --> 00:57:26.140
I can't make up my mind.

00:57:26.140 --> 00:57:29.600
I either use Vim or Emacs, depending on the situation.

00:57:29.600 --> 00:57:32.780
And my hands are in constant pain as a result.

00:57:32.780 --> 00:57:34.120
Cam?

00:57:34.120 --> 00:57:35.220
Sublime.

00:57:35.220 --> 00:57:37.700
It's just so quick and nice.

00:57:37.700 --> 00:57:39.100
And Eric, have I corrupted you?

00:57:39.100 --> 00:57:39.940
Yes, you have.

00:57:39.940 --> 00:57:45.820
So I used to use Vim, but then since I listened to Talk Python too much, and so I now use PyCharm exclusively.

00:57:45.820 --> 00:57:46.820
I definitely love that.

00:57:46.820 --> 00:57:48.520
All right.

00:57:48.520 --> 00:57:49.600
And Eric, keep going with you.

00:57:49.600 --> 00:57:51.200
How about a notable PyPI package?

00:57:51.200 --> 00:57:51.440
Yeah.

00:57:51.440 --> 00:57:52.440
So I like requests.

00:57:52.440 --> 00:57:56.720
Of course, as half of the people here, I think that it should be in the standard library.

00:57:56.720 --> 00:58:01.320
And if Ansible counts, then that's definitely what I would like as well.

00:58:01.320 --> 00:58:02.840
The library slash packages.

00:58:02.840 --> 00:58:03.660
Yeah, I think it does.

00:58:03.660 --> 00:58:04.120
That's cool.

00:58:04.120 --> 00:58:04.400
Ansible.

00:58:04.400 --> 00:58:05.020
All right, Cam?

00:58:05.020 --> 00:58:10.940
So aside from Flaskask and Flask Assistant, if anyone's interested in making their own

00:58:10.940 --> 00:58:16.280
skills or anything, or just not even skills, but just programs to control things within their

00:58:16.280 --> 00:58:17.780
house, I would check out Home Assistant.

00:58:17.780 --> 00:58:19.000
It's a really cool project.

00:58:19.000 --> 00:58:19.900
It's a very cool project.

00:58:19.900 --> 00:58:21.580
It controls so many devices.

00:58:21.580 --> 00:58:25.500
It's a really cool on-your-own-network website.

00:58:25.500 --> 00:58:30.740
And yeah, I had the guys on episode 122 a while back, so definitely cool.

00:58:30.740 --> 00:58:31.660
Dave?

00:58:31.660 --> 00:58:32.800
You can't beat requests.

00:58:34.200 --> 00:58:35.300
I was going to say that.

00:58:35.300 --> 00:58:35.940
Yeah, awesome.

00:58:35.940 --> 00:58:37.640
Okay, so I agree.

00:58:37.640 --> 00:58:41.260
Request is definitely the most popular one on the show and out in the world.

00:58:41.260 --> 00:58:42.180
Final call to action.

00:58:42.180 --> 00:58:43.100
People want to get started.

00:58:43.100 --> 00:58:44.360
They want to get started with Alexa.

00:58:44.360 --> 00:58:47.960
They want to get started with Flaskask, things like that.

00:58:47.960 --> 00:58:48.600
What do they do?

00:58:48.600 --> 00:58:49.420
Just jump in, you guys.

00:58:49.420 --> 00:58:50.520
Yeah, I think they could just go.

00:58:50.520 --> 00:58:54.180
There's a bunch of templates, pre-made templates and step-by-step guide.

00:58:54.180 --> 00:58:57.880
Like I said, Amazon's very involved in reaching out to potential developers.

00:58:57.880 --> 00:59:02.320
So you could easily get a lot of freebies that way if you publish your skill sets.

00:59:02.320 --> 00:59:05.660
Go check out some of the tutorials for Flaskask and get started.

00:59:05.660 --> 00:59:06.780
It's not too hard.

00:59:06.780 --> 00:59:09.140
There's a bunch of sample projects, each one of them.

00:59:09.140 --> 00:59:14.400
I did some work in making sure that they're sort of sanity checked with each version.

00:59:14.400 --> 00:59:16.260
So they should actually work.

00:59:16.260 --> 00:59:20.220
And they'll show you how to use things like Flask Blueprints with Flaskask.

00:59:20.940 --> 00:59:26.160
They basically recreate some of the traditional Alexa skill kit demo applications as well.

00:59:26.160 --> 00:59:27.100
Well, it sounds really fun.

00:59:27.100 --> 00:59:31.360
And I'm definitely looking forward to building something that I can talk to Alexa about.

00:59:31.360 --> 00:59:32.480
I'm just not sure what yet.

00:59:32.480 --> 00:59:34.260
Thanks for being on the show, everyone.

00:59:34.260 --> 00:59:34.540
Awesome.

00:59:34.540 --> 00:59:35.020
Thank you.

00:59:35.020 --> 00:59:35.440
Thank you.

00:59:35.440 --> 00:59:36.020
Yeah, thank you.

00:59:36.020 --> 00:59:36.260
Yep.

00:59:36.260 --> 00:59:36.560
Bye.

00:59:37.600 --> 00:59:40.360
This has been another episode of Talk Python To Me.

00:59:40.360 --> 00:59:44.580
Today's guests were Eric Cho, Dave Botella, and Cam Sweeney.

00:59:44.580 --> 00:59:49.320
And this episode has been brought to you by Datadog and us at Talk Python Training.

00:59:49.320 --> 00:59:53.960
Datadog gives you visibility into the whole system running your code.

00:59:53.960 --> 00:59:58.300
Visit talkpython.fm/datadog and see what you've been missing.

00:59:58.300 --> 01:00:00.480
Don't even throw in a free t-shirt for doing the tutorial.

01:00:01.260 --> 01:00:03.220
Are you or a colleague trying to learn Python?

01:00:03.220 --> 01:00:07.900
Have you tried books and videos that just left you bored by covering topics point by point?

01:00:07.900 --> 01:00:13.900
Well, check out my online course, Python Jumpstart, by building 10 apps at talkpython.fm/course

01:00:13.900 --> 01:00:16.520
to experience a more engaging way to learn Python.

01:00:16.520 --> 01:00:21.300
And if you're looking for something a little more advanced, try my Write Pythonic Code course

01:00:21.300 --> 01:00:23.840
at talkpython.fm/pythonic.

01:00:23.840 --> 01:00:26.560
Be sure to subscribe to the show.

01:00:26.560 --> 01:00:28.760
Open your favorite podcatcher and search for Python.

01:00:28.760 --> 01:00:30.000
We should be right at the top.

01:00:30.000 --> 01:00:35.800
You can also find the iTunes feed at /itunes, Google Play feed at /play, and

01:00:35.800 --> 01:00:39.340
direct RSS feed at /rss on talkpython.fm.

01:00:39.340 --> 01:00:41.200
This is your host, Michael Kennedy.

01:00:41.200 --> 01:00:42.560
Thanks so much for listening.

01:00:42.560 --> 01:00:43.640
I really appreciate it.

01:00:43.640 --> 01:00:45.560
Now get out there and write some Python code.

01:00:45.560 --> 01:01:05.300
I'll see you next time.

01:01:05.300 --> 01:01:06.080
Thank you.

