Skip to content

Commit 9772b2b

Browse files
authored
Merge pull request #49806 from lootle1/MR85
Technical Review 1037447: Generate text and conversations with .NET a…
2 parents 2a8da64 + 42f45cf commit 9772b2b

15 files changed

+93
-92
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
uid: learn.azure.open-ai-dotnet-text-completions.1-introduction
33
title: Introduction
44
metadata:
5-
title: Introduction to text completions with .NET and Azure OpenAI
5+
title: Introduction to Text Completions with .NET and Azure OpenAI
66
description: An introduction to text completions using the .NET SDK to access the Azure OpenAI service
7-
ms.date: 08/29/2024
7+
ms.date: 04/01/2025
88
author: codemillmatt
99
ms.author: masoucou
1010
ms.topic: unit

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
uid: learn.azure.open-ai-dotnet-text-completions.2-azure-openai-text-completions-overview
33
title: Overview Azure OpenAI and text completions
44
metadata:
5-
title: Overview Azure OpenAI and Text completions
5+
title: Overview Azure OpenAI and Text Completions
66
description: An overview of what Azure OpenAI is and the benefits of using text completions to query your data
7-
ms.date: 08/29/2024
7+
ms.date: 04/01/2025
88
author: codemillmatt
99
ms.author: masoucou
1010
ms.topic: unit
@@ -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/3-chat-completions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
uid: learn.azure.open-ai-dotnet-text-completions.3-chat-completions
33
title: Work with text completions in Azure OpenAI
44
metadata:
5-
title: Work with text completions in Azure OpenAI
5+
title: Work with Text Completions in Azure OpenAI
66
description: Add conversation-in and message-out capabilities to your applications with Azure OpenAI text completions
7-
ms.date: 08/29/2024
7+
ms.date: 04/01/2025
88
author: codemillmatt
99
ms.author: masoucou
1010
ms.topic: unit

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
uid: learn.azure.open-ai-dotnet-text-completions.4-exercise-install-sdk-create-completion
33
title: Exercise - Install the .NET SDK for Azure OpenAI and create your first app
44
metadata:
5-
title: Exercise - Install the .NET SDK for Azure OpenAI and create your first app
5+
title: Exercise - Install the .NET SDK for Azure OpenAI and Create Your First App
66
description: Install the .NET SDK for Azure OpenAI and create your first app with text completions
77
zone_pivot_groups: azure-shell-interface
8-
ms.date: 08/29/2024
8+
ms.date: 04/01/2025
99
author: codemillmatt
1010
ms.author: masoucou
1111
ms.topic: unit

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
uid: learn.azure.open-ai-dotnet-text-completions.5-improve-completion-quality
33
title: Understand prompts to improve completion quality
44
metadata:
5-
title: Understand prompts to improve completion quality
5+
title: Understand Prompts to Improve Completion Quality
66
description: How to improve prompts to increase the quality of the text completion results
7-
ms.date: 08/29/2024
7+
ms.date: 04/01/2025
88
author: codemillmatt
99
ms.author: masoucou
1010
ms.topic: unit

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
uid: learn.azure.open-ai-dotnet-text-completions.6-exercise-improve-completion-quality
33
title: Exercise - Improve completion quality
44
metadata:
5-
title: Use prompt engineering to improve the text completion result quality
5+
title: Use Prompt Engineering to Improve the Text Completion Result Quality
66
description: Use prompt engineering to improve the text completion result quality
7-
ms.date: 08/29/2024
7+
ms.date: 04/01/2025
88
author: codemillmatt
99
ms.author: masoucou
1010
ms.topic: unit

learn-pr/azure/open-ai-dotnet-text-completions/7-summary.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Summary
44
metadata:
55
title: Summary
66
description: Summary of using text completions, chat completions, and prompt engineering with .NET and Azure OpenAI
7-
ms.date: 08/29/2024
7+
ms.date: 04/01/2025
88
author: codemillmatt
99
ms.author: masoucou
1010
ms.topic: unit
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
The GPT-3.5, and GPT-4 models from OpenAI are prompt-based optimized for conversational interfaces. With prompt-based models, the user interacts with the model by entering a text prompt, to which the model responds with a text or chat completion. This completion is the model's continuation of the input text.
1+
The GPT-3.5 and GPT-4 models from OpenAI are prompt-based optimized for conversational interfaces. With prompt-based models, the user interacts with the model by entering a text prompt, to which the model responds with a text or chat completion. This completion is the model's continuation of the input text.
22

