Utilize prompt engineering in your app
When working with the Azure OpenAI Service, how developers shape their prompt greatly impacts how the generative AI model will respond. Azure OpenAI models are able to tailor and format content, if requested in a clear and concise way. In this exercise, you'll learn how different prompts for similar content help shape the AI model's response to better satisfy your requirements.
In scenario for this exercise, you will perform the role of a software developer working on a wildlife marketing campaign. You are exploring how to use generative AI to improve advertising emails and categorize articles that might apply to your team. The prompt engineering techniques used in the exercise can be applied similarly for a variety of use cases.
Provision an Azure OpenAI resource
If you don't already have one, provision an Azure OpenAI resource in your Azure subscription.
Sign into the Azure portal at
https://portal.azure.com
.Create an Azure OpenAI resource with the following settings:
Subscription: Select an Azure subscription that has been approved for access to the Azure OpenAI service
Resource group: Choose or create a resource group
Region: Make a random choice from any of the following regions*
Australia East
Canada East
East US
East US 2
France Central
Japan East
North Central US
Sweden Central
Switzerland North
UK South
Name: A unique name of your choice
Pricing tier: Standard S0
* Azure OpenAI resources are constrained by regional quotas. The listed regions include default quota for the model type(s) used in this exercise. Randomly choosing a region reduces the risk of a single region reaching its quota limit in scenarios where you are sharing a subscription with other users. In the event of a quota limit being reached later in the exercise, there's a possibility you may need to create another resource in a different region.
Wait for deployment to complete. Then go to the deployed Azure OpenAI resource in the Azure portal.
Deploy a model
Azure provides a web-based portal named Azure AI Foundry portal, that you can use to deploy, manage, and explore models. You'll start your exploration of Azure OpenAI by using Azure AI Foundry portal to deploy a model.
Note: As you use Azure AI Foundry portal, message boxes suggesting tasks for you to perform may be displayed. You can close these and follow the steps in this exercise.
In the Azure portal, on the Overview page for your Azure OpenAI resource, scroll down to the Get Started section and select the button to go to AI Foundry portal (previously AI Studio).
In Azure AI Foundry portal, in the pane on the left, select the Deployments page and view your existing model deployments. If you don't already have one, create a new deployment of the gpt-35-turbo-16k model with the following settings:
Deployment name: A unique name of your choice
Model: gpt-35-turbo-16k (if the 16k model isn't available, choose gpt-35-turbo)
Model version: Use default version
Deployment type: Standard
Tokens per minute rate limit: 5K*
Content filter: Default
Enable dynamic quota: Disabled
* A rate limit of 5,000 tokens per minute is more than adequate to complete this exercise while leaving capacity for other people using the same subscription.
Explore prompt engineering techniques
Let's start by exploring some prompt engineering techniques in the Chat playground.
In the Playground section, select the Chat page. The Chat playground page consists of a row of buttons and two main panels (which may be arranged right-to-left horizontally, or top-to-bottom vertically depending on your screen resolution):
Configuration - used to select your deployment, define system message, and set parameters for interacting with your deployment.
Chat session - used to submit chat messages and view responses.
Under Deployments, ensure that your gpt-35-turbo-16k model deployment is selected.
Review the default System message, which should be You are an AI assistant that helps people find information.
In the Chat session, submit the following query:
Last updated