WEBVTT

00:00:00.079 --> 00:00:03.859
So, I have this example written by AI
and I wanna test it

00:00:03.939 --> 00:00:07.899
now. Now,
I'll need an OpenAI API key loaded as an

00:00:07.919 --> 00:00:11.559
environment variable. So as a first step,
I'll create such a key

00:00:12.300 --> 00:00:16.260
in my OpenAI API dashboard.
I'll create a new

00:00:16.360 --> 00:00:20.179
secret key. I'll name it Cursor Demo
and click Create secret

00:00:20.280 --> 00:00:24.120
key... (pause) and copy

00:00:24.159 --> 00:00:26.879
that. You don't need to remember it,
by the way.

00:00:26.899 --> 00:00:30.599
It will already have been removed by the
point of time you are viewing this.

00:00:30.659 --> 00:00:34.400
Now, I wanna load
that key from a dot env file,

00:00:34.500 --> 00:00:38.220
file,
and in there add an OpenAI API key

00:00:38.299 --> 00:00:42.060
key. And now I just need to make sure
that this dot env file gets loaded.

00:00:42.500 --> 00:00:46.139
Now, I could ask the AI here, but there
is a

00:00:46.259 --> 00:00:48.419
trap into which you can easily fall.

00:00:48.959 --> 00:00:52.419
You can easily get into the mode of
letting the AI do everything.

00:00:52.419 --> 00:00:55.459
But don't forget,
you're a software developer.

00:00:55.500 --> 00:00:59.200
You know how to write code, right?
And loading a dot env file in a

00:00:59.299 --> 00:01:03.219
Python project is super simple.
I don't need AI help for that because I

00:01:03.299 --> 00:01:07.080
know that I simply need to install the
Python dot env module

00:01:08.200 --> 00:01:12.199
with UV ads since I'm using UV.
And then from dot env,

00:01:12.340 --> 00:01:16.180
I import load-env and call that.
And I even got some AI help

00:01:16.239 --> 00:01:19.279
here through Cursor's tab completion.

00:01:19.299 --> 00:01:22.079
But yeah,
this is not something where I would've

00:01:22.540 --> 00:01:25.299
By the way,
I can see I still got one other file to

00:01:25.339 --> 00:01:28.079
review where I also wanna accept those

00:01:28.360 --> 00:01:31.879
changes. But with that, we're now loading

00:01:33.840 --> 00:01:37.839
this... (pause) And with all that,
we can then run this main.pwa file and

00:01:37.879 --> 00:01:41.479
hopefully read that post
and get an X post as a

00:01:41.540 --> 00:01:45.519
result. So looks like it's done.
Now in outputs, I

00:01:45.559 --> 00:01:48.959
got post.txt with a nice post that

00:01:49.019 --> 00:01:52.339
hopefully works well on X.
