Skip to content

Commit 42f45cf

Browse files
committed
Line edits4
1 parent 4c38de9 commit 42f45cf

7 files changed

+22
-21
lines changed

learn-pr/azure/open-ai-dotnet-text-completions/2-azure-openai-text-completions-overview.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ quiz:
1919
choices:
2020
- content: Transformation
2121
isCorrect: false
22-
explanation: Transformation allows the model to summarize, convert and express data in different ways.
23-
- content: Sort data into pre-defined categories
22+
explanation: Transformation allows the model to summarize, convert, and express data in different ways.
23+
- content: Sort data into predefined categories
2424
isCorrect: true
2525
explanation: Classification instructs the model what category to sort the data into and provides some examples.
2626
- content: Translation

learn-pr/azure/open-ai-dotnet-text-completions/includes/1-introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ You input some text as a prompt, and the model generates a completion that attem
44

55
At a practical level, the prompt-based models allow you to develop applications that enable users to ask questions of the model as free-form text, and the model responds with the answer. GPT-3.5 and GPT-4 are even capable of having multi-turn conversations with the users of your application.
66

7-
For example, imagine you want to build an AI that recommends hikes to people based on the preferences they enter for the hike. The AI could ask them what attributes they are looking for, and then respond based on what they input.
7+
For example, imagine you want to build an AI that recommends hikes to people based on the preferences they enter for the hike. The AI could ask them what attributes they're looking for, and then respond based on what they input.
88

99
Let's take a deeper look at both text and completions, how to improve completion quality, and build a simple application that can use Azure OpenAI to chat with the model to get hiking recommendations.

learn-pr/azure/open-ai-dotnet-text-completions/includes/2-azure-openai-text-completions-overview.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The completions endpoint is the core component of the API service. This API prov
1212

1313
## Text completions
1414

15-
In this unit we'll learn about text completions. The completions endpoint can be used for a wide variety of tasks. It provides a simple but powerful text-in, text-out interface to any of the Azure OpenAI models. You input some text as a prompt, and the model generates a text completion that attempts to match whatever context or pattern you gave it. For example, if you give the API the prompt, "As Descartes said, I think, therefore", it returns the completion " I am" with high probability.
15+
In this unit, we'll learn about text completions. The completions endpoint can be used for a wide variety of tasks. It provides a simple but powerful text-in, text-out interface to any of the Azure OpenAI models. You input some text as a prompt, and the model generates a text completion that attempts to match whatever context or pattern you gave it. For example, if you give the API the prompt, "As Descartes said, I think, therefore", it returns the completion " I am" with high probability.
1616

1717
The actual completion results you see may differ because the AI is stochastic by default. In other words, you might get a slightly different completion every time you call it, even if your prompt stays the same.
1818

