- [Instructor] So that kind of was a walkthrough 2
of how to do this for one single episode. 3
But of course we want to process 4
lots and lots of podcast episodes 5
and it would be kind of annoying to, you know, 6
run through the code that I've showed you here 7
and just do this for each podcast episode one at a time. 8
So I have here some nice functions that are going to help us 9
to bulk process podcast episodes so that we can do this. 10
And then we can ask a question 11
that's a little bit more interesting 12
and a little bit more specific over all of the episodes 13
in the "DeepMind Podcast" feed. 14
So this first function here is called get_episodes, 15
and this essentially parses the RSS feed 16
that we looked at earlier. 17
So it's using that feedparser library. 18
There is a limit if you want to only extract a few, 19
just to test this out. 20
But of course, if you're doing this for a real example, 21
you'll want to process all of the podcasts in the RSS feed. 22
The next step is to download the audio for a single episode. 23
So it takes in basically the URL for a particular episode. 24
So we'll process one single episode 25
and then we have a function here 26
that is called transcribe audio. 27
So this is going to transcribe the audio. 28
And again, this looks very similar to what we did earlier, 29
that there is this prompt here 30
to the model saying transcribe this audio, 31
output only the transcription, et cetera. 32
And we're telling Gemini 3 Pro Preview 33
to take in this audio file and transcribe it. 34
The only difference here is I've got a little bit 35
of some error handling 36
and print statements over here, 37
which I didn't have earlier when I was just going through 38
the Colab cells. 39
But this will be useful if you're transcribing 40
a bunch of podcasts at once 41
to just have some messages in case something goes wrong. 42
The next function here is process_episode, 43
and this essentially combines the previous three functions. 44
So you can see that it takes in a single podcast episode, 45
it downloads the audio, it transcribes the audio, 46
and then it uploads the transcription 47
to our File Search store. 48
So if we call this function over every single episode 49
in that RSS feed, 50
we will essentially have a File Search store 51
with transcriptions of all of our podcast episodes 52
and we're ready to go 53
and we will be able to ask the model questions 54
about the information in those podcasts. 55
So one last function, 56
which was the one we're actually going to execute now, 57
and which will actually do something. 58
And this basically just calls that process_episode 59
across all of the episodes in the RSS URL. 60
So I'm going to execute this cell right now 61
so I have it just limited to 10 62
because this will take a bit of time. 63
I don't want to process everything, 64
but I'm also using a couple of workers 65
just to make this go faster. 66
So if we look at the output here, 67
you'll see that things are kind of going to happen 68
out of order. 69
You won't see, you know, a particular episode 70
that got processed and transcribed and uploaded. 71
You'll see things kind of happening sort of out of order. 72
But this is basically going to take the first 10 episodes 73
in the RSS feed and get them into our File Search store. 74
So this is going to take a bit of time. 75
I'm going to go ahead and actually just stop the execution 76
of this cell because I already have a file search store 77
that I prepared ahead of time, which has all 78
of the "Google DeepMind Podcast" episodes in it. 79
So, so we don't have to sit here 80
and watch this thing upload one at a time. 81
I just killed that cell and we can test out 82
the existing store that I had. 83
So my prompt here is about a particular episode 84
that I remember listening to. 85
I was in the car driving 86
and I was listening to the "Google DeepMind Podcast" 87
and I remembered that there was an episode where Four Flynn, 88
who is the VP of Security at Google DeepMind 89
that was telling the story about a fish tank. 90
It was something to do with a fish tank and security, 91
and I wanted to tell a friend later, 92
but I couldn't remember exactly what it is 93
that the story was or like what the details were. 94
So I have this prompt here about this episode 95
where Four was telling a story about a fish tank. 96
What was that about? 97
And so now we're going to call generate_content again. 98
Okay, so we did get the response back from the model. 99
You'll notice that it actually printed out this information 100
right here about uploading transcripts. 101
That is a little confusing. 102
It is not at all what was actually happening 103
in this generate_content call to the model. 104
This is actually the output of this cell over here, 105
which I interrupted. 106
So sometimes Colab does this 107
if you interrupt a long-running process 108
and you kind of stop the cell, 109
the output might still get uploaded right over here. 110
So don't worry too much if that happens. 111
You might not see it, you might see it, 112
but just don't worry about it. 113
Now that the cell is executed, 114
we can take a look at the response 115
and hopefully we will have information about the fish tank. 116
So it says, based on the search results, 117
the episode you're referring to is likely 118
Pt. 1 Beyond Phishing. 119
Oh, and this is great too 120
because I remember that Four Flynn, 121
who was the person being interviewed, 122
they had two episodes on the "DeepMind Podcast." 123
So even though I knew that the person's name, 124
I couldn't quite use that to just, you know, 125
manually search on my podcast app 126
because I couldn't remember which episode 127
it was actually in. 128
But it seems like it was in part one. 129
And let's see what the story was. 130
So this is a famous cybersecurity anecdote 131
about a fish tank in a Las Vegas casino, 132
and it seems that the device lacked strong security. 133
And so it was used as a pivot point for hackers 134
to break into the network and then be able to move laterally 135
to more sensitive systems. 136
So it's a pretty interesting story. 137
I guess it's like a classic story in cybersecurity. 138
And now I can remember the details of it 139
with the help of Gemini. 140
And then just as before, if we wanted to take a look 141
at the metadata as well, 142
you would be able to see kind of the chunks 143
of where this information came from, 144
and we can correlate that with parts of the response 145
if we wanted to have like a nice citation 146
for where this information came from. 147
But that's all for showing you how to build 148
your podcast app. 149
If you want to do this for real, 150
definitely check out the GitHub repo 151
and you can go and find an RSS feed 152
for a podcast that you listen to, 153
process all the information 154
and then you'll be able to retrieve answers 155
if you ever have questions 156
about all of the good stuff stored in that podcast.