WEBVTT

1
00:00:00.700 --> 00:00:02.280
Let's make a little hello world.

2
00:00:03.220 --> 00:00:05.560
While there's a lot of things yet to

3
00:00:05.560 --> 00:00:10.780
learn, I have myself seen similar courses like

4
00:00:10.780 --> 00:00:13.240
this, that spent way too much time in

5
00:00:13.240 --> 00:00:16.760
the beginning, talking about all the other things,

6
00:00:17.080 --> 00:00:19.360
when I just want to see something in

7
00:00:19.360 --> 00:00:19.720
action.

8
00:00:19.720 --> 00:00:23.120
So, we're going straight into code here in

9
00:00:23.120 --> 00:00:29.140
a zero to first prompt scenario, where the

10
00:00:29.140 --> 00:00:31.180
only thing I've done here is I've made

11
00:00:31.180 --> 00:00:35.020
a new console app, in this case .NET

12
00:00:35.020 --> 00:00:37.540
10, but it can be any .NET version,

13
00:00:37.800 --> 00:00:40.260
because Microsoft supported.

14
00:00:42.760 --> 00:00:45.840
So, the only thing we need prior to

15
00:00:45.840 --> 00:00:48.680
doing this is some kind of LLM provider,

16
00:00:49.160 --> 00:00:51.600
and in order to make it quickly here,

17
00:00:51.720 --> 00:00:54.780
I will make it using OpenAI, because it's

18
00:00:54.780 --> 00:00:57.300
the easiest to work with, and then later

19
00:00:57.300 --> 00:00:59.580
on, we'll switch it out to Azure OpenAI,

20
00:00:59.680 --> 00:01:02.440
so we have two different providers to look

21
00:01:02.440 --> 00:01:02.620
at.

22
00:01:02.620 --> 00:01:05.440
So, in order to do this, we need

23
00:01:05.440 --> 00:01:10.860
some credentials, and I've logged into platform.openai

24
00:01:10.860 --> 00:01:14.140
.com slash API keys, where I can get

25
00:01:14.140 --> 00:01:15.220
an API key.

26
00:01:16.120 --> 00:01:20.080
You need to register on platform.openai.com

27
00:01:20.080 --> 00:01:22.280
to do this, and you need to put

28
00:01:22.280 --> 00:01:25.260
in at least 5 US dollars in order

29
00:01:25.260 --> 00:01:26.440
to do it.

30
00:01:27.080 --> 00:01:29.360
If you don't want to do that upfront,

31
00:01:29.740 --> 00:01:32.120
take a look at when we do it

32
00:01:32.120 --> 00:01:33.860
with Azure instead.

33
00:01:34.460 --> 00:01:36.900
There you can have an Azure subscription and

34
00:01:36.900 --> 00:01:38.660
only pay on the fly, so we don't

35
00:01:38.660 --> 00:01:41.600
even need to spend the upfront five dollars.

36
00:01:43.180 --> 00:01:44.840
But what we need to do is we

37
00:01:44.840 --> 00:01:47.460
need to get a key, and I'm about

38
00:01:47.460 --> 00:01:52.100
to show you my key, mostly to teach

39
00:01:52.100 --> 00:01:54.300
you how they look.

40
00:01:55.060 --> 00:01:56.920
I will, of course, have deleted that key,

41
00:01:57.040 --> 00:01:58.940
and you shouldn't share a key like this

42
00:01:58.940 --> 00:02:03.980
with anyone, but let's make a key, and

43
00:02:03.980 --> 00:02:08.660
I will call it test key.

44
00:02:11.260 --> 00:02:13.280
It can be restricted, but in my case,

45
00:02:13.340 --> 00:02:17.220
I will just make it have all permissions,

46
00:02:17.960 --> 00:02:22.540
and we get a key.

47
00:02:22.540 --> 00:02:28.100
So, let's put that in, string API key,

48
00:02:28.880 --> 00:02:31.240
and of course, we shouldn't save this in

49
00:02:31.240 --> 00:02:32.420
clear text and code.

50
00:02:32.580 --> 00:02:34.520
There will be a small section on how

51
00:02:34.520 --> 00:02:39.020
we store this key in a more secure

52
00:02:39.020 --> 00:02:39.900
way as well.

53
00:02:42.840 --> 00:02:44.400
A little about this key.

54
00:02:44.700 --> 00:02:46.800
When you use it the first time, it

55
00:02:46.800 --> 00:02:49.220
might pop up with an exception saying you

56
00:02:49.220 --> 00:02:52.500
need to register a project or you need

57
00:02:52.500 --> 00:02:57.200
to verify that you're your organisation, and there

58
00:02:57.200 --> 00:02:59.980
will be a few steps up in this

59
00:02:59.980 --> 00:03:04.680
portal for you to verify with image ID

60
00:03:04.680 --> 00:03:08.540
who you are and such things before you

61
00:03:08.540 --> 00:03:10.540
can actually work with the account.

62
00:03:12.300 --> 00:03:15.100
Again, if you want to use Azure OpenAI

63
00:03:15.100 --> 00:03:18.660
instead, they don't need to do such things,

64
00:03:18.820 --> 00:03:20.600
but there's a bit more other steps that

65
00:03:20.600 --> 00:03:21.300
need to be done.

66
00:03:23.820 --> 00:03:26.340
But that is all we need to do.

67
00:03:27.260 --> 00:03:30.280
One other note is if you are subscribing

68
00:03:30.280 --> 00:03:35.400
to chat GPT, meaning the normal portal for

69
00:03:35.400 --> 00:03:37.900
chat, that does not mean that you have

70
00:03:37.900 --> 00:03:38.760
API keys.

71
00:03:39.420 --> 00:03:44.060
The API is completely separate from that subscription,

72
00:03:45.040 --> 00:03:47.660
and again, you need to have a separate

73
00:03:47.660 --> 00:03:51.960
account, and you need to put in some

74
00:03:51.960 --> 00:03:56.280
money in your billing account in here in

75
00:03:56.280 --> 00:03:57.240
order to do this.

76
00:03:59.780 --> 00:04:02.120
But we now have our key, and we

77
00:04:02.120 --> 00:04:03.540
are ready to continue.