@@ -72,7 +72,7 @@ Sentiment classifications:
7272
1.
7373
```
7474

75-
After showing the model 4 examples of a sentence classified by sentiment, we then provide it a list of examples and then a list of sentiment ratings with the same number index. The API is able to pick up from this how it is supposed to output the classified sentiments.
75+
After showing the model 4 examples of a sentence classified by sentiment, we then provide it a list of examples and then a list of sentiment ratings with the same number index. The API is able to pick up from this how it's supposed to output the classified sentiments.
7676

7777
That leads us to what we want the model to do: we give it five sentiments to classify, and then it should output the classification of each in an ordered list.
7878

@@ -86,19 +86,19 @@ One of the most powerful yet simplest tasks you can accomplish with the various
8686

8787
### Conversation
8888

89-
The model is extremely adept at carrying on conversations with humans and even with itself. With just a few lines of instruction, we've seen the model perform as a customer service chatbot that intelligently answers questions without ever getting flustered, or a wise-cracking conversation partner that makes jokes and puns.
89+
The model is adept at carrying on conversations with humans and even with itself. With just a few lines of instruction, we've seen the model perform as a customer service chatbot that intelligently answers questions without ever getting flustered, or a wise-cracking conversation partner that makes jokes and puns.
9090

9191
### Transformation
9292

9393
The model is a language model that is familiar with a variety of ways that words and characters can be used to express information. This ranges from natural language text to code and languages other than English. The model is also able to understand content on a level that allows it to summarize, convert, and express it in different ways.
9494

9595
#### Translation
9696

97-
The model already has a grasp of many languages, such as French, so you do not need to teach it. Instead, you just need to provide it enough examples of the translation in the prompt so it understands that it's translating from one language to another.
97+
The model already has a grasp of many languages, such as French, so you don't need to teach it. Instead, you just need to provide it enough examples of the translation in the prompt so it understands that it's translating from one language to another.
9898

9999
#### Conversion
100100

101-
In this example we convert the name of a movie into emoji. This shows the adaptability of the model to picking up patterns and working with other characters.
101+
In this example, we convert the name of a movie into emoji. This shows the adaptability of the model to picking up patterns and working with other characters.
102102

103103
Here we expect the output to be an emoji representation of the Spider-Man movie.
104104

@@ -130,7 +130,7 @@ Vertical farming provides a novel solution for producing food locally, reducing
130130

131131
Large language models (LLMs) have a lot of knowledge that they've learned from the data they trained on. They also have the ability to provide responses that sound real but are in fact made up. There are two ways to limit the likelihood of LLMs making up an answer.
132132

133-
* **1. Provide a ground truth for the API.**: If you provide the model with a body of text to answer questions about (like a Wikipedia entry) it's less likely to confabulate a response.
133+
* **1. Provide a ground truth for the API.**: If you provide the model with a body of text to answer questions about (like a Wikipedia entry), it's less likely to confabulate a response.
134134

135135
* **2. Use a low probability and show the API how to say "I don't know."**: If the model understands that in cases where it's less certain about a response that saying "I don't know" or some variation is appropriate, it's less inclined to make up answers.
136136

learn-pr/azure/open-ai-dotnet-text-completions/includes/3-chat-completions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ You can customize the system role for your use case or just include basic instru
3232

3333
### The user and assistant roles
3434

35-
The conversation happens between a user and the assistant. The user is the person entering prompts and interacting with the model. The responses from the model are represented by the system role.
35+
The conversation happens between a user and the assistant. The user is the person entering prompts and interacting with the model. The system role represents the responses from the model.
3636

3737
The message the user sends to the model should follow best practices for designing prompts in order to get the highest quality responses.
3838

@@ -44,7 +44,7 @@ Here are a few examples of different styles of prompts that you could use with t
4444

4545
If you want the GPT-35-Turbo model to behave similarly to [chat.openai.com](https://chat.openai.com), you can use a basic system message like "Assistant is a large language model trained by OpenAI."
4646

47-
We'll learn how to use the Chat Completion API's .NET SDK in the next unit. For now we'll stick with variable names as an example.
47+
We'll learn how to use the Chat Completion API's .NET SDK in the next unit. For now, we'll stick with variable names as an example.
4848

4949
```csharp
5050

learn-pr/azure/open-ai-dotnet-text-completions/includes/4-exercise-install-sdk-create-completion.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The first step is to create the Azure OpenAI resource and deploy the model. Let'
1313
* An Azure subscription
1414
* Access granted to Azure OpenAI in the desired subscription
1515

