Learn Python with Talk Python's 270 hours of courses

#146: Building Alexa Skills with Python and Flask Transcript

Recorded on Wednesday, Dec 20, 2017.

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

00:05 Two of the more notable ones are Amazon Echo devices and Google Home devices.

00:09 Wouldn't it be great if we could program these with Python?

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

00:16 This week you'll meet Eric Cho, Dave Botella, and Cam Sweeney, who discuss their frameworks and apps they built around Amazon and Google devices.

00:24 This is Talk Python to Me, episode 146, recorded December 20th, 2017.

00:30 Welcome to Talk Python to Me, a weekly podcast on Python, the language, the libraries, the ecosystem, and the personalities.

00:50 This is your host, Michael Kennedy.

00:53 Follow me on Twitter where I'm @mkennedy.

00:55 Keep up with the show and listen to past episodes at talkpython.fm.

00:58 And follow the show on Twitter via at Talk Python.

01:01 This episode is brought to you by Datadog and us here at Talk Python Training.

01:06 Be sure to check out what we're offering during the segments.

01:08 It really helps support the show.

01:10 Hey, everyone.

01:12 Quick bit of news before we get started on the episode.

01:15 First, it's 2018, and we have announced some of our 2018 courses over at training.talkpython.fm.

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

01:28 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,

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

01:41 So be sure to check that out.

01:43 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.

01:49 So now you can pay just one price and own every course at Talk Python Training forever.

01:55 It's way better than a subscription and about the same price.

01:58 Be sure to check both of these out over at training.talkpython.fm.

02:02 Thanks for checking out the courses.

02:03 Now let's get to the interview.

02:05 Eric Dave Kam, welcome to Talk Python.

02:08 Hey, good to be here.

02:09 Thanks.

02:09 Yeah, thanks for having me.

02:10 Yeah, I'm really looking forward to talking about talking to computers.

02:14 It's going to be a good time.

02:15 For sure.

02:16 Yeah.

02:17 So we're going to talk about Alexa.

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

02:26 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,

02:36 that's not going to work for this one.

02:38 It's just not.

02:39 So put yourself on mute.

02:40 Just fair warning there.

02:42 So let's start at the beginning.

02:43 I guess we'll start with you, Eric.

02:45 How did you get into programming in Python?

02:46 Thanks for having me.

02:48 And how did I get into programming?

02:50 So you know how there are people who knew they wanted to be a programmer since they were age seven?

02:55 I'm definitely not one of those.

02:56 I'm a super late bloomer.

02:58 I think I remember not long ago I was on your show talking about getting your first gig as a software developer.

03:04 So that's kind of the timeline.

03:07 Yeah, that was episode 39.

03:09 That's like almost two years ago.

03:11 But yeah, that's awesome.

03:12 Yeah, almost two years ago.

03:13 And so I used to use...

03:14 So I've been a network engineer for most of my adult working life.

03:18 And I used Python to solve network engineering problems.

03:22 And I just kind of never looked back.

03:24 Okay, awesome.

03:25 Yeah.

03:25 And networking is increasingly becoming a programming job itself, isn't it?

03:29 Absolutely.

03:30 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.

03:38 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.

03:45 Yeah, absolutely.

03:46 Dave, how about you?

03:47 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.

03:57 Coming to Python, I honestly can't quite remember when I got started.

04:01 I think it might have been towards the end of high school, maybe sometime early in college.

04:06 I do vividly remember I kind of made a personal choice not to learn Perl and instead picked up Python.

04:12 So sometime around then.

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

04:19 Yeah, most likely.

04:20 Yeah.

04:22 And Cam, how about yourself?

04:24 I'm kind of like Eric.

04:25 I didn't really get into programming until later in life.

04:29 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.

04:45 So yeah, it's only been a few years.

04:46 I remember listening to that show with Eric on about getting your first job and that's actually really helpful.

04:52 No, that's really awesome.

04:53 Yeah.

04:54 What a crazy way to circle back, right?

04:57 Yeah, seriously.

04:57 Small world.

04:58 And now you're on this podcast with Eric.

05:01 Yeah.

05:01 Yay!

05:02 It's nuts.

05:03 Yeah, it totally is.

05:05 And so do you still do any biology or are you just doing programming these days?

05:09 Yeah, I'm just doing biology or programming.

05:13 Never even stepped foot into a lab after school.

05:18 You know what?

05:19 There's a place better for creating stuff out of bits.

05:22 Let's do that.

05:23 Yeah, definitely.

05:24 All right.

05:24 So maybe let's go with you, Kim, since we're just talking about it.

05:28 What do you do day to day these days?

05:30 Yeah.

05:30 So currently I'm freelancing and doing contract work for this company called Produvia.

05:35 It's basically using AI and chat services for just different industries.

05:42 Currently we're working on something for the hotel industry and things.

05:46 That's cool.

05:47 Is it voice assistant stuff or is it more like chatbots, like a Facebook messenger type thing?

05:52 Yeah.

05:52 So it's just been more messenger, like Slack based and like web app based.

05:57 But we're planning on moving into the voice space pretty soon.

06:00 So that's pretty exciting.

06:01 It's definitely an exciting time for that.

06:03 Dave, how about you?

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

06:13 So definitely not.

06:16 Search all the things inside of your company.

06:18 Yeah.

06:18 Not as marketable as like AI and actual chat stuff.

06:22 Yeah, but that's an important thing.

06:23 Like these companies are huge and stuff gets crammed into SharePoints that people don't know about and Excel and access.

06:30 And it's insane, right?

06:32 The back end, like real world, as I kind of call it, it's predominantly Excel.

06:35 I mean, that's the reality.

