KernelExtensions.ImportPluginFromObject(Kernel, Object, String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a plugin that wraps the specified target object and imports it into the kernel
's plugin collection.
public static Microsoft.SemanticKernel.KernelPlugin ImportPluginFromObject (this Microsoft.SemanticKernel.Kernel kernel, object target, string? pluginName = default);
static member ImportPluginFromObject : Microsoft.SemanticKernel.Kernel * obj * string -> Microsoft.SemanticKernel.KernelPlugin
<Extension()>
Public Function ImportPluginFromObject (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.