Partager via


KernelExtensions.CreatePluginFromType<T>(Kernel, String) Method

Definition

Creates a plugin that wraps a new instance of the specified type T.

public static Microsoft.SemanticKernel.KernelPlugin CreatePluginFromType<T> (this Microsoft.SemanticKernel.Kernel kernel, string? pluginName = default);
static member CreatePluginFromType : Microsoft.SemanticKernel.Kernel * string -> Microsoft.SemanticKernel.KernelPlugin
<Extension()>
Public Function CreatePluginFromType(Of T) (kernel As Kernel, Optional pluginName As String = Nothing) As KernelPlugin

Type Parameters

T

Specifies the type of the object to wrap.

Parameters

kernel
Kernel

The Kernel containing services, plugins, and other state for use throughout the operation.

pluginName
String

Name of the plugin for function collection and prompt templates. If the value is null, a plugin name is derived from the type of the T.

Returns

A KernelPlugin containing KernelFunctions for all relevant members of T.

Remarks

Methods that have the KernelFunctionAttribute attribute will be included in the plugin. See KernelFunctionAttribute attribute for details.

Applies to