06:37 So that's where I spend most of my time, mostly in the realm of Java.

06:42 But when I get a chance to choose, I usually choose Python for some projects.

06:45 So I've got most of my experience is sort of Java and Python.

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

06:56 Okay.

06:56 And you said you contribute to this thing called JPY.

06:59 What's the story of that?

07:01 JPY, yeah.

07:03 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.

07:12 And this format had been around for a long time.

07:16 Needless to say, somebody had reverse engineered it already, which was great.

07:19 And published their findings.

07:21 And it was really wrangling bits and bytes, dealing with pages of data inside this file format.

07:27 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.

07:33 And then I just needed to find a way to stick that inside this Java app.

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

07:47 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.

07:57 And they wanted to use Python, like a lot of folks in the scientific community.

08:01 Right.

08:02 So I was able to take that and figure out a way to plug it in and solve some problems along the way.

08:07 That's pretty cool.

08:07 The only way that I knew about, I was aware of to do that before was with Jython.

08:12 And so is it kind of like Jython?

08:13 So it doesn't run on the JVM.

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

08:23 And you can do it bidirectionally.

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

08:36 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.

08:45 Right.

08:46 That would be Steve Dower.

08:47 Thank you, Steve.

08:48 Yes.

08:48 Yeah.

08:48 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.

08:57 And it's funny that it works great on Windows, yet most of the time it's a headache on Linux.

09:01 I just don't get it.

09:02 Yeah.

09:03 How funny.

09:04 That's kind of the opposite.

09:05 All right, Eric.

09:06 You're doing network stuff, right?

09:08 Like you said, just a little bit ago.

09:09 Yeah.

09:09 So mostly networking stuff.

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

09:18 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.

09:30 Oh, that's really cool.

09:31 Yeah.

09:31 Yeah.

09:31 Yeah.

09:31 Yeah.

09:31 The whole computer security stuff around just both sides.

09:35 The white hat, black hat, whole thing is really Python heavy.

09:39 So that's pretty cool.

09:40 Yeah, absolutely.

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

09:47 So we choose to be very focused on solving this DDoS space well.

09:52 And, you know, people talk about 10x better, and that's why we shoot for it, right?

09:56 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.

10:06 So that's why we shoot for it.

10:08 Yeah.

10:08 Sounds like a fun project.

10:09 All right.

10:10 So let's start out by talking about these voice assistants in general.

10:13 We're going to focus on Alexa.

10:14 They've got a really good developer story.

10:16 They've got a really good Python developer story.

10:18 And you guys have all either created some skills or worked on frameworks for creating skills.

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

10:32 We've got Alexa.

10:33 We've got Google Voice and so on.

10:35 There's Alexa Google Assistant.

10:37 Can't remember exactly what they're calling it.

10:39 Anyone can jog my memory here.

10:40 I'm more well-versed in the Amazon ecosystem or ecosystem, if you will.

10:46 Would you guys count Apple's Siri or Microsoft's Cortana in this space?

10:51 Have they opened those up with APIs and SDKs?

10:54 I actually don't know.

10:56 You know, they have so many.

10:57 Apple's so weird.

10:58 They have like NDAs for developers and stuff, right?

11:01 I haven't been paying attention for Apple.

11:03 And I also haven't been paying attention to Cortana.

11:07 Yeah.

11:07 So I don't know.

11:08 Yeah.

11:08 I would say that's probably a no last time I checked, but it was a few months ago.

11:13 For Siri and Cortana, definitely not.

11:16 But for Google, yes.

11:18 But they don't really promote it.

11:19 So it wasn't until I actually got a physical Google, I guess, mini, then I started looking at it.

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

11:32 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.

11:39 Yeah, that's interesting.

11:41 I mean, on one level or another, all of those companies have been pretty good towards developers.

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

11:53 You can, you know, leverage their Lambda computing to implement your Alexa skill, for example, and things like that.

12:01 Yeah, so pretty interesting.

12:02 Yeah, totally.

12:03 And also, I think they're actively going out.

12:05 So you don't see as much, say, meetup groups or trainings.

12:10 And I know they actually contracted Bignor Ranch to do Alexa trainings to bring people up to speed.

12:16 And you see, you know, a lot of Twitter feeds from their evangelists.

12:19 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.

12:28 And then you funnel it down to the people who actually were public skills.

12:32 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.

12:40 Yeah.

12:41 Kim, what do you think?

12:42 Yeah, definitely.

12:43 Google, they have it open.

12:45 And it's actually, it's gotten a lot easier to develop for the Google Assistant.

12:49 But like Eric was saying, they don't really advertise out anything.

12:53 Whereas, you know, Alexa is like, they're just like reaching out for like anyone to develop.

12:59 Like they're really pushing it as something anyone can get into, which is really cool.

13:04 And then, yeah, Siri, I don't, I'm pretty sure they don't really even have that open or anything.

13:10 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.

13:17 And I feel like they kind of maybe dropped the ball with that.

13:20 I totally agree.

13:21 There's no way they can't have some sort of programming API though, right?

13:25 Since they're going to have their HomePod thing.

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

13:34 So, you know, that's also, I guess, a thing.

13:37 But they don't, their devices aren't really out yet.

13:40 Although there's some interesting places, I guess it shows up.

13:42 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.

13:55 Right.

13:55 So that's kind of cool.

13:56 Yeah, they definitely are trying to integrate that into Azure and all their cloud stuff.

13:59 So let's maybe just go down the list of the hardware that's available.

14:05 So, you know, by way of contrast, like for Apple, I guess you have your phone.

14:10 You guess you have your Mac if you turn that on and you have this HomePod thing.

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

