Soenneker.SemanticKernel.Dtos.Options 4.0.108

Prefix Reserved
dotnet add package Soenneker.SemanticKernel.Dtos.Options --version 4.0.108
                    
NuGet\Install-Package Soenneker.SemanticKernel.Dtos.Options -Version 4.0.108
                    
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="4.0.108" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.SemanticKernel.Dtos.Options" Version="4.0.108" />
                    
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 4.0.108
                    
#r "nuget: Soenneker.SemanticKernel.Dtos.Options, 4.0.108"
                    
#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@4.0.108
                    
#: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=4.0.108
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.SemanticKernel.Dtos.Options&version=4.0.108
                    
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 net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
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
4.0.108 906 9/4/2026
4.0.107 505 9/3/2026
4.0.106 583 8/31/2026
4.0.105 159 8/30/2026
4.0.104 165 8/30/2026
4.0.103 475 8/30/2026
4.0.102 293 8/29/2026
4.0.101 85 8/29/2026
4.0.100 921 8/21/2026
4.0.99 373 8/18/2026
4.0.98 359 8/18/2026
4.0.97 1,146 8/7/2026
4.0.96 102 8/7/2026
4.0.95 1,119 7/28/2026
4.0.94 210 7/28/2026
4.0.93 95 7/28/2026
4.0.92 1,769 7/17/2026
4.0.91 251 7/16/2026
4.0.90 433 7/16/2026
4.0.89 940 7/7/2026
Loading failed

Updated Soenneker.SemanticKernel.Enums.KernelType to 4.0.55