Share via


KernelPluginFactory.CreateFromObject(Object, String, ILoggerFactory) Method

Definition

Creates a plugin that wraps the specified target object.

public static Microsoft.SemanticKernel.KernelPlugin CreateFromObject (object target, string? pluginName = default, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory = default);
static member CreateFromObject : obj * string * Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.SemanticKernel.KernelPlugin
Public Shared Function CreateFromObject (target As Object, Optional pluginName As String = Nothing, Optional loggerFactory As ILoggerFactory = Nothing) As KernelPlugin

Parameters

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.

loggerFactory
ILoggerFactory

The ILoggerFactory to use for logging. If null, no logging will be performed.

Returns

A KernelPlugin containing KernelFunctions for all relevant members of target.

Remarks

Methods decorated with KernelFunctionAttribute will be included in the plugin. Attributed methods must all have different names; overloads are not supported.

Applies to