WEBVTT

1
00:00:00.710 --> 00:00:03.730
So let's begin to use the agent framework

2
00:00:03.730 --> 00:00:06.050
part now that we have the raw connection

3
00:00:06.050 --> 00:00:06.610
in place.

4
00:00:08.270 --> 00:00:10.330
What we're going to do is we're going

5
00:00:10.330 --> 00:00:14.750
to get a chat client which is that

6
00:00:14.750 --> 00:00:15.970
we can work with chat.

7
00:00:16.370 --> 00:00:18.970
We could also use what is called the

8
00:00:18.970 --> 00:00:22.550
responses client which is a more advanced version

9
00:00:22.550 --> 00:00:25.250
of this but I tend to use the

10
00:00:25.250 --> 00:00:30.190
chat client because it's the most compatible version

11
00:00:30.190 --> 00:00:33.310
with all providers and here and here we

12
00:00:33.310 --> 00:00:34.050
need a model.

13
00:00:35.410 --> 00:00:38.450
For this course I will use some very

14
00:00:38.450 --> 00:00:40.850
very cheap models so you don't spend a

15
00:00:40.850 --> 00:00:44.070
lot of money while you're trying out this

16
00:00:44.070 --> 00:00:49.310
but let's quickly go and see what models

17
00:00:49.310 --> 00:00:50.190
we have available.

18
00:00:50.760 --> 00:00:53.070
So we can go to the dashboard up

19
00:00:53.070 --> 00:00:57.050
here and we can see the different models

20
00:00:57.050 --> 00:00:57.610
up here.

21
00:01:00.210 --> 00:01:05.430
I will use the model called chat-gpt5-nano

22
00:01:05.430 --> 00:01:08.910
so this is the name

23
00:01:08.910 --> 00:01:10.850
that we're gonna put in here.

24
00:01:12.750 --> 00:01:16.330
chat-gpt5-nano.

25
00:01:18.760 --> 00:01:21.700
It's a very very cheap model but it's

26
00:01:21.700 --> 00:01:24.200
more than capable of what we need to

27
00:01:24.200 --> 00:01:26.140
do in these samples.

28
00:01:26.680 --> 00:01:29.200
Of course in real life you might have

29
00:01:29.200 --> 00:01:32.000
more advanced stuff you do with the AI

30
00:01:32.000 --> 00:01:35.160
and need bigger models but this is more

31
00:01:35.160 --> 00:01:35.720
than capable.

32
00:01:37.940 --> 00:01:41.940
And what we can now say is create

33
00:01:41.940 --> 00:01:47.980
AI agents and if we do that we

34
00:01:47.980 --> 00:01:50.840
get what is called a chat client agent

35
00:01:50.840 --> 00:01:53.560
from Microsoft agent framework.

36
00:01:55.780 --> 00:02:00.240
The agents we can now use to talk

37
00:02:00.240 --> 00:02:03.200
with the LLM and we do that using

38
00:02:03.200 --> 00:02:05.140
something called RunAsync.

39
00:02:05.740 --> 00:02:08.860
So we need the await keyword and we

40
00:02:08.860 --> 00:02:12.240
need to ask something and that could be

41
00:02:12.240 --> 00:02:17.580
what is the capital of France.

42
00:02:20.840 --> 00:02:24.180
If we do that we get something called

43
00:02:24.180 --> 00:02:28.440
an agent run response back and that agent

44
00:02:28.440 --> 00:02:31.260
one response we can simply just write out

45
00:02:31.260 --> 00:02:32.240
into the console.

46
00:02:35.880 --> 00:02:39.420
We can take the entire object because the

47
00:02:39.420 --> 00:02:41.880
two string will just be the same as

48
00:02:41.880 --> 00:02:46.660
what is called text here and this is

49
00:02:46.660 --> 00:02:48.940
actually everything that needs to be here.

50
00:02:49.340 --> 00:02:51.160
We don't need the hello world from this

51
00:02:51.160 --> 00:02:56.840
and we just have our API key, our

52
00:02:56.840 --> 00:03:00.780
raw client, our agent, our call to the

53
00:03:00.780 --> 00:03:04.780
LLM and we should be able to run.

54
00:03:05.020 --> 00:03:12.500
So let's do that and let me move

55
00:03:14.440 --> 00:03:19.400
system over here and we get the answer

56
00:03:19.400 --> 00:03:20.780
back that it's Paris.

57
00:03:24.740 --> 00:03:27.140
What we have here is a thinking model

58
00:03:27.140 --> 00:03:30.140
so the answers will be a bit slow

59
00:03:30.140 --> 00:03:30.880
at times.

60
00:03:31.780 --> 00:03:35.780
I will also draw these using a non

61
00:03:35.780 --> 00:03:38.220
-reasoning model which is the chat gpt-4.1-nano

62
00:03:38.220 --> 00:03:42.620
in this case as well and

63
00:03:42.620 --> 00:03:44.660
what we will be able to see if

64
00:03:44.660 --> 00:03:50.240
I run this is that the answer comes

65
00:03:50.240 --> 00:03:52.400
back much faster.

66
00:03:53.460 --> 00:03:56.660
What we also saw that an AI is

67
00:03:56.660 --> 00:03:59.740
non-deterministic so the first time I just

68
00:03:59.740 --> 00:04:01.740
said the word Paris the second time I

69
00:04:01.740 --> 00:04:03.600
said the capital of France is Paris.

70
00:04:05.640 --> 00:04:08.920
So that is actually everything there is to

71
00:04:08.920 --> 00:04:09.760
getting started.

72
00:04:10.280 --> 00:04:13.960
From here on it's more just building more

73
00:04:13.960 --> 00:04:16.380
and more on top of this which we'll

74
00:04:16.380 --> 00:04:18.339
do in the following videos.
