Exploration of Azure OpenAI
Follow an overview of Azure Open AI and its significance in the field of artificial intelligence, learning how to build intelligent applications.
Join the DZone community and get the full member experience.
Join For FreeRecently, I completed a cloud skills challenge by Microsoft (Azure Open AI service), and it inspired me to write and share my learnings with the community, particularly those who haven't yet had the chance to complete the challenge. As it's going to be a vast area, I have chosen to divide this subject into multiple parts.
In this introductory part of the series, I will provide an overview of Azure Open AI and its significance in the field of Artificial Intelligence. We'll discuss the collaboration between Microsoft Azure and OpenAI, highlighting the vision of democratizing AI and making it accessible to everyone by utilizing the Azure Ecosystem.
What Is Azure OpenAI?
As you are aware, the ChatGPT announcement was made back in November 2022, which was an AI language model developed by OpenAI, capable of generating human-like text based on NLU prompts. It has disrupted the way we think about incorporating AI models into our products. Azure OpenAI is a collaboration between Microsoft Azure and OpenAI, to bring innovation and accessibility in AI technology, empowering developers to create intelligent solutions with ease by leveraging Azure Ecosystem. This initiative builds upon the groundbreaking work of OpenAI and brings these AI models to the Azure Ecosystem, which can be consumed through APIs and SDKs.
Prerequisites
Creating Azure OpenAI Resource
Once you have obtained access to Azure OpenAI service, login to the Azure portal or Azure OpenAI studio to create Azure OpenAI resource. The screenshots below are from the Azure portal:
You can also create an Azure Open AI service resource using Azure CLI by running the following command:
az cognitiveservices account create -n <nameoftheresource> -g <Resourcegroupname> -l <location> \
--kind OpenAI --sku s0 --subscription subscriptionID
You can see your resource from Azure OpenAI studio as well by navigating to this page and selecting the resource that was created from:
Deploy a Model
Azure OpenAI includes several types of base models as shown in the studio when you navigate to the Deployments tab. You can also create your own custom models by using existing base models as per your requirements.
Let's use the GPT-35-turbo model to create a chatbot and see how to consume it in the Azure OpenAI studio. Fill in the details and click Create.
Once the model is deployed, you can now use the chat playground to interact with it. Select the model that you created in the configuration section and interact with it. You can also change the setup and select different templates available, or you can create a new template of your choice. For more details, refer to the Microsoft documentation on prompt engineering techniques to experiment with prompts and system messages.
Congrats! With just a few clicks, you were able to create your own GPT- 35 turbo Chatbot and were able to play with it using chat playground. Now, let's see how to deploy and consume it using C# code.
Deploy Your Model to Web App
Click on the Deploy to button on the right corner of the screenshot above to deploy it to a new web app.
You can create a new web app or update an existing web app. I chose to create a new web app by entering the required details. Click Deploy, which takes approximately 10 minutes to complete deployment.
Click on the Notifications icon on the top to see the status at any time.
- Note: Checking the "Enable chat history in the web app" checkbox will incur CosmosDB usage to your account. Open AI Chatbot also uses CosmosDB to store chat history. ;)
After your web app has deployed successfully, use the button at the top right of the Chat playground page to launch the web app or directly from notifications. The app may take a few minutes to launch. If prompted, accept the permissions request.
Once the web app is launched, it will look similar to Chat GPT where you can interact and ask questions:
Summary
In this introductory article, I shared my journey inspired by completing the Microsoft Cloud skills challenge, diving into the significance of Azure OpenAI. Through collaboration between Microsoft Azure and OpenAI, developers like myself can harness AI technology, democratizing its accessibility within Azure's ecosystem. I walked through the creation of Azure OpenAI resources, deploying models such as GPT-3.5 turbo for chatbots, and deploying them as web applications.
Congratulations on embarking on this journey with me! Stay tuned for the next installment, where we'll explore invoking the model in C# code using REST APIs and SDKs.
Opinions expressed by DZone contributors are their own.
Comments