Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/clean-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
egress-policy: audit

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

# Call clean repo
- name: Clean repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
with:
egress-policy: audit

- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# - name: Setup .NET
# uses: actions/setup-dotnet@4d4a70f4a5b2a5a5329f13be4ac933f2c9206ac0
# with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ jobs:
egress-policy: audit

- name: 'Checkout Repository'
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 'Dependency Review'
uses: actions/dependency-review-action@a6993e2c61fd5dc440b409aa1d6904921c5e1894 # v4.3.5
uses: actions/dependency-review-action@4081bf99e2866ebe428fc0477b69eb4fcda7220a # v4.4.0
2 changes: 1 addition & 1 deletion .github/workflows/docs-verifier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
egress-policy: audit

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

- name: Validate
uses: dotnet/docs-actions/actions/docs-verifier@5e8bcc78465d45a7544bba56509a1a69922b6a5a # main
2 changes: 1 addition & 1 deletion .github/workflows/markdownlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
egress-policy: audit

- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: DavidAnson/markdownlint-cli2-action@b4c9feab76d8025d1e83c653fa3990936df0e6c8 # v16.0.0
with:
config: ".markdownlint-cli2.jsonc"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
egress-policy: audit

- name: "Checkout code"
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/snippets5000.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ jobs:
egress-policy: audit

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

# Get the latest preview SDK (or sdk not installed by the runner)
- name: Setup .NET
if: ${{ env.DOTNET_DO_INSTALL == 'true' }}
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee #@4.0.1
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 #@4.1.0
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
dotnet-quality: ${{ env.DOTNET_QUALITY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/whats-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
with:
egress-policy: audit

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

- name: "Print manual run reason"
if: ${{ github.event_name == 'workflow_dispatch' }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

<ItemGroup>
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.3.2" />
<PackageReference Include="Azure.Identity" Version="1.13.0" />
<PackageReference Include="Azure.Identity" Version="1.13.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.1" />
<PackageReference Include="Microsoft.SemanticKernel" Version="1.24.1" />
<PackageReference Include="Microsoft.SemanticKernel" Version="1.25.0" />
<PackageReference Include="Microsoft.SemanticKernel.Connectors.AzureAISearch" Version="1.9.0-alpha" />
<PackageReference Include="Microsoft.SemanticKernel.Connectors.Redis" Version="1.9.0-alpha" />
<PackageReference Include="Microsoft.SemanticKernel.Plugins.Memory" Version="1.9.0-alpha" />
Expand Down
43 changes: 3 additions & 40 deletions docs/ai/quickstarts/quickstart-local-ai.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ Complete the following steps to create a .NET console app that will connect to y
dotnet new console
```

1. Add the Semantic Kernel SDK package to your app:
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:

```dotnetcli
dotnet add package Microsoft.SemanticKernel
dotnet add package Microsoft.SemanticKernel.Connectors.Ollama
```

1. Open the new app in your editor of choice, such as Visual Studio Code.
Expand All @@ -72,45 +73,7 @@ The Semantic Kernel SDK provides many services and features to connect to AI mod

1. Open the _Program.cs_ file and replace the contents of the file with the following code:

```csharp
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.ChatCompletion;

// Create a kernel with OpenAI chat completion
#pragma warning disable SKEXP0010
Kernel kernel = Kernel.CreateBuilder()
.AddOpenAIChatCompletion(
modelId: "phi3:mini",
endpoint: new Uri("http://localhost:11434"),
apiKey: "")
.Build();

var aiChatService = kernel.GetRequiredService<IChatCompletionService>();
var chatHistory = new ChatHistory();

while (true)
{
// Get user prompt and add to chat history
Console.WriteLine("Your prompt:");
var userPrompt = Console.ReadLine();
chatHistory.Add(new ChatMessageContent(AuthorRole.User, userPrompt));

// Stream the AI response and add to chat history
Console.WriteLine("AI Response:");
var response = "";
await foreach(var item in
aiChatService.GetStreamingChatMessageContentsAsync(chatHistory))
{
Console.Write(item.Content);
response += item.Content;
}
chatHistory.Add(new ChatMessageContent(AuthorRole.Assistant, response));
Console.WriteLine();
}
```

> [!NOTE]
> The `#pragma warning disable SKEXP0010` line is included due to the experimental state of some Semantic Kernel SDK features.
:::code language="csharp" source="snippets/local-ai/program.cs" :::

The preceding code accomplishes the following tasks:
- Creates a `Kernel` object and uses it to retrieve a chat completion service.
Expand Down
34 changes: 34 additions & 0 deletions docs/ai/quickstarts/snippets/local-ai/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.ChatCompletion;

// Create a kernel with OpenAI chat completion
// Warning due to the experimental state of some Semantic Kernel SDK features.
#pragma warning disable SKEXP0070
Kernel kernel = Kernel.CreateBuilder()
.AddOllamaChatCompletion(
modelId: "phi3:mini",
endpoint: new Uri("http://localhost:11434"))
.Build();

var aiChatService = kernel.GetRequiredService<IChatCompletionService>();
var chatHistory = new ChatHistory();

while (true)
{
// Get user prompt and add to chat history
Console.WriteLine("Your prompt:");
var userPrompt = Console.ReadLine();
chatHistory.Add(new ChatMessageContent(AuthorRole.User, userPrompt));

// Stream the AI response and add to chat history
Console.WriteLine("AI Response:");
var response = "";
await foreach(var item in
aiChatService.GetStreamingChatMessageContentsAsync(chatHistory))
{
Console.Write(item.Content);
response += item.Content;
}
chatHistory.Add(new ChatMessageContent(AuthorRole.Assistant, response));
Console.WriteLine();
}
15 changes: 15 additions & 0 deletions docs/ai/quickstarts/snippets/local-ai/ollama.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SemanticKernel" Version="1.25.0" />
<PackageReference Include="Microsoft.SemanticKernel.Connectors.Ollama" Version="1.22.0-alpha" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion docs/ai/tutorials/snippets/llm-eval/llm-eval.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.1" />
<PackageReference Include="Microsoft.SemanticKernel" Version="1.24.1" />
<PackageReference Include="Microsoft.SemanticKernel" Version="1.25.0" />
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions docs/azure/TOC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
href: ./migration/appcat/install.md
- name: Visual Studio walkthrough
href: ./migration/appcat/visual-studio.md
- name: Visual Studio Copilot assessment
href: ./migration/appcat/visual-studio-copilot.md
- name: .NET CLI walkthrough
href: ./migration/appcat/dotnet-cli.md
- name: Interpret the results
Expand Down
Loading
Loading