WEBVTT

1
00:00:00.450 --> 00:00:03.050
As we saw in Hello World, we can

2
00:00:03.050 --> 00:00:07.109
use OpenAI or Azure OpenAI with Microsoft Agent

3
00:00:07.109 --> 00:00:07.730
Framework.

4
00:00:08.130 --> 00:00:10.210
But we are in no way limited to

5
00:00:10.210 --> 00:00:10.630
those.

6
00:00:11.170 --> 00:00:13.750
The reason why I chose those and spent

7
00:00:13.750 --> 00:00:17.450
more time than other models is that this

8
00:00:17.450 --> 00:00:19.370
is what I'm going to use throughout this

9
00:00:19.370 --> 00:00:21.390
course.

10
00:00:22.090 --> 00:00:24.510
And I'm especially going to use Azure OpenAI

11
00:00:24.510 --> 00:00:28.070
because that's my preferred provider.

12
00:00:29.850 --> 00:00:32.850
Azure OpenAI is pay-as-you-go, so

13
00:00:32.850 --> 00:00:34.690
it's cheaper, but it requires a little more

14
00:00:34.690 --> 00:00:37.550
setup, while OpenAI, as I mentioned in the

15
00:00:37.550 --> 00:00:41.390
video, needs five US dollars up front before

16
00:00:41.390 --> 00:00:42.650
you can begin to use it.

17
00:00:43.930 --> 00:00:48.290
But again, there's so many more models, Google's

18
00:00:48.290 --> 00:00:50.930
models, Anthropic models, Mistral, and so on.

19
00:00:50.930 --> 00:00:54.470
And I'm going to go through how each

20
00:00:54.470 --> 00:00:59.770
of these are being connected using Microsoft Agent

21
00:00:59.770 --> 00:01:02.390
Framework, so you have a reference if you

22
00:01:02.390 --> 00:01:04.069
want to use some of the others.

23
00:01:05.190 --> 00:01:06.890
So let's get through this.

24
00:01:07.840 --> 00:01:12.550
So OpenAI, we saw, very simple, OpenAI Client,

25
00:01:13.090 --> 00:01:15.550
Chat Client, and so on.

26
00:01:15.930 --> 00:01:18.750
And we only used this one specific NuGet

27
00:01:18.750 --> 00:01:19.230
package.

28
00:01:20.790 --> 00:01:23.850
Azure OpenAI, a little more complicated because we

29
00:01:23.850 --> 00:01:26.290
needed two NuGet packages, and we needed to

30
00:01:26.290 --> 00:01:30.170
put in an endpoint as well.

31
00:01:33.610 --> 00:01:36.910
Google is probably the one that are the

32
00:01:36.910 --> 00:01:40.330
least supported at the moment, as of this

33
00:01:40.330 --> 00:01:43.470
recording being 6th of January, 2026.

34
00:01:44.270 --> 00:01:49.390
There is a new official Google NuGet package

35
00:01:49.390 --> 00:01:52.310
underway, but so far we have only been

36
00:01:52.310 --> 00:01:54.450
to an unofficial package.

37
00:01:54.450 --> 00:01:57.350
As soon as the official package goes live,

38
00:01:57.510 --> 00:02:00.730
I will believe that it's just as capable

39
00:02:00.730 --> 00:02:01.550
as the rest.

40
00:02:02.370 --> 00:02:04.790
But for now, we have this generative AI

41
00:02:04.790 --> 00:02:08.410
Chat Client package that we need to NuUp.

42
00:02:08.990 --> 00:02:10.950
And while it looks like it can do

43
00:02:10.950 --> 00:02:14.370
the same here, it has certain limitations when

44
00:02:14.370 --> 00:02:16.230
you come to more advanced stuff.

45
00:02:17.390 --> 00:02:20.970
In terms of getting your API keys, you

46
00:02:20.970 --> 00:02:24.630
do that in aistudio.google.com or you

47
00:02:24.630 --> 00:02:26.650
can also use the Google Cloud Platform.

48
00:02:29.050 --> 00:02:30.450
Then we have Anthropic.

49
00:02:30.950 --> 00:02:36.710
Anthropic have an official Microsoft Agent Framework package,

50
00:02:36.890 --> 00:02:38.150
just like OpenAI have.

51
00:02:39.710 --> 00:02:41.990
And in that, we just need to new up