14:19 There's the Echo, which is like this tall speaker thing.

14:23 There's Echo Plus, which is the same speaker, but is also a smart home hub.

14:28 There's Echo Show, which is like a touchscreen video type of version.

14:33 There's the Kinect, which will turn it into a landline.

14:37 There's the Echo Spot, which will let you make video calls and stuff.

14:42 That one's kind of cool.

14:43 It's got a little screen on it.

14:45 There's the Dot.

14:46 That's like the little mini one.

14:47 There's the Tap, the Look, the Fire TV.

14:51 And they actually are integrating them into cars as well, which is pretty cool.

14:54 So Ford Sync is coming out with Alexa integration.

14:59 So you can say, ask it for driving directions and playing music and stuff like that, which is cool.

15:05 And BMW and Mini are also integrating it as well for the 2018 models.

15:10 So that's just some of the devices that these skills run on, right?

15:15 I would also add to that.

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

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

15:31 Yeah.

15:32 And then Show is kind of expensive.

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

15:40 There's a bunch of YouTube videos showing people how they fit like the Dot directly into the cup holder.

15:46 And that's kind of cute and neat.

15:47 And I know a bunch of my friends have done that.

15:49 That is really cool.

15:50 I've actually done that too.

15:53 I would do that if it wouldn't freak out my wife.

15:55 She doesn't like it around so much.

15:57 She's not...

15:57 We'll talk about the thing, constant listening, right?

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

16:04 It could just put it in one of those little cup holders.

16:06 It'd be awesome.

16:06 But no, it doesn't go in the car in my house, I'm afraid.

16:10 I guess we should make the distinction between Alexa and all those pieces of hardware I talked about.

16:17 So there's all this hardware, and then there's Alexa.

16:19 Dave, do you want to maybe talk about the two?

16:22 I mean, the hardware is really just the gateway to interact with the Alexa service.

16:26 And the primary kind of concept is this idea of an utterance or a user's intent.

16:35 So what is the user intending to try to do when they talk to the device?

16:39 I believe Amazon splits the technology up into at least two or three different services now in the back end.

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

16:53 So it's kind of like the front end and back end of the Alexa service.

16:57 But to the consumers, they really interact with just sort of the combination of all of that.

17:02 Right.

17:03 And can you take the Alexa AI piece, the software piece, and put it on your device?

17:09 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.

17:15 It's like, you know, whatever.

17:16 Something stupid.

17:17 Could I get that and plug it in?

17:18 Yeah.

17:19 A couple of folks have done some interesting projects like that.

17:21 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.

17:34 And it was both exciting and creepy at the same time.

17:37 That's exactly how I imagined it would be.

17:39 There's still some videos on YouTube.

17:41 You can even use it piecemeal.

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

17:48 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.

17:57 That sounds pretty cool.

17:58 It's definitely some really neat services that they have.

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

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

18:14 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.

18:27 So let me just run down the list.

18:28 So there's over 20,000 Alexa skills now, which is pretty awesome.

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

18:39 So you can have them for finance.

18:41 You can ask what your credit card balance is.

18:44 You can ask what the stock price is.

18:45 You've got if this, then that integration.

18:47 So if I get an email from this person that says this, put it on, edit them.

18:52 You can speak to it about all the if this, then that.

18:55 You basically integrate with that.

18:57 It integrates with like electric cars.

18:59 So I have a charge point charger from my car and I can ask it.

19:03 You've got to direct it towards the skill.

19:05 Right.

19:05 So you say like ask charge point how many miles were added last time when I charged or something like that.

19:10 So that's really cool.

19:11 Got smart home drinks.

19:13 You could ask it for like what cocktail you should have and how to make it.

19:16 Flash briefing, travel.

19:18 Like you could ask it where you could go for $400 or Lyft, all sorts of stuff.

19:22 Right.

19:22 Maybe go around each one of you.

19:25 Like what's your favorite skill?

19:27 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.

19:35 But I've mainly just created like little personal ones for my own use.

19:40 Back before I found out about this project called Home Assistant, which basically connects different smart appliances.

19:48 I use Alexa to like control some lights and stuff.

19:51 And then for my old job, I would just ask Alexa to trigger like some scripts to run my computer like nightly.

19:58 Alexa, is my server up?

20:00 Alexa, am I still employed?

20:05 Exactly.

20:06 Yeah.

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

20:13 And that was pretty fun.

20:15 Yeah.

20:16 I really like how Alexa allows you to stream audio, like good sized audio streams.

20:21 That makes it really cool.

20:22 Yeah.

20:22 I do a lot of listening to music on my Alexa.

20:24 It's cool.

20:25 Yeah.

20:25 Yeah, definitely.

20:26 How about your...

20:26 Yeah.

20:27 My favorite skill is my skill.

20:29 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.

20:39 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.

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

20:58 And of course, you know, this was also inspired by Mandy Chen.

21:02 So she was one of the earlier developers slash evangelist.

21:05 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.

21:11 That's pretty exciting.

21:12 Very cool.

21:13 Dave?

21:13 It's a toss up.

21:14 So, you know, there's your favorite is usually the one you have published if you've got one published.

21:18 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.

21:31 Yeah, that's cool.

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

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

21:42 It's quite awesome.

21:43 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.

21:51 Then you also had another one that got banned, right?

21:53 Yeah.

21:54 Like you were a rebel.

21:56 So this was when I first got my dot, it was almost a year ago.

21:59 It was about, I think it was Christmas last year.

22:01 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.

22:16 So you could ask Alexa, you know, what's, you know, either his latest tweet or to ask Alexa to read a random one.

22:23 And it was almost always comical.

