Soenneker.SemanticKernel.Dtos.Options 11.0.146

Prefix Reserved
dotnet add package Soenneker.SemanticKernel.Dtos.Options --version 11.0.146
                    
NuGet\Install-Package Soenneker.SemanticKernel.Dtos.Options -Version 11.0.146
                    
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.146" />
                    
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.146" />
                    
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.146
                    
#r "nuget: Soenneker.SemanticKernel.Dtos.Options, 11.0.146"
                    
#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.146
                    
#: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.146
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.SemanticKernel.Dtos.Options&version=11.0.146
                    
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.146 96 11/14/2026
11.0.145 233 11/11/2026
11.0.144 210 11/11/2026
11.0.143 437 11/7/2026
11.0.142 729 10/27/2026
11.0.141 110 10/27/2026
11.0.140 361 10/26/2026
11.0.139 179 10/26/2026
11.0.138 268 10/26/2026
11.0.137 191 10/26/2026
11.0.136 138 10/26/2026
4.0.135 519 10/15/2026
4.0.134 157 10/14/2026
4.0.133 138 10/14/2026
4.0.131 184 10/14/2026
4.0.130 202 10/14/2026
4.0.124 258 10/13/2026
4.0.123 124 10/13/2026
4.0.122 215 10/12/2026
4.0.120 768 10/11/2026
Loading failed

Update dependency Soenneker.SemanticKernel.Enums.KernelType to 11.0.85 (#563)