Skip to content

Commit fabc448

Browse files
committed
fixes
1 parent 62e9cc1 commit fabc448

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

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

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ zone_pivot_groups: openai-library
1212

1313
# Connect to and prompt an AI model using .NET
1414

15-
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.
15+
In this quickstart, you 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.
16+
17+
> [!NOTE]
18+
> The [`Microsoft.Extensions.AI`](https://www.nuget.org/packages/Microsoft.Extensions.AI/) library is currently in Preview.
1619
1720
:::zone target="docs" pivot="openai"
1821

@@ -26,11 +29,13 @@ In this quickstart, learn how to create a .NET console chat app to connect to an
2629

2730
:::zone-end
2831

32+
[!INCLUDE [semantic-kernel](../../azure/includes/semantic-kernel.md)]
33+
2934
[!INCLUDE [clone-sample-repo](includes/clone-sample-repo.md)]
3035

3136
## Create the app
3237

33-
Complete the following steps to create a .NET console app to connect to an AI service.
38+
Complete the following steps to create a .NET console app to connect to an AI model.
3439

3540
1. In an empty directory on your computer, use the `dotnet new` command to create a new console app:
3641

@@ -90,19 +95,14 @@ Complete the following steps to create a .NET console app to connect to an AI se
9095
```bash
9196
dotnet user-secrets init
9297
dotnet user-secrets set OpenAIKey <your-openai-key>
93-
```
94-
95-
1. Use the `dotnet run` command to run the app:
96-
97-
```dotnetcli
98-
dotnet run
98+
dotnet user-secrets set ModelName <your-openai-model-name>
9999
```
100100
101101
:::zone-end
102102
103103
## Add the app code
104104
105-
The app uses the [`Microsoft.SemanticKernel`](https://www.nuget.org/packages/Microsoft.SemanticKernel) package to send and receive requests to the OpenAI service.
105+
The app uses the [`Microsoft.Extensions.AI`](https://www.nuget.org/packages/Microsoft.Extensions.AI/) package to send and receive requests to the AI model.
106106
107107
1. In the **Program.cs** file, add the following code to connect and authenticate to the AI model.
108108
@@ -129,7 +129,15 @@ The app uses the [`Microsoft.SemanticKernel`](https://www.nuget.org/packages/Mic
129129
130130
:::code language="csharp" source="snippets/prompt-completion/openai/program.cs" range="20-22":::
131131
132-
Customize the text content of the `benefits.md` file or the length of the summary to see the differences in the responses.
132+
1. Use the `dotnet run` command to run the app:
133+
134+
```dotnetcli
135+
dotnet run
136+
```
137+
138+
The app prints out the completion response from the AI model. Customize the text content of the `benefits.md` file or the length of the summary to see the differences in the responses.
139+
140+
:::zone target="docs" pivot="azure-openai"
133141
134142
## Clean up resources
135143
@@ -139,6 +147,8 @@ When you no longer need the sample application or resources, remove the correspo
139147
azd down
140148
```
141149

150+
:::zone-end
151+
142152
## Next steps
143153

144154
- [Quickstart - Build an AI chat app with .NET](get-started-openai.md)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
> [!NOTE]
2+
> You can also use [Semantic Kernel](/semantic-kernel) to accomplish the tasks in this article. Semantic Kernel is a lightweight, open-source development kit that lets you easily build AI agents and integrate the latest AI models into your C#, Python, or Java codebase.

0 commit comments

Comments
 (0)