Skip to content

Repository files navigation

Soenneker.SemanticKernel.Enums.KernelType

A source-generated string value type for classifying Semantic Kernel workloads.

Installation

dotnet add package Soenneker.SemanticKernel.Enums.KernelType

Values

  • KernelType.Chat
  • KernelType.Completion
  • KernelType.Image
  • KernelType.Embedding
  • KernelType.Audio

Each underlying string value matches its member name, such as "Chat" and "Embedding".

Usage

using Soenneker.SemanticKernel.Enums.KernelType;

KernelType type = KernelType.Chat;

if (type == KernelType.Chat)
{
    // Select chat-specific connector or execution behavior.
}

Parse untrusted input without throwing:

if (!KernelType.TryFromValue(input, out KernelType type))
{
    return Results.BadRequest("Unsupported kernel type.");
}

Known values can also be retrieved with FromValue, TryFromName, and FromName. Name and value lookups are ordinal and case-sensitive.

The generated JSON converter reads and writes the underlying string:

{
  "type": "Embedding"
}

Unknown JSON values fail deserialization. KernelType is descriptive metadata only; assigning a value does not register a Semantic Kernel connector or enforce which operations a kernel supports. The application or pool consuming it must select the corresponding implementation.

Releases

Sponsor this project

Packages

Used by

Contributors

Languages