Skip to content

Commit a256000

Browse files
committed
line fixes
1 parent 75a53a6 commit a256000

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,12 @@ Complete the following steps to create a .NET console app to connect to an AI se
7575
code .
7676
```
7777
78+
:::zone target="docs" pivot="azure-openai"
79+
7880
[!INCLUDE [create-ai-service](includes/create-ai-service.md)]
7981
82+
:::zone-end
83+
8084
## Add the app code
8185
8286
The app uses the [`Microsoft.SemanticKernel`](https://www.nuget.org/packages/Microsoft.SemanticKernel) package to send and receive requests to the OpenAI service.
@@ -85,7 +89,7 @@ The app uses the [`Microsoft.SemanticKernel`](https://www.nuget.org/packages/Mic
8589
8690
:::zone target="docs" pivot="azure-openai"
8791
88-
:::code language="csharp" source="snippets/prompt-completion/azure-openai/program.cs" range="6-14":::
92+
:::code language="csharp" source="snippets/prompt-completion/azure-openai/program.cs" range="1-12":::
8993
9094
> [!NOTE]
9195
> `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.
@@ -94,17 +98,17 @@ The app uses the [`Microsoft.SemanticKernel`](https://www.nuget.org/packages/Mic
9498
9599
:::zone target="docs" pivot="openai"
96100
97-
:::code language="csharp" source="snippets/prompt-completion/openai/program.cs" range="5-13":::
101+
:::code language="csharp" source="snippets/prompt-completion/openai/program.cs" range="1-11":::
98102
99103
:::zone-end
100104
101105
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.
102106
103-
:::code language="csharp" source="snippets/prompt-completion/openai/program.cs" range="15-20":::
107+
:::code language="csharp" source="snippets/prompt-completion/openai/program.cs" range="13-18":::
104108
105109
1. Call the `InvokePromptAsync` function to send the `prompt` to the model to generate a response.
106110
107-
:::code language="csharp" source="snippets/prompt-completion/openai/program.cs" range="22-24":::
111+
:::code language="csharp" source="snippets/prompt-completion/openai/program.cs" range="20-22":::
108112
109113
Customize the text content of the `benefits.md` file or the length of the summary to see the differences in the responses.
110114

docs/ai/quickstarts/snippets/prompt-completion/azure-openai/Program.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
.AsChatClient(deployment);
1313

1414
// Create and print out the prompt
15-
string prompt = $"""
16-
Please summarize the the following text in 20 words or less:
17-
{File.ReadAllText("benefits.md")}
18-
""";
15+
string prompt =
16+
$"""Please summarize the the following text in 20 words or less:
17+
{File.ReadAllText("benefits.md")}""";
18+
1919
Console.WriteLine($"user >>> {prompt}");
2020

2121
// Submit the prompt and print out the response

docs/ai/quickstarts/snippets/prompt-completion/openai/Program.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
new OpenAIClient(key).AsChatClient(model);
1212

1313
// Create and print out the prompt
14-
string prompt = $"""
15-
Please summarize the the following text in 20 words or less:
16-
{File.ReadAllText("benefits.md")}
17-
""";
14+
string prompt =
15+
$"""Please summarize the the following text in 20 words or less:
16+
{File.ReadAllText("benefits.md")}""";
17+
1818
Console.WriteLine($"user >>> {prompt}");
1919

2020
// Submit the prompt and print out the response

0 commit comments

Comments
 (0)