Skip to content

Commit 975630b

Browse files
committed
fixes
1 parent 7967fc0 commit 975630b

File tree

4 files changed

+16
-20
lines changed

4 files changed

+16
-20
lines changed

docs/ai/quickstarts/includes/clone-sample-repo.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ ms.date: 07/03/2024
55
ms.topic: include
66
---
77

8+
## Clone the sample repository
9+
810
You can create your own app and follow along the steps in the sections ahead, or you can clone the GitHub repository that contains the completed sample apps for all of the quickstarts. The sample repo is also structured as an Azure Developer CLI template that can provision an Azure OpenAI resource for you.
911

1012
```bash

docs/ai/quickstarts/includes/prerequisites-azure-openai.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ ms.date: 05/22/2024
55
ms.topic: include
66
---
77

8+
## Prerequisites
9+
810
- .NET 8 SDK - [Install the .NET 8 SDK](https://dotnet.microsoft.com/download/dotnet/8.0).
911
- An Azure subscription - [Create one for free](https://azure.microsoft.com/free).
1012
- Access to [Azure OpenAI service](/azure/ai-services/openai/overview#how-do-i-get-access-to-azure-openai).

docs/ai/quickstarts/includes/prerequisites-openai.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ ms.date: 07/03/2024
55
ms.topic: include
66
---
77

8+
## Prerequisites
9+
810
- .NET 8.0 SDK - [Install the .NET 8.0 SDK](https://dotnet.microsoft.com/download/dotnet/8.0).
911
- An [API key from OpenAI](https://platform.openai.com/docs/quickstart/account-setup) so you can run this sample.
1012
- On Windows, PowerShell `v7+` is required. To validate your version, run `pwsh` in a terminal. It should return the current version. If it returns an error, execute the following command: `dotnet tool update --global PowerShell`.

docs/ai/quickstarts/quickstart-openai-summarize-text.md

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ zone_pivot_groups: openai-library
1414

1515
In this quickstart, learn how to create a .NET console chat app to connect to and prompt an OpenAI or Azure OpenAI model. The app uses the [`Microsoft.Extensions.AI`](https://www.nuget.org/packages/Microsoft.Extensions.AI) library so you can write code using AI abstractions rather than a specific SDK. AI abstractions enable you to change the underlying AI model with minimal code changes.
1616

17-
## Prerequisites
18-
1917
:::zone target="docs" pivot="openai"
2018

2119
[!INCLUDE [azure-openai-prereqs](includes/prerequisites-azure-openai.md)]
@@ -28,12 +26,12 @@ In this quickstart, learn how to create a .NET console chat app to connect to an
2826

2927
:::zone-end
3028

31-
## Clone the sample repository
32-
3329
[!INCLUDE [clone-sample-repo](includes/clone-sample-repo.md)]
3430

3531
## Create the app
3632

33+
Complete the following steps to create a .NET console app to connect to an AI service.
34+
3735
1. In an empty directory on your computer, use the `dotnet new` command to create a new console app:
3836

3937
```dotnetcli
@@ -48,9 +46,8 @@ In this quickstart, learn how to create a .NET console chat app to connect to an
4846
4947
1. Install the required packages:
5048
51-
:::zone target="docs" pivot="azure-openai"
49+
:::zone target="docs" pivot="azure-openai"
5250
53-
<!-- markdownlint-disable MD046 -->
5451
```bash
5552
dotnet add package Azure.Identity
5653
dotnet add package Azure.AI.OpenAI
@@ -59,19 +56,18 @@ In this quickstart, learn how to create a .NET console chat app to connect to an
5956
dotnet add package Microsoft.Extensions.Configuration.UserSecrets
6057
```
6158
62-
:::zone-end
59+
:::zone-end
6360
64-
:::zone target="docs" pivot="openai"
61+
:::zone target="docs" pivot="openai"
6562
66-
<!-- markdownlint-disable MD046 -->
6763
```bash
6864
dotnet add package OpenAI
6965
dotnet add package Microsoft.Extensions.AI.OpenAI
7066
dotnet add package Microsoft.Extensions.Configuration
7167
dotnet add package Microsoft.Extensions.Configuration.UserSecrets
7268
```
7369
74-
:::zone-end
70+
:::zone-end
7571
7672
1. Open the app in Visual Studio code or your editor of choice
7773
@@ -87,26 +83,20 @@ The app uses the [`Microsoft.SemanticKernel`](https://www.nuget.org/packages/Mic
8783
8884
1. In the **Program.cs** file, add the following code to connect and authenticate to the AI model.
8985
90-
:::zone target="docs" pivot="azure-openai"
86+
:::zone target="docs" pivot="azure-openai"
9187
92-
<!-- markdownlint-disable MD046 -->
9388
:::code language="csharp" source="snippets/prompt-completion/azure-openai/program.cs" range="6-14":::
9489
9590
> [!NOTE]
9691
> `DefaultAzureCredential` searches for credentials from your local tooling. If you are not using the `azd` template to provision the Azure OpenAI resource, you'll need to assign the `Azure AI Developer` role to the account you used to sign-in to Visual Studio or the Azure CLI.
9792
98-
:::zone-end
99-
100-
:::zone target="docs" pivot="azure-openai"
93+
:::zone-end
10194
102-
<!-- markdownlint-disable MD046 -->
103-
# [OpenAI](#tab/openai)
95+
:::zone target="docs" pivot="azure-openai"
10496
10597
:::code language="csharp" source="snippets/prompt-completion/openai/program.cs" range="5-13":::
10698
107-
---
108-
109-
:::zone-end
99+
:::zone-end
110100
111101
1. Read the `benefits.md` file content and use it to create a `prompt` for model. The prompt instructs the model to summarize the file text content.
112102

0 commit comments

Comments
 (0)