Skip to content

Commit baadf70

Browse files
author
Maryanne Gichohi
committed
Address PR comments
1 parent a724f33 commit baadf70

File tree

2 files changed

+25
-11
lines changed

2 files changed

+25
-11
lines changed

articles/azure-app-configuration/howto-chat-completion-config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ You successfully added your chat completion configuration named **ChatApp:ChatCo
4343
> This tutorial demonstrates how to use chat completion configuration with an Azure OpenAI model. However, the chat completion configuration demonstrated in the tutorial can be applied to any AI model you choose to work with in your application.
4444
>
4545
46-
1. Follow the [Get started with Azure OpenAI Service](/azure/ai-services/openai/overview#get-started-with-azure-openai-service) to create and deploy an Azure OpenAI service resource with a **gpt-4o** model. Note down the deployment name for later use.
46+
1. Follow the [Get started with Azure OpenAI Service](/azure/ai-foundry/openai/how-to/create-resource) to create and deploy an Azure OpenAI service resource with a **gpt-4o** model. Note down the deployment name for later use.
4747

4848
1. In your Azure OpenAI resource, from the **Resource Management** menu, select **Keys and Endpoint** and copy the Azure OpenAI resource endpoint. It should follow the format: `https://<open-ai-resource-name>.openai.azure.com`. If using the API key for authentication, copy the API key as well.
4949

articles/azure-app-configuration/quickstart-chat-completion-dotnet.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ ms.collection: ce-skilling-ai-copilot
1717

1818
# Use chat completion configuration in a .NET console app
1919

20-
In this guide, you build an AI chat application and iterate on the prompt using chat completion configuration dynamically loaded from Azure App Configuration. Full [sample source code](https://github.com/Azure/AppConfiguration/tree/main/examples/DotNetCore/ChatApp) available.
20+
In this guide, you build an AI chat application and iterate on the prompt using chat completion configuration dynamically loaded from Azure App Configuration.
21+
22+
The full sample source code is available in the [Azure App Configuration GitHub repository](https://github.com/Azure/AppConfiguration/tree/main/examples/DotNetCore/ChatApp).
2123

2224
## Prerequisites
2325

@@ -162,6 +164,10 @@ In this guide, you build an AI chat application and iterate on the prompt using
162164
1. Next, update the existing code in the _Program.cs_ file to refresh the configuration from Azure App Configuration, apply the latest AI configuration values to the chat completion settings, and retrieve a response from the AI model.
163165
164166
```csharp
167+
// Initialize chat conversation
168+
var chatConversation = new List<ChatMessage>();
169+
Console.WriteLine("Chat started! What's on your mind?");
170+
165171
while (true)
166172
{
167173
// Get user input
@@ -175,6 +181,8 @@ In this guide, you build an AI chat application and iterate on the prompt using
175181
break;
176182
}
177183
184+
chatConversation.Add(ChatMessage.CreateUserMessage(userInput));
185+
178186
// Refresh the configuration from Azure App Configuration
179187
await refresher.RefreshAsync();
180188
@@ -188,8 +196,6 @@ In this guide, you build an AI chat application and iterate on the prompt using
188196
TopP = chatCompletionConfiguration.TopP
189197
};
190198
191-
chatConversation.Add(ChatMessage.CreateUserMessage(userInput));
192-
193199
// Get latest system message from AI configuration
194200
var chatMessages = new List<ChatMessage>(GetChatMessages(chatCompletionConfiguration));
195201
chatMessages.AddRange(chatConversation);
@@ -263,6 +269,8 @@ In this guide, you build an AI chat application and iterate on the prompt using
263269
break;
264270
}
265271
272+
chatConversation.Add(ChatMessage.CreateUserMessage(userInput));
273+
266274
// Refresh the configuration from Azure App Configuration
267275
await refresher.RefreshAsync();
268276
@@ -275,8 +283,6 @@ In this guide, you build an AI chat application and iterate on the prompt using
275283
TopP = chatCompletionConfiguration.TopP
276284
};
277285
278-
chatConversation.Add(ChatMessage.CreateUserMessage(userInput));
279-
280286
// Get latest system message from AI configuration
281287
var chatMessages = new List<ChatMessage>(GetChatMessages(chatCompletionConfiguration));
282288
chatMessages.AddRange(chatConversation);
@@ -356,21 +362,29 @@ In this guide, you build an AI chat application and iterate on the prompt using
356362
dotnet run
357363
```
358364
359-
You should see the following output:
365+
366+
1. Type the message "What is your name?" when prompted with "You:" and then press the Enter key.
360367
361368
```Output
362369
Chat started! What's on your mind?
370+
You: What is your name ?
371+
AI: I’m your helpful assistant! I don’t have a personal name, but you can call me whatever you’d like.
372+
😊 Do you have a name in mind?
363373
```
364374
365375
1. In Azure portal, select the App Configuration store instance that you created. From the **Operations** menu, select **Configuration explorer** and select the **ChatApp:ChatCompletion** key. Update the value of the Messages property:
366376
- Role: **system**
367377
- Content: "You are a pirate and your name is Eddy."
368378
369-
1. Type your message when prompted with "You:". Be sure to wait a few moments for the refresh interval to elapse, and then press the Enter key to see the updated AI response in the output.
379+
1. Type the same message when prompted with "You:". Be sure to wait a few moments for the refresh interval to elapse, and then press the Enter key to see the updated AI response in the output.
370380
371381
```Output
372382
Chat started! What's on your mind?
373-
You: Hello, what is your name ?
374-
AI: Ahoy, matey! Me name be Captain Eddy,
375-
the most fearsome pirate to ever sail the seven seas! What be yer name, landlubber?
383+
You: What is your name ?
384+
AI: I’m your helpful assistant! I don’t have a personal name, but you can call me whatever you’d like.
385+
😊 Do you have a name in mind?
386+
387+
You: What is your name ?
388+
AI: Arrr, matey! Me name be Eddy, the most fearsome pirate to ever sail the seven seas!
389+
What be yer name, landlubber?
376390
```

0 commit comments

Comments
 (0)