Skip to content

Commit 0f0eb90

Browse files
Merge pull request #43264 from dotnet/main
Merge main into live
2 parents c25cb90 + 632d183 commit 0f0eb90

File tree

37 files changed

+231
-99
lines changed

37 files changed

+231
-99
lines changed

.github/workflows/clean-repo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
egress-policy: audit
2323

24-
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
24+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2525

2626
# Call clean repo
2727
- name: Clean repo

.github/workflows/dependabot-bot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
with:
3131
egress-policy: audit
3232

33-
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
33+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3434
# - name: Setup .NET
3535
# uses: actions/setup-dotnet@4d4a70f4a5b2a5a5329f13be4ac933f2c9206ac0
3636
# with:

.github/workflows/dependency-review.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ jobs:
2222
egress-policy: audit
2323

2424
- name: 'Checkout Repository'
25-
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
25+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2626
- name: 'Dependency Review'
27-
uses: actions/dependency-review-action@a6993e2c61fd5dc440b409aa1d6904921c5e1894 # v4.3.5
27+
uses: actions/dependency-review-action@4081bf99e2866ebe428fc0477b69eb4fcda7220a # v4.4.0

.github/workflows/docs-verifier.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
egress-policy: audit
2020

2121
- name: Checkout the repository
22-
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
22+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2323

2424
- name: Validate
2525
uses: dotnet/docs-actions/actions/docs-verifier@5e8bcc78465d45a7544bba56509a1a69922b6a5a # main

.github/workflows/markdownlint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
with:
2727
egress-policy: audit
2828

29-
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
29+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3030
- uses: DavidAnson/markdownlint-cli2-action@b4c9feab76d8025d1e83c653fa3990936df0e6c8 # v16.0.0
3131
with:
3232
config: ".markdownlint-cli2.jsonc"

.github/workflows/scorecards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
egress-policy: audit
3737

3838
- name: "Checkout code"
39-
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
39+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4040
with:
4141
persist-credentials: false
4242

.github/workflows/snippets5000.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ jobs:
3636
egress-policy: audit
3737

3838
- name: Checkout repository
39-
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 #@v4.2.1
39+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #@v4.2.2
4040

4141
# Get the latest preview SDK (or sdk not installed by the runner)
4242
- name: Setup .NET
4343
if: ${{ env.DOTNET_DO_INSTALL == 'true' }}
44-
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee #@4.0.1
44+
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 #@4.1.0
4545
with:
4646
dotnet-version: ${{ env.DOTNET_VERSION }}
4747
dotnet-quality: ${{ env.DOTNET_QUALITY }}

.github/workflows/whats-new.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
with:
2828
egress-policy: audit
2929

30-
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
30+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3131

3232
- name: "Print manual run reason"
3333
if: ${{ github.event_name == 'workflow_dispatch' }}

docs/ai/how-to/snippets/semantic-kernel/semantic-kernel.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111

1212
<ItemGroup>
1313
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.3.2" />
14-
<PackageReference Include="Azure.Identity" Version="1.13.0" />
14+
<PackageReference Include="Azure.Identity" Version="1.13.1" />
1515
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
1616
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
1717
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.1" />
18-
<PackageReference Include="Microsoft.SemanticKernel" Version="1.24.1" />
18+
<PackageReference Include="Microsoft.SemanticKernel" Version="1.25.0" />
1919
<PackageReference Include="Microsoft.SemanticKernel.Connectors.AzureAISearch" Version="1.9.0-alpha" />
2020
<PackageReference Include="Microsoft.SemanticKernel.Connectors.Redis" Version="1.9.0-alpha" />
2121
<PackageReference Include="Microsoft.SemanticKernel.Plugins.Memory" Version="1.9.0-alpha" />

docs/ai/quickstarts/quickstart-local-ai.md

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@ Complete the following steps to create a .NET console app that will connect to y
5454
dotnet new console
5555
```
5656

57-
1. Add the Semantic Kernel SDK package to your app:
57+
1. Add the [Semantic Kernel SDK](https://www.nuget.org/packages/Microsoft.SemanticKernel) and the [Semantic Kernel Ollama Connector](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.Ollama/1.25.0-alpha) packages to your app:
5858

5959
```dotnetcli
6060
dotnet add package Microsoft.SemanticKernel
61+
dotnet add package Microsoft.SemanticKernel.Connectors.Ollama
6162
```
6263

6364
1. Open the new app in your editor of choice, such as Visual Studio Code.
@@ -72,45 +73,7 @@ The Semantic Kernel SDK provides many services and features to connect to AI mod
7273
7374
1. Open the _Program.cs_ file and replace the contents of the file with the following code:
7475
75-
```csharp
76-
using Microsoft.SemanticKernel;
77-
using Microsoft.SemanticKernel.ChatCompletion;
78-
79-
// Create a kernel with OpenAI chat completion
80-
#pragma warning disable SKEXP0010
81-
Kernel kernel = Kernel.CreateBuilder()
82-
.AddOpenAIChatCompletion(
83-
modelId: "phi3:mini",
84-
endpoint: new Uri("http://localhost:11434"),
85-
apiKey: "")
86-
.Build();
87-
88-
var aiChatService = kernel.GetRequiredService<IChatCompletionService>();
89-
var chatHistory = new ChatHistory();
90-
91-
while (true)
92-
{
93-
// Get user prompt and add to chat history
94-
Console.WriteLine("Your prompt:");
95-
var userPrompt = Console.ReadLine();
96-
chatHistory.Add(new ChatMessageContent(AuthorRole.User, userPrompt));
97-
98-
// Stream the AI response and add to chat history
99-
Console.WriteLine("AI Response:");
100-
var response = "";
101-
await foreach(var item in
102-
aiChatService.GetStreamingChatMessageContentsAsync(chatHistory))
103-
{
104-
Console.Write(item.Content);
105-
response += item.Content;
106-
}
107-
chatHistory.Add(new ChatMessageContent(AuthorRole.Assistant, response));
108-
Console.WriteLine();
109-
}
110-
```
111-
112-
> [!NOTE]
113-
> The `#pragma warning disable SKEXP0010` line is included due to the experimental state of some Semantic Kernel SDK features.
76+
:::code language="csharp" source="snippets/local-ai/program.cs" :::
11477
11578
The preceding code accomplishes the following tasks:
11679
- Creates a `Kernel` object and uses it to retrieve a chat completion service.

0 commit comments

Comments
 (0)