22:24 But after submitting it...

22:27 They wouldn't put it up there, huh?

22:28 No.

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

22:34 They were offering a free Amazon hoodie or something like that.

22:38 If you got a skill published in the store before maybe January 10th or something like that.

22:44 And I submitted it and they rejected it because of copyright infringement, allegedly.

22:49 So I didn't know you could own your tweets, but that's sort of news to me.

22:56 My guess is they were just sort of afraid of the litigious Donald Trump at the time.

23:01 Yeah, it must be because that is the public thing.

23:04 And especially now, it's, you know, communication of the United States government in a sense.

23:09 So that, right, that's kind of in one sense, all ours, I guess.

23:14 I don't know.

23:14 It turned out I did some digging.

23:15 There were some already in the skill store.

23:18 They avoided using Trump's name.

23:20 So they said things like presidential tweets or something like that.

23:23 This portion of Talk Python to Me was brought to you by Datadog.

23:27 Datadog is a monitoring solution that provides deep visibility into your Python apps.

23:32 So you can understand why certain requests are slow or what caused a specific error.

23:36 Datadog's open source tracing client auto instruments popular libraries like Flask and Redis,

23:41 as well as async libraries like async.io.

23:44 So you can get started without making any code changes.

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

23:53 Start a free trial to see for yourself.

23:55 As a bonus, Datadog will send you a free t-shirt.

23:58 Just visit talkpython.fm/Datadog for more details.

24:03 The certification process and all that is kind of evolving, just like everybody.

24:09 You know, they're kind of evolving as we go.

24:12 So if you put the name unofficial or like fan or fans of or whatever, then you get, not to guarantee it,

24:21 but you know, you get, you have an easier time getting it approved if it was, you know, something of that nature.

24:26 Okay.

24:26 Yeah.

24:26 That's good advice.

24:27 The president of the United States is not a matter, but yeah.

24:30 But just like normal companies, like fan of Disney of, you know, whatever it is.

24:35 So something like that.

24:36 Cool.

24:36 All right.

24:37 Well, let's talk about how you build these things.

24:38 So obviously Python is a good way to do it, which is pretty awesome.

24:43 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?

24:52 The answer is no.

24:53 It's like developing for Android apps.

24:55 You could use the simulator.

24:56 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.

25:04 And of course the hardware is getting cheaper and cheaper and so on.

25:07 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.

25:18 So I don't know if you do podcasts and so on.

25:21 And another tool is your Revert mobile app that you could download and then behave just like Alexa.

25:26 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?

25:34 Yeah, absolutely.

25:34 So it's like, you know, it's both Android and iOS as far as I know.

25:38 And so when you launch it, it just has this big dot, right?

25:41 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.

25:49 And you link it to your Amazon account, of course.

25:51 Cool.

25:52 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.

26:00 Have any of you guys used Ngrok for this?

26:02 Yeah.

26:03 Ngrok is a great tool.

26:05 Tell people what it is.

26:05 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.

26:18 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.

26:31 And then you get this temporary Ngrok.io URL.

26:37 And that's basically just the public URL that you get for free.

26:41 Yeah, that's really cool.

26:42 Because one of the reasons you need that is you basically have two choices when you set up an Alexa skill.

26:47 There's as you go through the Amazon dashboard.

26:50 And one of them is where do we invoke this, the logic of your skill?

26:55 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.

27:06 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.

27:18 And then you can use Ngrok to map that localhost only port out to Ngrok.com, IO, whatever it is.

27:25 And then that becomes a public HTTPS URL that you can tell Amazon is how to get to it.

27:30 And it actually hits your dev server.

27:31 I guess you could even like have breakpoints and all sorts of crazy stuff when you talk to Alexa, right?

27:35 I think for Ngrok, the free version, because I actually look into Ngrok for not for Alexa skills, but for my day job.

27:41 So I think for the free version, you could have your familiar ports when you launch.

27:46 And if you pay, I think, $10 a month, you get two reserved ports.

27:50 And you could even use custom domains for you to fix them when you launched Ngrok.

27:55 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.

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

28:09 Okay, that makes a lot of sense.

28:11 All right.

28:12 So I guess, Eric, I'll stick with you for a sec.

28:14 What do you use when you're writing these skills?

28:17 Like what's the tech stack look like?

28:18 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.

28:29 There's no other way than to just using their templates, using the ask Alexa skill kit.

28:35 And then like you mentioned, I use the triggering for Alexa as the input to trigger my Lambda function.

28:41 And then Lambda function, if I need a database, I use DynamoDB.

28:44 And that's kind of the whole flow.

28:46 Yeah, that's pretty cool.

28:47 And DynamoDB is a really interesting NoSQL as a service inside AWS, which is cool.

28:52 Yeah, super fast.

28:53 Yeah, it's crazy fast.

28:54 That's cool.

28:55 Cam, how about you?

28:56 Yeah, so I don't use Lambda or AWS or anything.

29:01 I just typically, since I haven't published, it's usually just through NCROC.

29:05 But I write all the code using Flaskask.

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

29:15 So it's kind of just two steps.

29:17 Yeah, that's nice and easy.

29:18 Yeah.

29:19 We'll definitely, we'll talk more about Flaskask in just a second.

29:22 Dave, how about yourself?

29:23 Yeah, it's Flaskask in Heroku.

29:25 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.

29:39 I can imagine like how much traffic could Alexa possibly generate?

29:42 That's sort of the good thing is that it's very kind of quick in the interactions.

29:46 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.

29:57 So you don't have to worry about it.

29:58 You don't have to flow it.

29:59 Yeah.

29:59 You don't have to pass that through.

