Build An Audio AI App Transcripts
Chapter: Feature 4: Chat Q and A
Lecture: Actually Enabling Chat

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Well, there's a little bit of a missing detail here in our program.
0:06 And it says, ""To do, actually prepare the chat to be the episode to be chatted with.
0:14 Now, the last times we, two times we did this, that's a lot of code we did there.
0:19 And up here for the transcript one as well, like both of those examples were a lot. So let me copy that real quick. Come back down here.
0:30 Like I said at the opening, what do we actually need? We just need the transcript because we're going to come up with a cool prompt,
0:36 share the transcript, and then use that text to actually communicate and have a conversation around the audio, not anything else in particular.
0:46 All right, so watch this. This should be actually pretty straightforward. All we need to do is if there's no transcript, we need to make one.
0:54 Now, we could check. We could say, ""Go to the database. Give me the transcript. If the transcript exists, then we don't need to do it otherwise.
1:02 But I'm just going to say this, ""Return, await, worker transcribe episode, and what goes in there, those things. That looks pretty easy, right?
1:13 Let's see what this does. It comes in. Its first thing is to say, ""If the transcript already exists, don't do the work,"" right?
1:20 So we would theoretically put that first. I think the one thing I might want here, just so we kind of get a little sense
1:28 of what part of the app it's flowing through, is some logging. So logging equals print agent for us right now.
1:34 And we'll just say, ""Preparing episode for AI chat on this one, basically a little detail about what the heck that is.
1:46 You might have thought that was going to be a lot of work. Oh, no, it's not too much work.
1:50 Let's go and actually, though, see that this is doing its thing because previously we got, ""Hey, it looks like it works,
1:57 and then I refreshed it and it looked like, ""Oh, it went back. So notice there is no transcript on this one.
2:04 And I'll click ""Enable,"" ""Preparing chat,"" hang tight. Let's look over here. All right, so ""Preparing episode for AI chat,
2:12 well, it really means we're transcribing it and it's still running. Off it goes.
2:18 So in a second, the transcript will be done, hence it will be ready for AI chat. Hey, look at that.
2:24 It says I can start chatting, but let's just--let's not get too ahead of ourselves here. Let's refresh. Hey, almost. We're almost there.
2:35 Now we have our chat with episode. For some reason I messed that up and it's still here, but most importantly, know that the view transcript is here.
2:44 Okay, let's go and fix that one little dangling piece. This one previously had no condition on it, and I didn't bother to copy that over, did I?
2:58 So this is going to be not that. All right, so if there's no transcript URL, let's just refresh. Perfect.
3:10 So this one has a transcript, so we can chat with it. And let's just click around just to make sure that, you know, that's true. Here's another one.
3:17 This one also already has an AI summary, but more importantly, we can chat with it. Awesome. That was easy.
3:26 I mean, besides talking about it and catching that little omission there, two lines of code. Yay for code reuse.


Talk Python's Mastodon Michael Kennedy's Mastodon