52
00:02:41.990 --> 00:02:44.530
an Anthropic Client, and in that we need

53
00:02:44.530 --> 00:02:45.650
to give the API key.

54
00:02:46.930 --> 00:02:50.130
And when we then use the agent, we

55
00:02:50.130 --> 00:02:54.050
need to give some extra information, because we

56
00:02:54.050 --> 00:02:56.910
can't give the model in the client itself.

57
00:02:57.090 --> 00:02:58.450
We need to give it in something called

58
00:02:58.450 --> 00:02:59.610
Chat Options here.

59
00:03:00.990 --> 00:03:03.910
And a very important thing for Anthropic is

60
00:03:03.910 --> 00:03:06.250
you also always need to give how many

61
00:03:06.250 --> 00:03:08.910
tokens per call you can use.

62
00:03:09.670 --> 00:03:12.590
So we do almost the same, but we

63
00:03:12.590 --> 00:03:16.010
just need to give some additional Chat Client

64
00:03:16.010 --> 00:03:20.090
agent options here with some model ID and

65
00:03:20.090 --> 00:03:21.690
options.

66
00:03:22.190 --> 00:03:23.990
But beyond that, it's exactly the same.

67
00:03:26.390 --> 00:03:32.270
Mistral from France have also only an unofficial

68
00:03:32.270 --> 00:03:35.690
package, but you can use it together with

69
00:03:35.690 --> 00:03:36.810
the agent's AI.

70
00:03:36.810 --> 00:03:41.410
And you just new up a Mistral client, give

71
00:03:41.410 --> 00:03:47.550
your API key, and write mistral-client.completions

72
00:03:47.550 --> 00:03:50.870
.create-ai-agent, because this completions is an

73
00:03:50.870 --> 00:03:51.690
iChat client.

74
00:03:52.730 --> 00:03:55.650
You go to admin.mistral.ai in order

75
00:03:55.650 --> 00:03:58.590
to get your models and API keys.

76
00:04:01.450 --> 00:04:06.430
XAI or Grok is possible to use as

77
00:04:06.430 --> 00:04:07.290
well.

78
00:04:07.430 --> 00:04:10.330
And Grok is one of those models that

79
00:04:10.330 --> 00:04:14.730
have just adhered to the OpenAI spec instead

80
00:04:14.730 --> 00:04:16.290
of making their own API.

81
00:04:17.149 --> 00:04:19.430
So what you do is you just use

82
00:04:19.430 --> 00:04:23.450
the OpenAI package, and instead of just giving

83
00:04:23.450 --> 00:04:25.870
the API key, you also need to give

84
00:04:25.870 --> 00:04:28.630
some options where you point to an endpoint,

85
00:04:28.930 --> 00:04:32.190
meaning you point to XAI's endpoint instead of

86
00:04:32.190 --> 00:04:33.230
OpenAI's endpoint.

87
00:04:34.170 --> 00:04:37.070
But beyond that, it works exactly the same

88
00:04:37.070 --> 00:04:40.190
way as OpenAI.

89
00:04:40.850 --> 00:04:43.150
And you will see this throughout some of

90
00:04:43.150 --> 00:04:46.890
these models that they have just taken the

91
00:04:46.890 --> 00:04:49.230
same approach as OpenAI.

92
00:04:51.670 --> 00:04:56.370
Microsoft Foundry is a bigger thing.

93
00:04:57.150 --> 00:05:00.490
You still use two NuGet packages, but instead

94
00:05:00.490 --> 00:05:02.550
of the OpenAI package, you use the Azure

95
00:05:02.550 --> 00:05:03.490
AI package.

96
00:05:04.250 --> 00:05:08.370
So this is something called persistent agents, meaning

97
00:05:08.370 --> 00:05:11.590
that in the other cases, we have in

98
00:05:11.590 --> 00:05:13.250
memory made our agent.

99
00:05:13.250 --> 00:05:16.590
In Microsoft Foundry, you actually make an agent,

100
00:05:16.730 --> 00:05:19.430
and it becomes a permanent thing up in

101
00:05:19.430 --> 00:05:20.070
that portal.

102
00:05:22.570 --> 00:05:26.330
You use something called AI project client in

103
00:05:26.330 --> 00:05:29.210
order to do this, and you can't get

104
00:05:29.210 --> 00:05:30.670
an API key for it.