16-
Currently, access to this service is granted only by application. You can apply for access to Azure OpenAI by completing the form at [https://aka.ms/oai/access](https://aka.ms/oai/access).
16+
Currently, you can gain access to this service only by application. You can apply for access to Azure OpenAI by completing the form at [https://aka.ms/oai/access](https://aka.ms/oai/access).
1717
* [Azure CLI installed](/cli/azure/install-azure-cli)
1818

1919
### Create a resource and deploying a model
@@ -71,7 +71,7 @@ Creating the resource and deploying the model is a multi-step process. Use the A
7171
7272
::: zone-end
7373
74-
1. Next we want to deploy the GPT-35-Turbo model to the OpenAI resource we created. Call the model deployment **HikingRecommendationTurbo**. Note we're using **HikingConversations-RG** as the resource group name and **HikingConversationsAI** as the OpenAI resource name. If you used different values make sure you substitute those values.
74+
1. Next we want to deploy the GPT-35-Turbo model to the OpenAI resource we created. Call the model deployment **HikingRecommendationTurbo**. Note we're using **HikingConversations-RG** as the resource group name and **HikingConversationsAI** as the OpenAI resource name. If you used different values, make sure you substitute those values.
7575
7676
::: zone pivot="cli"
7777
@@ -97,7 +97,8 @@ Creating the resource and deploying the model is a multi-step process. Use the A
9797
-n HikingConversationsAI `
9898
--deployment-name HikingRecommendationTurbo `
9999
--model-name gpt-35-turbo `
100-
--model-version "0125" `
100+
--model-version "0125"
101+
--model-format OpenAI `
101102
--sku-capacity 1
102103
--sku-name "Standard"
103104
```
@@ -170,7 +171,7 @@ Next up we want to create a bare bones .NET Console application and add the Azur
170171
cd HikingConversationsAI
171172
```
172173
173-
1. Then add the Azure Open AI SDK.
174+
1. Then add the Azure OpenAI SDK.
174175
175176
```dotnetcli
176177
dotnet add package Azure.AI.OpenAI --prerelease
@@ -188,7 +189,7 @@ Next up we want to create a bare bones .NET Console application and add the Azur
188189
string openAIDeploymentName = "HikingRecommendationTurbo";
189190
```
190191
191-
In the steps above, we named the deployment **HikingRecommendationTurbo**. If you used a different value make sure you use that instead.
192+
In the preceding steps, we named the deployment **HikingRecommendationTurbo**. If you used a different value, make sure you use that instead.
192193
1. Finally, instantiate the class needed to communicate with the Azure OpenAI resource.
193194
194195
```csharp
@@ -243,7 +244,7 @@ Next we'll send the first message to the model, initiating the conversation.
243244
Console.WriteLine($"User >>> {userGreeting}");
244245
```
245246
246-
1. Now you will need to get a reference to the `ChatClient` object. This object is responsible for facilitating chat conversations with the model. As such, you'll need to tell the Azure OpenAI Client object which model that you deployed you want to use.
247+
1. Now you'll need to get a reference to the `ChatClient` object. This object is responsible for facilitating chat conversations with the model. As such, you'll need to tell the Azure OpenAI Client object which model that you deployed you want to use.
247248
248249
```csharp
249250
var chatClient = openAIClient.GetChatClient(openAIDeploymentName);

learn-pr/azure/open-ai-dotnet-text-completions/includes/5-improve-completion-quality.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ When using the Completion API, there's no differentiation between different part
1818

1919
### Instructions
2020

21-
Instructions are likely the most commonly used prompt component. They're the part of the prompt that tells the model what to do and can range from simple to complex. For example, _Recommend hikes_ to _You're a hiking enthusiast who helps people discover fun hikes in their area. You're upbeat and friendly. You introduce yourself when first saying hello. When helping people out, you always ask them where they're located, and the hiking intensity desired to inform the hiking recommendation you provide_.
21+
Instructions are likely the most commonly used prompt component. They're the part of the prompt that tells the model what to do and can range from simple to complex. For example, _Recommend hikes_ to _You're a hiking enthusiast who helps people discover fun hikes in their area. You're upbeat and friendly. You introduce yourself when first saying hello. When helping people, you always ask them where they're located, and the hiking intensity desired to inform the hiking recommendation you provide_.
2222

2323
### Primary content
2424

25-
Primary content refers to some sort of text being processed or transformed by the model. It's typically used in conjunction with instructions. For example, _You'll then provide three suggestions for nearby hikes that vary in length after you get that information._
25+
Primary content refers to the model processing or transforming some sort of text. It's typically used in conjunction with instructions. For example, _You'll then provide three suggestions for nearby hikes that vary in length after you get that information._
2626

2727
Primary content can be much longer, such as asking the model to summarize a Wikipedia article.
2828

learn-pr/azure/open-ai-dotnet-text-completions/includes/6-exercise-improve-completion-quality.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Let's update the hiking recommendation application we started in the previous ex
66

77
When classifying a product review, we only want the model to tell us if the review is positive, neutral, or negative. Let's update the prompt the model receives so it has the best chance of providing a high-quality response.
88

9-
The current system prompt is OK, but we can get the model to recommend more appropriate and exciting hikes by following best practices in prompt construction. Let's make the instructions on how the model should act a bit more clear.
9+
The current system prompt is OK, but we can get the model to recommend more appropriate and exciting hikes by following best practices in prompt construction. Let's make the instructions on how the model should act clearer.
1010

1111
### Add instructions
1212

@@ -26,7 +26,7 @@ The current system prompt is OK, but we can get the model to recommend more appr
2626

2727
### Add primary content
2828

29-
The primary content refers to the text that is being transformed by the model and what to do with it. In this case the hiking recommendations themselves.
29+
The primary content refers to the text that the model is transforming and what to do with it. In this case, the hiking recommendations themselves.
3030

3131
1. Update the `systemPrompt` variable to instruct the model what to do with the content.
3232

0 commit comments

Comments
 (0)