- [Instructor] So now that we have extracted 2
some of these episodes 3
and the information about them, 4
for each podcast episode 5
we need to do three different things. 6
We need to get the audio file, 7
the podcast audio file, 8
and download it. 9
And then we'll need to transcribe that audio. 10
And once we have a transcription, 11
which will be a text file, 12
we can upload that transcription 13
to our file search store. 14
So these transcripts of these audio files 15
are essentially what the semantic search will happen over 16
in order to retrieve information 17
for a particular user query. 18
So I will show you in just a little bit 19
how to do this across all podcast episodes 20
in an RSS feed, 21
kind of in a big bulk upload. 22
But before we get into that 23
and having everything written out in nice functions 24
that we can just call, 25
I'm going to do this step by step 26
for just a single episode. 27
So just so we get like a handle of every single step 28
that we need to follow 29
and how this works, 30
we're just going to do this for a single episode, 31
and we'll do it for that AlphaFold episode. 32
So I'm going to extract the first episode in that list, 33
and we'll just call it ep, E-P. 34
And now from that dictionary, 35
we need to extract the audio URL. 36
So what you'll find is that these RSS feeds 37
have a link to the audio 38
for every single episode. 39
So if we type this out here, 40
you can see there is a URL 41
that we extracted. 42
And if we open up this audio URL. 43
(upbeat music) 44
- [John] Enabled you to solve the grand challenge 45
and that this was kind of. 46
- [Hannah] Did you know that you need to? 47
- [John] No, you do all those things right. 48
- [Instructor] All right, so that's 47 minutes 49
of the podcast audio in this URL. 50
Okay, and so we're going to go ahead 51
and just create a name for our audio file. 52
We're going to call it episode_0, 53
and then for our transcription as well. 54
So we'll use these in just a minute. 55
So now that we have acquired the audio URL, 56
the next thing we need to do 57
is actually download that audio. 58
So I'm going to do this with the requests library 59
and I'm going to just download this information in chunks, 60
and I'm going to save it as episode_0.mp3. 61
So you can see on the left side over here, 62
our audio file has now been downloaded, 63
and it's downloaded locally to my Colab environment. 64
And so the next thing we need to do 65
is we need to actually transcribe this audio 66
because, again, we want text. 67
And that is what the model will be able to search over 68
when a user asks a query. 69
So to do this, I'm going to read in the audio bites 70
of my MP3 file, 71
and then I'm going to use Gemini 3 Pro Preview again, 72
but to actually create the transcription. 73
So I'm calling generate_content. 74
Again, that is the method 75
of text generation in the Gemini API. 76
And we pass in Gemini 3 Pro Preview. 77
If you want to experiment with another model, 78
you can definitely try that out 79
and just change the model's string name. 80
And then I'm going to instruct the model 81
to, "Generate a transcript of this audio file. 82
Make sure to transcribe the entire file. 83
Do not repeat yourself. 84
And label the speakers." 85
And so after we pass in that prompt, 86
we also need to pass in the audio file, 87
which is right here. 88
So this is going to take about a minute or so. 89
It's a long audio file that needs to be processed 90
and also needs to be transcribed. 91
So while that happens, 92
I'm going to quickly jump over 93
and show you this GitHub repo 94
that my awesome teammate Mark McDonald made. 95
This has all of the code that I'm showing you today, 96
but written a little bit more production friendly. 97
But you can see that there's some information here. 98
And if we scroll down here, 99
you can see that there are basically two steps. 100
You can call ingest.py, 101
and you just pass in your RSS feed. 102
So you don't need to go through all the steps 103
that I'm walking you through right now, 104
you can just pass in the URL as is, 105
and then you can call query.py 106
and ask a question. 107
So I definitely encourage you to take a look at this. 108
If you jump into here, 109
you'll see basically all of the same code 110
I'm running through, 111
but it just looks a lot cleaner 112
and might be a little bit harder to follow. 113
So that's why we're running through it 114
step by step over here. 115
So looks like this is still running. 116
Let's let this keep running. 117
And while that transcription chugs away, 118
we can scroll ahead a little bit 119
and take a look at the next few steps. 120
So what we're going to do next 121
with this transcription file once we have it 122
is we will upload it to our file search store. 123
Oh, and actually, looks like I stalled for long enough 124
and the transcription is done. 125
So let's go ahead and take a look. 126
So we'll call response.text. 127
And you can see we have a transcription. 128
So first we have John Jumper, 129
and he's talking about, 130
"I think we'll get this ability 131
to poke the cell in exciting ways, 132
to interrogate it, et cetera. 133
We have Hannah Fry, 134
who is the host of "The Google DeepMind" podcast, 135
and you can see she's saying, 136
"Welcome to 'The Google DeepMind' podcast," 137
et cetera, et cetera. 138
If we click here, we can see the whole transcription. 139
So now that we've done that, 140
we are going to create a transcription file 141
and upload this to the file search store. 142
So I am first going to write this transcription. 143
So you can see right over here on the left, 144
we just had this file transcript_0.txt open. 145
So let's take a look. 146
So I just added some nice metadata at the top. 147
I added the title of the podcast episode, 148
the name of the podcast, 149
and then the date. 150
And then now we have our transcript. 151
So you can see John and Hannah 152
having a back-and-forth conversation. 153
So that is what I was doing right here in this block here. 154
I was just adding this extra information, 155
the title, the podcast and the date, 156
in addition to that transcription 157
that we got from Gemini. 158
And then the next thing I'm going to do 159
is get some extra metadata 160
because when we upload this to the file search store, 161
we want to provide some extra information, 162
like the title of the episode name, the podcast, 163
just as metadata. 164
We didn't do this in the bake shop example, 165
but you can see right here 166
that I'm passing in this config here 167
with some extra information about this text file. 168
And so once we've done that, 169
we have our transcript uploaded 170
to our file search store, 171
which means that we can now ask a question 172
about the information in this podcast episode. 173
So again, I'm calling generate_content, 174
and I'm going to call this on the Model Gemini 3 Pro Preview. 175
And my prompt here is, 176
"What did John and Hannah talk about?" 177
And hopefully since we have passed in our file search store 178
right here, 179
we should get a response that relates to AlphaFold. 180
So let's see. 181
So you can see it says, 182
"Based on the AlphaFold grand challenge 183
to Nobel Prize with John Jumper," blah, blah, blah. 184
We have a summary kind of what the two of them talked about. 185
And just so we know, 186
this actually did work 187
if we were to delete this part of our request 188
that includes the file search tool, 189
as well as the name of our store. 190
And if we call this again, 191
probably the model is going to come back with a response 192
that is like, "Who are John and Hannah?" 193
So it won't have access anymore 194
to the grounded information 195
from our podcast transcription. 196
So let's take a look and see 197
what the model thinks or who it guesses 198
John and Hannah maybe are. 199
All right, so here we have a response from the model, 200
and it says, "Because John and Hannah are very common names, 201
I need a little more context." 202
So you can see if we don't pass in the file search store, 203
the model has no idea which John and Hannah 204
we are actually talking about. 205
But if we have that data in our search store, 206
it can access the correct information 207
and get the context we're looking for.