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 - .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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Choosing a .NET library3m 37s
-
(Locked)
Creating a basic .NET Core console application3m 42s
-
(Locked)
Create the OpenAIClient object5m 17s
-
(Locked)
Hello chat6m 25s
-
(Locked)
The chat loop5m 19s
-
(Locked)
Error handling7m 35s
-
(Locked)
Using the Azure OpenAI service5m 35s
-
(Locked)
Streaming vs. non-streaming2m 43s
-
(Locked)
Implementing streaming completion7m 18s
-
(Locked)
Challenge: Fix the bugs41s
-
(Locked)
Solution: Fix the bugs6m 40s
-
-
-