chore: import upstream snapshot with attribution
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 13:21:23 +08:00
commit b957a53def
5423 changed files with 863745 additions and 0 deletions
@@ -0,0 +1,36 @@
// Copyright (c) Microsoft. All rights reserved.
// ==========================================================================================================
// The easier way to instantiate the Semantic Kernel is to use KernelBuilder.
// You can access the builder using Kernel.CreateBuilder().
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Plugins.Core;
namespace KernelExamples;
public class BuildingKernel(ITestOutputHelper output) : BaseTest(output)
{
[Fact]
public void BuildKernelWithAzureChatCompletion()
{
// KernelBuilder provides a simple way to configure a Kernel. This constructs a kernel
// with logging and an Azure OpenAI chat completion service configured.
Kernel kernel1 = Kernel.CreateBuilder()
.AddAzureOpenAIChatCompletion(
deploymentName: TestConfiguration.AzureOpenAI.ChatDeploymentName,
endpoint: TestConfiguration.AzureOpenAI.Endpoint,
apiKey: TestConfiguration.AzureOpenAI.ApiKey,
modelId: TestConfiguration.AzureOpenAI.ChatModelId)
.Build();
}
[Fact]
public void BuildKernelWithPlugins()
{
// Plugins may also be configured via the corresponding Plugins property.
var builder = Kernel.CreateBuilder();
builder.Plugins.AddFromType<HttpPlugin>();
Kernel kernel3 = builder.Build();
}
}