33
You input some text as a prompt, and the model generates a completion that attempts to match whatever context or pattern you gave it. For example, if you give the AI the prompt, "As Descartes said, I think, therefore", it returns the completion " I am" with high probability.
44

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.
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.
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: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Azure OpenAI Service provides REST API access to OpenAI's powerful language models including the GPT-3.5 and GPT-4 model series. These models can be easily adapted to your specific task including but not limited to content generation, summarization, semantic search, and natural language to code translation.
1+
Azure OpenAI Service provides REST API access to OpenAI's powerful language models, including the GPT-3.5 and GPT-4 model series. These models can be easily adapted to your specific task including but not limited to content generation, summarization, semantic search, and natural language to code translation.
22

3-
In addition to the REST API access, a .NET SDK exists to access Azure OpenAI Service. And that's what we will use to build our application. But before building the application, let's learn a bit more about what Azure OpenAI is and what text completions are. Knowing that give us the foundation we need to build amazing applications with AI.
3+
In addition to the REST API access, a .NET SDK exists to access Azure OpenAI Service. That's what we'll use to build our application. But before building the application, let's learn a bit more about what Azure OpenAI is and what text completions are. Knowing that gives us the foundation we need to build amazing applications with AI.
44

55
## Azure OpenAI overview
66

@@ -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

@@ -22,15 +22,15 @@ We'll take a look at how to write a good prompt a bit later, but for now let's l
2222

2323
## Types of Azure OpenAI completions
2424

25-
As mentioned, you pass in a prompt to the Azure OpenAI API that provides instructions on what you want it to do. And you can make it do things like classify text, generate ideas, or even translate text into emojis.
25+
As mentioned, you pass in a prompt to the Azure OpenAI API that provides instructions on what you want it to do. You can make it do things like classify text, generate ideas, or even translate text into emojis.
2626

2727
### Classification
2828

2929
For this first completion type, let's dive deep into how to "program" the model with instructions.
3030

3131
You can tell the model you want it to sort data into predefined categories. This completion type is known as **Classification**.
3232

33-
For example, you can pass instructions, or a prompt, similar to following to the completion API:
33+
For example, you can pass instructions or a prompt, similar to following to the completion API:
3434

3535
```
3636
This is a sentiment classifier
@@ -72,33 +72,33 @@ 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

77-
And that leads us to what we want the model to do: we give it 5 sentiments for it to classify and then it should output the classification of each in an ordered list.
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.
7878

7979
This allows the model to rate five (and even more) examples in just one call to it.
8080

81-
You can begin to see how the prompt, or the text passed to the model is the programming language.
81+
You can begin to see how the prompt or the text passed to the model is the programming language.
8282

8383
### Generation
8484

85-
One of the most powerful yet simplest tasks you can accomplish with the various GPT models is generating new ideas or versions of input. You can give the model a list of a few story ideas and it tries to add to that list. We've seen it create business plans, character descriptions and marketing slogans just by providing it a handful of examples.
85+
One of the most powerful yet simplest tasks you can accomplish with the various GPT models is generating new ideas or versions of input. You can give the model a list of a few story ideas, and it tries to add to that list. We've seen it create business plans, character descriptions, and marketing slogans just by providing it a handful of examples.
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

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.
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.
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 is 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,9 +130,9 @@ 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 is 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

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 is less inclined to make up answers.
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.
136136

137137
In this example, we give the model examples of questions and answers it knows and then examples of things it wouldn't know and provide question marks. We also set the probability to zero so the model is more likely to respond with a "?" if there's any doubt.
138138

@@ -147,11 +147,11 @@ Q: What is Devz9?
147147
A: ?
148148
149149
Q: Who is George Lucas?
150-
A: George Lucas is American film director and producer famous for creating Star Wars.
150+
A: George Lucas is an American film director and producer famous for creating Star Wars.
151151
```
152152

153153
## Summary
154154

155-
Azure OpenAI Service provides REST API access to OpenAI's powerful language models including the GPT-3.5 and GPT-4 model series. It also gives you the security and enterprise features you've come to rely from the Azure cloud.
155+
Azure OpenAI Service provides REST API access to OpenAI's powerful language models including the GPT-3.5 and GPT-4 model series. It also gives you the security and enterprise features you've come to rely on from the Azure cloud.
156156

157157
One of the most useful features from the OpenAI language models is text completion. You pass in a **prompt** or a plain language description of what you want the model to do, and it can perform tasks such as text classification, text generation, or text summarization.

0 commit comments

Comments
 (0)