Soenneker.SemanticKernel.Dtos.Options 11.0.143

Prefix Reserved
dotnet add package Soenneker.SemanticKernel.Dtos.Options --version 11.0.143
                    
NuGet\Install-Package Soenneker.SemanticKernel.Dtos.Options -Version 11.0.143
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.SemanticKernel.Dtos.Options" Version="11.0.143" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.SemanticKernel.Dtos.Options" Version="11.0.143" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.SemanticKernel.Dtos.Options" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.SemanticKernel.Dtos.Options --version 11.0.143
                    
#r "nuget: Soenneker.SemanticKernel.Dtos.Options, 11.0.143"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.SemanticKernel.Dtos.Options@11.0.143
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.SemanticKernel.Dtos.Options&version=11.0.143
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.SemanticKernel.Dtos.Options&version=11.0.143
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.SemanticKernel.Dtos.Options

A shared configuration object for constructing Semantic Kernel instances and carrying model policy metadata.

Installation

dotnet add package Soenneker.SemanticKernel.Dtos.Options

Usage

using Microsoft.SemanticKernel;
using Soenneker.SemanticKernel.Dtos.Options;
using Soenneker.SemanticKernel.Enums.KernelType;

var options = new SemanticKernelOptions
{
    ModelId = "primary-chat-model",
    Endpoint = "https://models.example.com",
    ApiKey = configuration["Models:ApiKey"],
    Type = KernelType.Chat,
    RequestsPerMinute = 60,
    TokensPerDay = 100_000,
    MaxTokens = 2_000,
    Temperature = 0.2,
    KernelFactory = static (options, cancellationToken) =>
    {
        IKernelBuilder builder = Kernel.CreateBuilder();

        // Add the connector for options.ModelId, Endpoint, and ApiKey.

        return ValueTask.FromResult(builder);
    },
    ConfigureBuilder = builder =>
    {
        // Add pre-build services or plugins.
    },
    ConfigureKernel = async (kernel, cancellationToken) =>
    {
        // Perform asynchronous post-build setup.
        await ValueTask.CompletedTask;
    }
};

What applies the values

SemanticKernelOptions only stores values. It does not create a connector, enforce request/token limits, or apply MaxTokens and Temperature to execution settings by itself. The cache, pool, connector factory, or request pipeline consuming the options must implement those behaviors.

The three delegates define the construction hooks used by Soenneker Semantic Kernel caches and pools:

  • KernelFactory creates an IKernelBuilder and receives the options plus cancellation token.
  • ConfigureBuilder runs synchronously before the builder is built.
  • ConfigureKernel runs asynchronously after the Kernel has been built.

When KernelFactory is absent, consumers may create an empty default builder. ModelId, Endpoint, and ApiKey are therefore not automatically meaningful unless the selected consumer or connector reads them.

Serialization

The scalar configuration properties use explicit camel-case JSON names. KernelFactory, ConfigureBuilder, and ConfigureKernel are excluded from JSON because delegates cannot be represented as portable configuration.

ApiKey is included in JSON serialization. Do not serialize this object into logs, client responses, telemetry, or unprotected storage. Prefer resolving secrets from a protected configuration provider at the point where the options are built.

The DTO does not validate ranges or required combinations. Validate provider-specific requirements—such as a positive limit, supported temperature range, absolute endpoint, or required API key—before using the options.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Soenneker.SemanticKernel.Dtos.Options:

Package Downloads
Soenneker.SemanticKernel.Cache

Providing async thread-safe singleton Semantic Kernel instances

Soenneker.SemanticKernel.Cache.Options

Providing async thread-safe singleton Semantic Kernel Options instances

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.143 0 11/7/2026
11.0.142 538 10/27/2026
11.0.141 104 10/27/2026
11.0.140 357 10/26/2026
11.0.139 173 10/26/2026
11.0.138 261 10/26/2026
11.0.137 184 10/26/2026
11.0.136 134 10/26/2026
4.0.135 512 10/15/2026
4.0.134 149 10/14/2026
4.0.133 133 10/14/2026
4.0.131 181 10/14/2026
4.0.130 199 10/14/2026
4.0.124 253 10/13/2026
4.0.123 120 10/13/2026
4.0.122 210 10/12/2026
4.0.120 763 10/11/2026
4.0.119 606 10/6/2026
4.0.118 476 9/30/2026
4.0.117 769 9/25/2026
Loading failed

Update dependency Microsoft.SemanticKernel.Abstractions to 1.82.0 (#556)