105
00:05:30.830 --> 00:05:33.990
You need to use a role-based access

106
00:05:33.990 --> 00:05:36.290
system from Azure to work with them.

107
00:05:37.630 --> 00:05:42.270
Once you do that, you get your client,

108
00:05:42.530 --> 00:05:45.950
and it can create agents, and there are

109
00:05:45.950 --> 00:05:48.090
even version histories, so you can go back

110
00:05:48.090 --> 00:05:52.690
and forward between agents, and you can set

111
00:05:52.690 --> 00:05:55.510
up your models on what agents should be

112
00:05:55.510 --> 00:05:55.830
used.

113
00:05:56.810 --> 00:05:59.830
Once you have done all that, you can

114
00:05:59.830 --> 00:06:03.530
just get your AI agent like normal, and

115
00:06:03.530 --> 00:06:05.790
you don't need to create it every single

116
00:06:05.790 --> 00:06:06.090
time.

117
00:06:06.370 --> 00:06:07.930
If you have the name and it already

118
00:06:07.930 --> 00:06:10.710
exists, you can just get the agent in

119
00:06:10.710 --> 00:06:11.290
that manner.

120
00:06:12.670 --> 00:06:16.370
There will be separate lectures on Microsoft Foundry

121
00:06:16.370 --> 00:06:19.790
because it's a much bigger thing, but for

122
00:06:19.790 --> 00:06:21.870
now, we can just see that it is

123
00:06:21.870 --> 00:06:24.710
possible to work with them, but they work

124
00:06:24.710 --> 00:06:26.450
slightly different than the rest.

125
00:06:28.490 --> 00:06:31.850
Then we have Amazon Bedrock, which is part

126
00:06:31.850 --> 00:06:35.550
of the Amazon AWS system.

127
00:06:37.550 --> 00:06:41.710
They have their own official NuGet package for

128
00:06:41.710 --> 00:06:45.690
ME-AI, meaning Microsoft Extensions AI, and we

129
00:06:45.690 --> 00:06:49.610
use them together with Agents AI, and once

130
00:06:49.610 --> 00:06:52.470
you do that, you can make a new

131
00:06:52.470 --> 00:06:52.870
client.

132
00:06:53.710 --> 00:06:56.370
In order to do that, you need to

133
00:06:56.370 --> 00:06:59.490
make an environment variable, so it needs to

134
00:06:59.490 --> 00:07:01.130
be in environment values.

135
00:07:01.310 --> 00:07:03.030
You can't really set it on the client

136
00:07:03.030 --> 00:07:06.530
itself, but no big deal.

137
00:07:07.070 --> 00:07:09.770
Then you need to know what region you

138
00:07:09.770 --> 00:07:14.170
are in and get this runtime client.

139
00:07:15.050 --> 00:07:17.090
Once you have one of those, you can

140
00:07:17.090 --> 00:07:20.970
turn it into these iChat clients, and once

141
00:07:20.970 --> 00:07:23.630
you have that, you get the normal Microsoft

142
00:07:23.630 --> 00:07:24.310
agent.

143
00:07:27.230 --> 00:07:30.490
Then we have Ollama, which is an offline

144
00:07:30.490 --> 00:07:33.810
model, so you go and download the Olama

145
00:07:33.810 --> 00:07:35.050
service.

146
00:07:35.510 --> 00:07:39.190
You instal it in your machine, and you

147
00:07:39.190 --> 00:07:42.130
run some commands to download the offline models.

148
00:07:43.510 --> 00:07:47.170
Once you have done that, you make an

149
00:07:47.170 --> 00:07:50.150
Olama client using something called OllamaSharp.

150
00:07:50.350 --> 00:07:53.570
This is technically unofficial, but as it's offline,

151
00:07:53.710 --> 00:07:55.290
it doesn't really matter too much.

152
00:07:57.390 --> 00:08:00.370
This client is by default also an iChat

153
00:08:00.370 --> 00:08:04.190
client, and instead of some endpoint up in

154
00:08:04.190 --> 00:08:06.330
the cloud, you hook it up to a

155
00:08:06.330 --> 00:08:09.410
local host or wherever you host the Olama

156
00:08:09.410 --> 00:08:10.850
service.

157
00:08:12.130 --> 00:08:15.210
You tell what model you want, and then

158
00:08:15.210 --> 00:08:17.430
you just take this client and turn it

