Chat Application Development Using Azure Open AI

Chat Application Development Using Azure Open AI

Azure Open AI is a service that allows you to use or integrate the most popular and latest models of Open AI. It provides cloud cloud-based platform. It offers many services like chat, models, and fine-tuning. We will explore Chat Completion in this article using Azure configuration and .Net core application with helpful and informative snaps.

Chat Completion: Chat completion uses chat models and provides the answer/output for the given question/input.

So, we will break this article into two parts.

  1. Azure Configuration
  2. .NET core application

CTA- Chat App Using Azure Open AI.webp

1. Azure Configuration:

First, to use Azure OpenAI you should have an Azure Subscription (Free/Paid).

Steps after having an Azure Account -:

1. Login into your Azure Account and Search Azure Open AI

2. Create a new Azure Open AI service

Image1.png

3. Now you must enter the following information and complete all 4 steps shown in the below figure. After completing these steps your Azure OpenAI service will be created.

Image2.png

4.Now click your newly created service you have to configure your service using the below screen.

Image_4_New.png

4.1 Go to Resource Management=> Key and Endpoint-: here you can find the Key1/Key2 and Endpoint for Further use in the .net core application.

Image_4.1_New.png

4.2 Model Deployment -: Now click on Model Deployment just below Resource Management. You will be redirected to the below screen Azure OpenAi Studio.

4.2.1 Click On Create Deployment as shown in the figure

4.2.2 Select the model that you want to use for the Chat application fill in other pieces of information and create. This will be ready to use in code within 5 minutes of creation.

Image4.2.2.png

4.2.3 Click on your newly created deployment and you can query here or ask any question you will get the response.

Image4.2.3.png

Note:

Click on View Code as shown in the above figure and you will get the code for the chat completion as below figure.

SampleCode.png

2. .NET Core Application:

2.1 Create a .net core MVC application and create a controller service and view to show the response of the application. You can use the above code in the service to get the response of chat completion.

Controller

controller.png

Service

service.png

2.2 Create an MVC view for the input question call your controller method and test the code. Here is the output the application is returning the correct answer for the question.

Q- Who founded Microsoft?

A - Microsoft was founded by Bill Gates and Paul Allen on April 4, 1975.

chatbot.png

Incorporating Azure OpenAI into chat application development opens up a world of possibilities for creating intelligent and responsive user experiences. By leveraging the power of AI, businesses can enhance customer interactions, streamline operations, and stay ahead of the competition.

About Author

Jitendra Gotwal.png Jitendra Gotwal is a Team Lead at The One Technologies, where he has been making significant contributions to development. Starting his career as a junior developer, Jitendra has gained extensive experience across various domains including ERP, logistics, and finance, while honing his expertise in Microsoft .NET technologies, API integrations, and Azure. With a passion for learning new technologies and a keen interest in cricket and badminton, Jitendra aims to advance his career towards becoming a System Architect.

Certified By