30:00 Yeah, that makes it really nice.

30:02 Yeah.

30:02 So your Heroku instance or something else could spin down for a while.

30:05 That stream could play for a half hour.

30:07 The user might then pause it or stop it.

30:09 And then you'll get the call to your server from Amazon saying that the user stopped the stream.

30:15 Yeah.

30:15 So it seems like a lot of stateless, really quick, short type of things.

30:18 Yep, definitely.

30:19 And that's sort of the catch is the stateless part is that this is probably getting a little too far ahead.

30:23 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.

30:31 Right.

30:31 And that might be why you might want a database, for example, like Eric was saying.

30:35 Right.

30:36 More or less push the session into the database.

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

30:44 Because it's not like normal web application development where you might have a cookie or a session or something.

30:49 And then all this middleware you can use, it'll automatically pick that up.

30:52 What do you use to trigger off of to identify the user?

30:55 Do you have their account, their device ID, something like that?

30:58 From my experience, there are a couple different things.

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

31:05 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.

31:14 So your session that you might be tracking with a session ID actually is no longer.

31:19 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.

31:30 So there's like a special, I believe, context ID.

31:33 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.

31:44 But for a while, there's even discrepancies in Amazon's only.

31:49 I don't believe so, unfortunately.

31:50 All my materials are online.

31:51 Okay.

31:52 We haven't been recording them.

31:53 But Amazon's documentation was also kind of incorrect.

31:56 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.

32:15 So you just have to hold on to that, and then you need to hold on to the stream ID.

32:19 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.

32:30 And then you use that later on in the conversation.

32:33 Amazon can hold that session-based information.

32:37 But once you start playing a stream, the session's gone.

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

32:49 So that way, when you get the stop or the pause or the skip, you know what it refers to.

32:53 Okay.

32:54 Yeah, that's cool.

32:54 It sounds challenging, but you can make it work.

32:57 It's one of the newer areas for playing streams.

32:59 So from day one, you always get the user ID and the session ID.

33:04 So the session ID obviously just, you know, as good as the session goes.

33:07 And the user ID is what, it's a string that associated with your Amazon account.

33:11 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.

33:19 So later on, I think you face a challenge.

33:22 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.

33:30 And if you do that, then you actually get past the device ID.

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

33:37 Right.

33:38 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?

33:45 Like, yeah.

33:45 You might want to differentiate between those.

33:47 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.

33:54 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.

34:01 But there are other times when you need to differentiate between devices because of device limitation.

34:06 You know, for example, you know, Echo Show will show you a little screen and while the Echo itself doesn't.

34:12 So there are different use cases for them.

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

34:20 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.

34:31 That's how I feel about it.

34:32 That's pretty cool.

34:33 So let's talk about what Dave and Cam have brought up, this thing called Flask Ask.

34:39 So Flask Ask is, is that the ASK, Alexa Skill Kit is what the ask stands for?

34:45 Right.

34:47 Okay, cool.

34:47 So Cam, tell us what Flask Ask is.

34:51 It's a Flask extension.

34:53 It's made by this guy, John Wheeler.

34:55 And it's a really cool Python package to get started with Alexa.

34:59 Basically, he created, he provides some decorators with Flask.

35:05 You know, you would route your view functions with at app.route.

35:09 You do the same thing, but it's with like ask.

35:12 And then you basically just write your code as if you're doing typical Flask web app.

35:19 You just have your view function.

35:20 And when you return your response, it provides special response classes to either ask or tell the user.

35:29 So you can like ask something and then expect a response back to that question.

35:34 Or you can just send a message to the user.

35:37 And it just makes it really simple to get going.

35:40 And I've seen that it's pretty cool.

35:42 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.

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

35:59 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.

36:09 And name basically the intents of your app, which is pretty cool.

36:14 So it seems like it's really, really approachable.

36:17 Dave, what would you add to it?

36:18 It adds templating as well for the dialogues and the interactions with the user.

36:23 I know what templating looks like in the website.

36:25 Like that's the HTML.

36:27 But what does that mean in the context of a voice assistant?

36:31 It's extremely similar.

36:32 So you can define your basically the spoken portion of Alexa when she talks back to you.

36:39 She or it or whatever you want to call it.

36:40 And you can also use different pluggable variables as well.

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

36:51 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.

37:01 You can do the same thing with the spoken responses back.

37:04 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,

37:14 is that it also deals with wrangling all the nasty JSON that you need to send back to Alexa.

37:20 Yeah, that's pretty awesome that you can kind of forget about that.

37:23 Yeah, you can take Flask ask.

37:24 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.

37:32 But you don't need to know the JSON format, which is pretty lengthy.

37:36 The templating and the stuff for the responses, what's also cool is it also allows for SSML.

37:42 So you can kind of give like the actual voice response some more kind of customization.

37:51 Yeah, like the inflections, the way you can kind of tailor how things are pronounced.

37:55 So it's not as robotic.

37:57 Yeah, that's cool.

37:58 So you can make it sound like it's a question like go to the store versus go to the store.

38:03 Yeah, I think some of that Amazon does pretty well by default.

38:06 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.

38:17 I can imagine.

38:17 A good thing for SSML is besides, you know, like you want to change the default behavior.

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

38:26 That's where you invoke your SSML.

38:29 They also have a bunch of what they call the speechlets.

38:32 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.

38:42 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.

38:52 And that's exactly what you use SSML for.

38:54 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.

39:02 And then you could start having interactions that way without worrying.

39:06 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.

39:17 For voice, you don't have the luxury of visual.

39:20 So you always have to short, concise, and fast.

39:23 So that's kind of cool that they have these, you know, I would say about 30 speechlets.