159
00:08:17.430 --> 00:08:20.910
into an iChat client agent, and from there

160
00:08:20.910 --> 00:08:22.270
on, it's exactly the same.

161
00:08:25.250 --> 00:08:29.090
Another offline thing you can do is Microsoft

162
00:08:29.090 --> 00:08:31.390
version called Foundry Local.

163
00:08:32.390 --> 00:08:37.130
In Foundry Local, you have Winget, or you

164
00:08:37.130 --> 00:08:39.610
can download it from a website, and you

165
00:08:39.610 --> 00:08:43.350
can instal the Microsoft Foundry Local as a

166
00:08:43.350 --> 00:08:44.390
Windows service.

167
00:08:45.230 --> 00:08:48.790
Once you have that, you have a NuGet

168
00:08:48.790 --> 00:08:53.170
package dedicated for that from Microsoft, and behind

169
00:08:53.170 --> 00:08:56.130
the scenes, it's using the OpenAI spec, so

170
00:08:56.130 --> 00:08:59.310
we just use the Microsoft Agent Framework OpenAI

171
00:08:59.310 --> 00:09:01.110
NuGet package.

172
00:09:02.670 --> 00:09:04.870
In order to do this, we then use

173
00:09:04.870 --> 00:09:07.990
something called a Foundry Local Manager that says

174
00:09:07.990 --> 00:09:09.630
it wants to start the model.

175
00:09:11.210 --> 00:09:13.590
So we have our model name, we start

176
00:09:13.590 --> 00:09:17.010
that model, and we get a manager back

177
00:09:17.010 --> 00:09:19.310
that it has now started the model, where

178
00:09:19.310 --> 00:09:21.810
we will get the information about the model,

179
00:09:22.050 --> 00:09:24.730
like, for example, its real ID.

180
00:09:24.730 --> 00:09:27.850
This is just the alias of the model,

181
00:09:28.330 --> 00:09:31.890
like the open source chat GPT.

182
00:09:33.590 --> 00:09:35.790
Once you have that, you need to make

183
00:09:35.790 --> 00:09:39.710
an OpenAI client, and all OpenAI clients need

184
00:09:39.710 --> 00:09:41.570
an API key, but you can just paste

185
00:09:41.570 --> 00:09:42.570
anything in here.

186
00:09:43.110 --> 00:09:46.350
In this case, no API key, and the

187
00:09:46.350 --> 00:09:48.790
endpoint will be given on the fly by

188
00:09:48.790 --> 00:09:52.010
the manager, so it will be some local

189
00:09:52.010 --> 00:09:55.370
host and a port that it assigns on

190
00:09:55.370 --> 00:09:55.750
the fly.

191
00:09:57.270 --> 00:09:59.570
And once we have that, it is exactly

192
00:09:59.570 --> 00:10:01.390
the same as we normally do.

193
00:10:01.910 --> 00:10:04.110
We get our chat client with our model,

194
00:10:04.630 --> 00:10:07.550
and we get our agent, so we can

195
00:10:07.550 --> 00:10:09.130
do our run async.

196
00:10:12.610 --> 00:10:14.270
Then we have OpenRouter.

197
00:10:14.270 --> 00:10:17.990
OpenRouter is one of these companies that have

198
00:10:17.990 --> 00:10:21.450
made deals with all the different providers, so

199
00:10:21.450 --> 00:10:25.410
you can use Anthropic, you can use OpenAI,

200
00:10:25.710 --> 00:10:27.790
you can use Grok, you can use all

201
00:10:27.790 --> 00:10:33.410
the different models from almost any provider out

202
00:10:33.410 --> 00:10:33.730
there.

203
00:10:34.550 --> 00:10:39.110
And they have, as well, taken the OpenAI

204
00:10:39.110 --> 00:10:45.850
as a NuGet package, so you just new

205
00:10:45.850 --> 00:10:49.590
up with OpenAI, and you put in your

206
00:10:49.590 --> 00:10:56.130
endpoint being OpenRouter.ai.api.v1. And once

207
00:10:56.130 --> 00:10:58.050
you have that, it works exactly the same.

208
00:10:59.310 --> 00:11:05.910
Same goes for another of these multi-LLM

209
00:11:05.910 --> 00:11:09.990
providers, together.ai. It's exactly the same, but

210
00:11:09.990 --> 00:11:11.210
just with a different URL.

