In order to consume the key, we need
a NuGet package.
So we will just go to manage NuGet
packages and we need a specific one called
microsoft.agents.ai.openai. This is the main
package of the Microsoft agent when working with
OpenAI.
If you're working with something else, you will
take that away and you get the more
raw package.
But since we are using OpenAI-based setups,
we will use this.
As of this recording, these are pre-releases.
If you see it after Q1 of 2026,
they're probably not pre-releases anymore and you
can get them without.
But in our case, we need to have
the pre-release on.
Let's instal the package.
And we now have access to OpenAI and
the agent framework.
But the agent framework itself will not make
the connection.
That would actually be a NuGet package called
OpenAI, which is underneath here.
And that is what we're going to do
here.
So we're going to write OpenAI client.
Let's call it client and NuUp one of
these and the only thing it needs is
an API key.
So now we have our connection directly to
OpenAI and we could have used this now
in order to use their various systems in
order to just work.
But we are going to use the agent
framework on top.