39:28 And of course, they're adding in more every day.

39:30 That sounds really cool.

39:31 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?

39:42 You walk into the room and you see this.

39:43 What do you want to do?

39:44 Like all those types of games like Leisure Shoot Larry or The Muds or whatever.

39:49 You could probably have a really awesome little skill that is like that game, right?

39:53 That is exactly the example they give.

39:55 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.

40:05 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.

40:17 They don't have a lot of patience and they don't have a lot of white vocabularies.

40:21 So they use that as an example.

40:23 So, you know, you open up a box and do you either take a look at it or you close it right away?

40:28 And then you wait for the kids to respond and then you'll go from there.

40:32 So you have all these, you know, interactions that, like you said, the gaming aspect of it.

40:36 That sounds pretty fun.

40:38 You know, with this Flask ask thing, it makes it so much sense, like where ngrok fits in.

40:43 So basically you write your code as a Flask application, which, you know, you can run.

40:50 It's going to run on localhost on port 5000.

40:52 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?

41:02 Right.

41:04 You can do some local testing because it is a Flask application.

41:08 I see.

41:08 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?

41:16 Exactly.

41:16 And you can do it programmatically in your unit tests and you can always look at the response that comes back.

41:21 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.

41:30 Cool. Is there a way to make like personal skills that your Alexa has that are not public?

41:36 It's like associated with your Amazon account.

41:38 Like, I think it's in development or something.

41:42 That's what the skill is marked as.

41:43 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?

41:52 I don't think there's a limit because I definitely have some old ones lingering that I haven't cleared out.

41:57 Until Lambda starts to charge money, I would just keep all of my skills.

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

42:05 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.

42:15 So you have their Amazon, I think you either you get their email address associated with their Amazon account.

42:20 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.

42:28 So that way I could share that skill without having to publish it in the marketplace.

42:31 That's pretty cool.

42:32 I can just imagine you might want to automate some stuff for you, but it's too specific.

42:37 Yeah.

42:38 Once my grandma started turning on my living room lights, I would just like cut her off.

42:41 Right.

42:41 That's right.

42:45 Like if my robot lawnmower finishes and then goes in the garage, first open the garage.

42:51 And when it's in the garage, close the garage and then turn on the sprinklers.

42:54 Like that's probably not a skill everyone wants, but that'd be really cool to say.

42:57 Go mow the yard and then water it.

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

43:05 So they could actually call you like a Skype call with video without you knowing.

43:10 I think you could, it has to be opt-in.

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

43:16 And which is just super creepy.

43:17 I mean, it's almost up there as Amazon keys, but you know, that's another story.

43:21 Another day.

43:21 Yeah.

43:23 The Amazon keys, where you basically give Amazon a key for the delivery people.

43:28 Interesting.

43:29 Two, third-party contractors for Amazon as well.

43:32 That's right.

43:33 Not even Amazon.

43:33 Yeah, exactly.

43:34 But anyways.

43:35 Quite interesting.

43:36 Yeah.

43:37 That's a whole nother level.

43:38 So Dave and Cam, you guys both contributed various things.

43:44 Cam, let's start with you.

43:45 What do you do for Flask Ask?

43:47 Yeah.

43:47 So Flask was like my first real step into the open source world.

43:52 I started by just going through the code base and trying to document everything.

43:57 Or like the doc strings and everything.

43:59 And that kind of just gave me a really good understanding of how the whole thing worked.

44:03 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.

44:16 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.

44:32 So that you just say return audio and then whatever.

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

44:45 Yeah, cool.

44:46 And Dave, how about you?

44:47 I basically built off of a lot of the groundwork that Cam had laid.

44:50 So I had, I found Flask Ask when I first started doing skill development.

44:55 And I used it as the basis for the streaming skill for Vermont Public Radio.

44:59 And everything was working great.

45:02 And we went and pushed out kind of a testable version into Heroku.

45:06 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.

45:14 After some debugging, I found out that it was because with running it in Gunicorn.

45:19 I never know how to pronounce it.

45:21 It had multiple sort of workers.

45:25 And one worker would retreat or respond to a request from Amazon.

45:30 And then the other one would.

45:31 And they didn't have any sort of shared state.

45:35 They were just using kind of thread local storage.

45:37 I think that's basically what the default behavior was at the time.

45:40 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.

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

45:54 And conveniently, there was a caching layer already there.

45:57 So it was a matter of just kind of bringing that up into the Flask ask world, making it simpler.

46:01 Yeah, that's cool.

46:02 Using the simple cache, I think, is the actual name.

46:04 So it's as simple as that, where it'll do it in memory.

46:06 And that solved the streaming problem.

46:09 Let's say push across the different request threads, right?

46:12 Right.

46:12 Because you can never guarantee who's going to respond to it.

46:14 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.

46:22 It also just happens to be an Alexa skill endpoint.

46:26 You might not even know which server responds to it.

46:28 Interesting.

46:29 So something that's similar to this that you created, Cam, is called Flask Assistant.

46:34 All right.

46:35 Tell people quickly about that.

46:36 Yeah, it's basically just the Flask ask for Google Assistant.

46:41 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.

46:54 And what that is, is basically a NLP, a natural language processing platform owned by Google.

47:03 And so it's pretty analogous to Flask ask.

47:06 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.

47:24 Do they have to run in different processes?

47:25 Or could I host both a Flask Assistant and Flask ask app in the same code on the same server?

47:31 I actually haven't tried that, but it should be possible just by basically stacking decorators.

47:36 And then one cool thing about Dialogflow is that Alexa is actually one of the integrations.

