From the course: A Start to Using Generative AI in .NET

Unlock the full course today

Join today to access over 23,400 courses taught by industry experts.

Using the Azure OpenAI service

Using the Azure OpenAI service - .NET Tutorial

From the course: A Start to Using Generative AI in .NET

Using the Azure OpenAI service

- [Instructor] Until now, we've been using OpenAI's service. However, you might want to use Azure's OpenAI service to take advantage of the Azure ecosystem, its enhanced content filtering features or its strict data privacy and compliance standards. Let's see how we can use Azure OpenAI Service in our code. Luckily, the code is almost the same for both services. The key difference is how we configure and create the OpenAIClient object. Before we dive into any code, let's just make sure that all of the information we need is at hand. We can collect these from Azure AI Studio. First, let's navigate to the hub we've created. Open the Chat Playground and make sure that the right deployment is selected. Now, click on View Code. Here you will find sample codes to access this deployment in many different languages. You can even take a peek at the C# code if you want, but what we really need are the two fields at the top, the endpoint and the API key. Let's store both of these in an…

Contents