Hi, and welcome back to this AI and C-Sharp video on the Microsoft Agent
framework and our Reasoning Deep Dive mini-series. This is the third
installment of this, where we had the introduction as part one and OpenAI as
part two. So now we're going to look into how Google does reasoning. So we have
exactly the same setup as OpenAI here, but now we're just using Google instead.
And all Google's modern models, meaning 2.5 and forward, can do thinking. And they
do thinking in a slightly different manner, in that they are more auto
thinking and much more easy to work with. I really like the thinking approach to
the GemIIni approach, especially the version 3 of them. Because what I have
here is, I first have a baseline of GemIIni 2.5 with auto thinking on,
meaning that we just create the Google GenAI client, make the chat client, and
use GemIIni 2.5 flash. We could also use the pro model, but they work in the
same manner. I'm just using it so we don't sit and wait too long. But if we do
this for the GemIIni and we have our question, which is the answer back in
three words of what's the capital of France and how many people live there, in
order for it to have a little of it to think about. So if we go in here and we
see how is GemIIni 2.5, in this case flash, with just out of the box and
nothing more. So if I press F10, we can see that it's still thinking quite a lot
about it and we can see that it used 715 tokens to do it. This is quite high and I
would definitely go in and steer this model some more and we will see that
happening a little later on. But if we do the same baseline with GemIIni 3, so
exactly the same code as baseline 2.5, but the only thing different being that
it's now the GemIIni 3 flash version. If we do that and we just press F10 here
to run that code, we'll see that it's much faster to answer. Because it has
internally figured out better that this was not a hard question and for that
reason it didn't use a lot of reasoning. It still used some, but it didn't need to
do a lot because of that. So GemIIni is much more advanced, or GemIIni 3 is much
more advanced than 2.5 when it comes to this. This is to a level where I actually
think we don't really need to steer too much in general. You might want to say,
oh it's a really really advanced thing, but else this is sort of acceptable that
we use quite a lot of output tokens for reasoning. Then if we want to actually
control stuff and in GemIIni 2.5 we do that by setting something called a
thinking budget. Because in OpenAR you set low, medium, high and so on. In 2.5
you set how many tokens you are marked allowed to use. And again we need to go
into this annoying extra step of doing breaking glass way down to the raw
representation factory where we can set the generating content config. And in
that we can set config, thinking config, where we set the thinking budget. And
here we can also control should it include the false back or not. So in
OpenAI it's between auto, concise and detailed. In Google you need to just say
if you want it or not. You can't really control. There's also something called
thinking level, but that is not supported by GemIIni 2.5. It's only something for
tree that we will see in one second. So we go in and set a number here. And that
number can mean different things. If you set it to minus one then it means auto,
meaning the same as we saw up here without us setting anything. We can also
set it to zero, meaning off, meaning it will not use any reasoning at all. Or we
set it to a number higher than zero and that would be how many tokens we max
allow for reasoning. In this case we're setting a high number, 2,000. And the
reason for that is if we run this and let it run.
And again it will think a lot like the first one. And let me quickly make it
move down here so we can see. This ended up using more tokens than the first one,
but it didn't use all the tokens. So there's still some auto reasoning in
here that it says, okay I'm allowed to use 2,000, but I don't need to because I
can answer this question without using every single token at my disposal. So
this just means it can max allow 2,000 and it thought in this case that 1165
was the right number. And we can see the reasoning text coming back and it works
exactly the same as OpenAI, the Microsoft agent framework, but it's really good at
packaging this in to always go into these text reasoning contents, which is
really nice. So we saw it thought a little less than OpenAI if you saw that
video, but it still came back with the correct answer. If we do the same,
beginning to control Gemini 3, we now do it in a slightly different way.
We do it in a slightly different manner because now we are not setting the
thinking budget, but we are setting the thinking level. We can still set the
thinking budget for backwards compatibility reasons, but we are
recommended not to by the Google documentation. And if we set both, it
will actually produce an exception. So in Gemini 3 model family, we set the
thinking level instead. And the Gemini 3 Pro can only set high and low. As I read
the documentation, we're not done yet, so they might want to have more
levels at some point. But for the high level, you can only choose between high
and low. While the flash, you can set between high, low, medium, and I think it's
minimalist way. So this is a nice thing to see that this is slowly going on
because it sort of shows a way toward perhaps an industry standard that these
high level, medium, and so on is the way to go for an industry standard. So we also
can get rid of needing to do these very, very elaborate ways of setting these
values. But we're not there yet, and if I do this in high mode, we will see some
interesting thing. It will take longer, but it will still take not too much longer.
So if we see it went in and did its reasoning, we get our reasoning text. You
can pause the video if you want to read what it thought about. And then we get
our output where we can see that despite us giving, hey, you're allowed to think a
lot about this, Gemini 3 is intelligent enough to know that, yeah, I don't need to.
You might have given me the allowance to do it, but I don't need to because I know
the answer pretty well. So I only use a little more than we did up here, and then
I was sure I'm thinking as the model right now, and just give the answer back.
So no matter how much we even steer Gemini, we still get some fairly quick
answers back, which I really like. Moving on, I can do exactly the same in the
agent framework toolkit, and so can you if you go and grab the free NuGet
packages. And it works exactly the same. As we saw with OpenAI, we make a
factory, in this case a Google agent factory. And to get a Google agent, we can
set a thinking budget, and we can have a thinking level. But again, the thinking
level is not supported, or both of them at the same time is not supported. But
just a more convenient way of doing exactly the same thing as we saw before.
And again, I have the reasoning.getReasoningContent extension method,
so we don't need to sit and do all this annoying for loops as well. But we end up
with exactly the same way of responding back. And the same goes for Gemini 3,
where we can set the thinking level as we saw before. And it comes back fairly
quickly, and we can just get our reasoning. So that's Gemini. I would say
Gemini is probably the most likable way this works, and their way of trying to go
to a same model as OpenAI also goes for this interesting standard way. But
they are really the most intelligent right now, as I see it, when it comes to
reasoning. Because OpenAI is more crude, you actually need to go and say, hey,
don't think so much, even on the simple questions, while Google just goes in and
say, yeah, it's okay, I'm allowed to think a lot, but I don't need to. So for that
reason, I would say they are in front when it comes to the reasoning now,
compared to OpenAI that invented it. So that's everything for Google. In the last
installment of this deep dive, we are going to show
we're going to show Anthropic.