47:42 So if you were to do it that way, you could basically export your project into the Alexa Skills Kit.

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

47:52 Right.

47:52 Yeah.

47:53 Yeah.

47:53 And maybe you just run two processes on two different ports or whatever.

47:56 But yeah, it's still pretty cool.

47:57 Yeah.

47:58 It's been fun working on that.

47:59 We're getting sort of near the end of our time together.

48:02 Let's talk about maybe a few higher level questions.

48:06 First, maybe Eric, you can go with this one first.

48:09 How do you make money as an Alexa developer?

48:12 So if I was working on an iPhone app, an iPhone game, I know how I make money there.

48:17 Or Android, just not as much per user.

48:20 But still, you put it in the store, people buy it.

48:22 You don't buy these skills.

48:24 You just tell Alexa to install them or you go to your phone and install them, right?

48:26 Yeah, that was my question from day one.

48:28 It's like, how do you make money from it?

48:30 And so they recently announced an in-app purchase.

48:33 So essentially, you could make purchase just very much like what you do in an iPhone app.

48:38 But I haven't...

48:39 Because it's so new, I don't know the details on that.

48:42 But currently, you have two ways to make money.

48:45 Well, three ways, I guess.

48:46 So one is you could get Alexa credits, AWS credits if your Alexa skill invoke charges.

48:53 But since I tie my end to Lambda, and currently the first million calls per month in Lambda is free.

48:59 So basically, it's $100 per month and it's month-to-month basis.

49:03 So I basically just use that to fund my other AWS usage.

49:07 So that's pretty cool.

49:08 And the second way that you can make money is you could be a top skill.

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

49:19 But I don't know what the selection criteria is.

49:22 So I can't say for sure like how to do it or how not to do it, what gets you there.

49:27 But that's certainly another way that they've announced and you can make money from it.

49:32 And the third way is basically just use Alexa as a front end for your voice user interface.

49:38 And you tie that into external account.

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

49:46 I'm sure in this case they don't, but for Vermont, public radio.

49:50 But like say Uber, for example, right?

49:52 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.

49:59 And tie into your account.

50:01 And then that you make money that would increase your usage.

50:04 That's a third way.

50:04 Right.

50:05 It's just a funnel, right?

50:06 To an existing business model.

50:08 Yeah.

50:08 Exactly.

50:08 And I don't know.

50:09 I don't think there's any studies.

50:11 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.

50:22 But I haven't seen any studies like that.

50:24 So I can't say for sure.

50:25 But the third way seems to be most common for business today outside of just hobbyists or some other companies.

50:32 Yeah.

50:32 Right.

50:32 I mean, Dave, that sounds more like what you're doing.

50:34 I know public radio doesn't necessarily directly make money, but increasing listenership is a key goal, right?

50:40 Right.

50:40 There's sort of two sides to this.

50:42 One is being able to engage.

50:44 In this case, since it's Vermont Public Radio, it's engaging listeners and building awareness and also helping drive contributions during fundraisers.

50:54 So obviously having the ability, you're using the stream.

50:57 So you're delivering your product.

50:58 In this case, they're live content and they're episodic content.

51:03 And in doing so, they also have the ability to advertise and promote their own offerings.

51:07 So that's sort of one approach where it's sort of more of a marketing channel.

51:12 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.

51:24 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.

51:31 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.

51:42 That's pretty awesome.

51:43 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.

51:52 Are you sure, Michael?

51:53 I mean, that's a good question, right?

51:56 These things are generally always listening to us, but maybe they don't process everything we're listening.

52:02 Maybe they don't share everything we're listening.

52:03 But Cam, maybe you start first.

52:05 What are your thoughts on the privacy around always listening devices?

52:08 When you get one of these devices, you just got to be aware of that and personally be okay with it.

52:15 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.

52:26 And I know you can delete that.

52:29 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.

52:36 Yeah.

52:36 Eric, what do you think?

52:37 I think the answer is yes.

52:38 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.

52:49 But of course, you know, this is a big topic and it's been the news recently just because of the murder case.

52:54 I forgot which state it was in.

52:55 Basically, you know, you could go, we'll probably include it in the show notes or whatnot.

52:59 But so I actually went out and looked at the official response from Amazon regarding this.

53:04 You'd never know, like, how much do you trust Amazon, right?

53:07 Back to the Amazon key issue.

53:08 But the official word is that they do a one second buffering to detect your wake word.

53:15 And then they constantly delete that one second buffering.

53:17 So unless you hear one of the wake words in today's setting is one of the four, right?

53:24 You could choose to have Alexa, Amazon, computer or Echo as your wake word.

53:28 So they do that one second thing to do echo cancellation and they do to detect false positives.

53:34 But the wake word and then only if you speak the wake word, then you start recording and so on.

53:38 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.

53:46 Yeah.

53:46 And Dave, what do you think?

53:47 I've really got two sides to this.

53:48 One is I'm less concerned about what Amazon or somebody else is hearing.

53:52 But I do like to play around with it because I'll use funny voices.

53:55 Like even with Comcast, they now have like voice control and the remotes.

53:59 And I just try to see how good it can recognize the weirdest voice it can come up with.

54:03 And it's shockingly good.

54:05 And if they want to record that, feel free.

54:07 They can keep that on a server somewhere.

54:09 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.

54:18 Because, you know, you look at, you know, the smart home things, even just a smart home outlet.

54:24 That was like the big thing.

54:25 I know my family went out and bought last year when we all got Echo Dots.

54:29 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.

54:40 Yeah.

54:41 And that's what integrates with Amazon.

54:42 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.

54:53 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.

55:04 But it has to be a, I believe, a TLS based encrypted connection and it has to have the appropriate headers in the communication.

