KernelExtensions.CreatePluginFromObject(Kernel, Object, String) Method

Definition

Creates a plugin that wraps the specified target object.

public static Microsoft.SemanticKernel.KernelPlugin CreatePluginFromObject (this Microsoft.SemanticKernel.Kernel kernel, object target, string? pluginName = default);
static member CreatePluginFromObject : Microsoft.SemanticKernel.Kernel * obj * string -> Microsoft.SemanticKernel.KernelPlugin
<Extension()>
Public Function CreatePluginFromObject (kernel As Kernel, target As Object, Optional pluginName As String = Nothing) As KernelPlugin

Parameters

kernel
Kernel

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

target
Object

The instance of the class to be wrapped.

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 target.

Returns

A KernelPlugin containing KernelFunctions for all relevant members of target.

Remarks

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

Applies to