211
00:11:13.630 --> 00:11:16.870
We also have Cohere, works exactly the same

212
00:11:16.870 --> 00:11:17.630
way as well.

213
00:11:18.650 --> 00:11:22.710
They have their own models only, and they

214
00:11:22.710 --> 00:11:25.530
are fairly limited, but they are good for

215
00:11:25.530 --> 00:11:28.410
small education scenarios.

216
00:11:31.030 --> 00:11:34.230
We have HuggingFace, which is one of these

217
00:11:34.230 --> 00:11:40.030
free offerings, so you can technically work on

218
00:11:40.030 --> 00:11:40.930
all this for free.

219
00:11:41.350 --> 00:11:43.770
They don't have some of the big models.

220
00:11:43.910 --> 00:11:46.730
It's more the more open source, the more

221
00:11:46.730 --> 00:11:51.030
small models that exist out there, and they

222
00:11:51.030 --> 00:11:53.570
are by far the biggest provider of models.

223
00:11:54.170 --> 00:11:57.550
You can use them using OpenAI, so it's

224
00:11:57.550 --> 00:12:00.890
exactly the same setup, just with a different

225
00:12:00.890 --> 00:12:01.430
endpoint.

226
00:12:03.290 --> 00:12:06.230
The final one we have is GitHub Models,

227
00:12:06.370 --> 00:12:08.870
which is probably the best way of getting

228
00:12:08.870 --> 00:12:14.110
hold of OpenAI and all the bigger models

229
00:12:14.110 --> 00:12:18.610
for free, because as part of GitHub, you

230
00:12:18.610 --> 00:12:23.450
can get with some fairly heavy rate limits,

231
00:12:23.690 --> 00:12:26.150
but I guess you could manage throughout this

232
00:12:26.150 --> 00:12:30.110
course to stay on GitHub Models if you

233
00:12:30.110 --> 00:12:30.790
wish to.

234
00:12:31.730 --> 00:12:34.070
You go up and make a personal access

235
00:12:34.070 --> 00:12:37.330
token up in GitHub, and then you use

236
00:12:37.330 --> 00:12:43.290
Azure AI Inference as a connector, so you

237
00:12:43.290 --> 00:12:46.670
make one of these chat completion clients that

238
00:12:46.670 --> 00:12:50.870
needs a URL, which is the inference URL

239
00:12:50.870 --> 00:12:55.930
for GitHub, the Azure key credentials, which is

240
00:12:55.930 --> 00:13:00.630
your GitHub personal access token, and then you

241
00:13:00.630 --> 00:13:05.090
can say, as AI client, in order to

242
00:13:05.090 --> 00:13:10.170
get your AI client here, and then it's

243
00:13:10.170 --> 00:13:12.290
run like normal, but it requires a bit

244
00:13:12.290 --> 00:13:15.570
more and more different NuGet packages.

245
00:13:15.890 --> 00:13:21.090
That's the negative part about this, plus the

246
00:13:21.090 --> 00:13:23.870
quite heavy rate limits.

247
00:13:24.130 --> 00:13:25.950
Of course, if you pay, you can use

248
00:13:25.950 --> 00:13:32.690
it without rate limits, but if you want

249
00:13:32.690 --> 00:13:34.430
it free, it is one of the options

250
00:13:34.430 --> 00:13:37.650
to actually get OpenAI for free.

251
00:13:38.510 --> 00:13:43.050
And that's all the different providers I have

252
00:13:43.050 --> 00:13:45.570
tried over the times.

253
00:13:46.010 --> 00:13:48.310
There are probably many more, and they are

254
00:13:48.310 --> 00:13:55.170
probably mostly just some OpenAI spec version, so

255
00:13:55.170 --> 00:13:59.710
as you can see, you can easily hook

256
00:13:59.710 --> 00:14:03.510
up to almost anything in this agent framework,

257
00:14:03.510 --> 00:14:07.550
so it's no way a vendor login to

258
00:14:07.550 --> 00:14:11.990
Microsoft or to OpenAI in any way.

259
00:14:13.670 --> 00:14:15.450
So that was the bonus.

260
00:14:15.830 --> 00:14:19.890
Let's go back to some of the more

261
00:14:19.890 --> 00:14:24.430
educational parts of the agent framework before we

262
00:14:24.430 --> 00:14:27.550
dive into some of the deeper topics.