55:13 So it's hard to, you know, even get media to play in an unsecure way via the Echo devices.

55:20 Yeah, that's a good point.

55:22 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.

55:29 As somebody who deals with DDoS the whole time, right?

55:32 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.

55:41 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?

55:55 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?

56:23 Like, they can tell when you're home or, like, when you cook and all these things.

56:26 So it's something to be aware of.

56:28 Yeah.

56:28 How many people live in your house based on how many unique voices does it hear, for example?

56:32 But remember, it's, as they said, I think it was the NSA after the whole Edward Snowden thing.

56:38 It's just metadata.

56:39 What are they going to do with it?

56:41 That's right.

56:41 It's just metadata.

56:41 Come on.

56:42 Come on.

56:43 No problem.

56:44 I don't see how that could go.

56:45 Right.

56:45 All right.

56:47 Very cool.

56:47 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.

56:58 Yeah.

56:59 For me, at least it is.

57:00 Yeah.

57:00 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.

57:08 Yeah.

57:08 And I've got my Alexas in both the first and second floor here and use them daily.

57:12 They're really, really nice.

57:14 All right.

57:15 Well, I guess we're pretty much out of time, so I'll have to leave it there for the Alexa stuff.

57:19 But let's go down the two questions.

57:22 So Dave, we'll go with you first.

57:24 Favorite editor?

57:24 I can't make up my mind.

57:26 I either use Vim or Emacs, depending on the situation.

57:29 And my hands are in constant pain as a result.

57:32 Cam?

57:34 Sublime.

57:35 It's just so quick and nice.

57:37 And Eric, have I corrupted you?

57:39 Yes, you have.

57:39 So I used to use Vim, but then since I listened to Talk Python too much, and so I now use PyCharm exclusively.

57:45 I definitely love that.

57:46 All right.

57:48 And Eric, keep going with you.

57:49 How about a notable PyPI package?

57:51 Yeah.

57:51 So I like requests.

57:52 Of course, as half of the people here, I think that it should be in the standard library.

57:56 And if Ansible counts, then that's definitely what I would like as well.

58:01 The library slash packages.

58:02 Yeah, I think it does.

58:03 That's cool.

58:04 Ansible.

58:04 All right, Cam?

58:05 So aside from Flaskask and Flask Assistant, if anyone's interested in making their own

58:10 skills or anything, or just not even skills, but just programs to control things within their

58:16 house, I would check out Home Assistant.

58:17 It's a really cool project.

58:19 It's a very cool project.

58:19 It controls so many devices.

58:21 It's a really cool on-your-own-network website.

58:25 And yeah, I had the guys on on episode 122 a while back, so definitely cool.

58:30 Dave?

58:31 You can't beat requests.

58:34 I was going to say that.

58:35 Yeah, awesome.

58:35 Okay, so I agree.

58:37 Request is definitely the most popular one on the show and out in the world.

58:41 Final call to action.

58:42 People want to get started.

58:43 They want to get started with Alexa.

58:44 They want to get started with Flaskask, things like that.

58:47 What do they do?

58:48 Just jump in, you guys.

58:49 Yeah, I think they could just go.

58:50 There's a bunch of templates, pre-made templates and step-by-step guide.

58:54 Like I said, Amazon's very involved in reaching out to potential developers.

58:57 So you could easily get a lot of freebies that way if you publish your skill sets.

59:02 Go check out some of the tutorials for Flaskask and get started.

59:05 It's not too hard.

59:06 There's a bunch of sample projects, each one of them.

59:09 I did some work in making sure that they're sort of sanity checked with each version.

59:14 So they should actually work.

59:16 And they'll show you how to use things like Flask Blueprints with Flaskask.

59:20 They basically recreate some of the traditional Alexa skill kit demo applications as well.

59:26 Well, it sounds really fun.

59:27 And I'm definitely looking forward to building something that I can talk to Alexa about.

59:31 I'm just not sure what yet.

59:32 Thanks for being on the show, everyone.

59:34 Awesome.

59:34 Thank you.

59:35 Thank you.

59:35 Yeah, thank you.

59:36 Yep.

59:36 Bye.

59:37 This has been another episode of Talk Python to Me.

59:40 Today's guests were Eric Cho, Dave Botella, and Cam Sweeney.

59:44 And this episode has been brought to you by Datadog and us at Talk Python Training.

59:49 Datadog gives you visibility into the whole system running your code.

59:53 Visit talkpython.fm/datadog and see what you've been missing.

59:58 Don't even throw in a free t-shirt for doing the tutorial.

01:00:01 Are you or a colleague trying to learn Python?

01:00:03 Have you tried books and videos that just left you bored by covering topics point by point?

01:00:07 Well, check out my online course, Python Jumpstart, by building 10 apps at talkpython.fm/course

01:00:13 to experience a more engaging way to learn Python.

01:00:16 And if you're looking for something a little more advanced, try my Write Pythonic Code course

01:00:21 at talkpython.fm/pythonic.

01:00:23 Be sure to subscribe to the show.

01:00:26 Open your favorite podcatcher and search for Python.

01:00:28 We should be right at the top.

01:00:30 You can also find the iTunes feed at /itunes, Google Play feed at /play, and

01:00:35 direct RSS feed at /rss on talkpython.fm.

01:00:39 This is your host, Michael Kennedy.

01:00:41 Thanks so much for listening.

01:00:42 I really appreciate it.

01:00:43 Now get out there and write some Python code.

01:00:45 I'll see you next time.

01:01:05 Thank you.

Back to show page
Talk Python's Mastodon Michael Kennedy's Mastodon