You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: learn-pr/azure/open-ai-dotnet-text-completions/includes/1-introduction.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,6 @@ You input some text as a prompt, and the model generates a completion that attem
4
4
5
5
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.
6
6
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.
8
8
9
9
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.
Copy file name to clipboardExpand all lines: learn-pr/azure/open-ai-dotnet-text-completions/includes/2-azure-openai-text-completions-overview.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ The completions endpoint is the core component of the API service. This API prov
12
12
13
13
## Text completions
14
14
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.
16
16
17
17
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.
18
18
@@ -72,7 +72,7 @@ Sentiment classifications:
72
72
1.
73
73
```
74
74
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.
76
76
77
77
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.
78
78
@@ -86,19 +86,19 @@ One of the most powerful yet simplest tasks you can accomplish with the various
86
86
87
87
### Conversation
88
88
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.
90
90
91
91
### Transformation
92
92
93
93
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.
94
94
95
95
#### Translation
96
96
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.
98
98
99
99
#### Conversion
100
100
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.
102
102
103
103
Here we expect the output to be an emoji representation of the Spider-Man movie.
104
104
@@ -130,7 +130,7 @@ Vertical farming provides a novel solution for producing food locally, reducing
130
130
131
131
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.
132
132
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.
134
134
135
135
***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.
Copy file name to clipboardExpand all lines: learn-pr/azure/open-ai-dotnet-text-completions/includes/3-chat-completions.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ You can customize the system role for your use case or just include basic instru
32
32
33
33
### The user and assistant roles
34
34
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.
36
36
37
37
The message the user sends to the model should follow best practices for designing prompts in order to get the highest quality responses.
38
38
@@ -44,7 +44,7 @@ Here are a few examples of different styles of prompts that you could use with t
44
44
45
45
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."
46
46
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.
Copy file name to clipboardExpand all lines: learn-pr/azure/open-ai-dotnet-text-completions/includes/4-exercise-install-sdk-create-completion.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ The first step is to create the Azure OpenAI resource and deploy the model. Let'
13
13
* An Azure subscription
14
14
* Access granted to Azure OpenAI in the desired subscription
15
15
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).
@@ -71,7 +71,7 @@ Creating the resource and deploying the model is a multi-step process. Use the A
71
71
72
72
::: zone-end
73
73
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.
75
75
76
76
::: zone pivot="cli"
77
77
@@ -97,7 +97,8 @@ Creating the resource and deploying the model is a multi-step process. Use the A
97
97
-n HikingConversationsAI `
98
98
--deployment-name HikingRecommendationTurbo `
99
99
--model-name gpt-35-turbo `
100
-
--model-version "0125" `
100
+
--model-version "0125"
101
+
--model-format OpenAI `
101
102
--sku-capacity 1
102
103
--sku-name "Standard"
103
104
```
@@ -170,7 +171,7 @@ Next up we want to create a bare bones .NET Console application and add the Azur
170
171
cd HikingConversationsAI
171
172
```
172
173
173
-
1. Then add the Azure Open AI SDK.
174
+
1. Then add the Azure OpenAI SDK.
174
175
175
176
```dotnetcli
176
177
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
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.
192
193
1. Finally, instantiate the class needed to communicate with the Azure OpenAI resource.
193
194
194
195
```csharp
@@ -243,7 +244,7 @@ Next we'll send the first message to the model, initiating the conversation.
243
244
Console.WriteLine($"User >>> {userGreeting}");
244
245
```
245
246
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.
247
248
248
249
```csharp
249
250
var chatClient = openAIClient.GetChatClient(openAIDeploymentName);
Copy file name to clipboardExpand all lines: learn-pr/azure/open-ai-dotnet-text-completions/includes/5-improve-completion-quality.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,11 +18,11 @@ When using the Completion API, there's no differentiation between different part
18
18
19
19
### Instructions
20
20
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_.
22
22
23
23
### Primary content
24
24
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._
26
26
27
27
Primary content can be much longer, such as asking the model to summarize a Wikipedia article.
Copy file name to clipboardExpand all lines: learn-pr/azure/open-ai-dotnet-text-completions/includes/6-exercise-improve-completion-quality.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Let's update the hiking recommendation application we started in the previous ex
6
6
7
7
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.
8
8
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.
10
10
11
11
### Add instructions
12
12
@@ -26,7 +26,7 @@ The current system prompt is OK, but we can get the model to recommend more appr
0 commit comments