KernelExtensions.CreatePluginFromObject 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.
Overloads
CreatePluginFromObject(Kernel, Object, String) |
Creates a plugin that wraps the specified target object. |
CreatePluginFromObject<T>(Kernel, T, JsonSerializerOptions, String) |
Creates a plugin that wraps the specified target object. |
CreatePluginFromObject(Kernel, Object, String)
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
CreatePluginFromObject<T>(Kernel, T, JsonSerializerOptions, String)
Creates a plugin that wraps the specified target object.
public static Microsoft.SemanticKernel.KernelPlugin CreatePluginFromObject<T>(this Microsoft.SemanticKernel.Kernel kernel, T target, System.Text.Json.JsonSerializerOptions jsonSerializerOptions, string? pluginName = default);
static member CreatePluginFromObject : Microsoft.SemanticKernel.Kernel * 'T * System.Text.Json.JsonSerializerOptions * string -> Microsoft.SemanticKernel.KernelPlugin
<Extension()>
Public Function CreatePluginFromObject(Of T) (kernel As Kernel, target As T, jsonSerializerOptions As JsonSerializerOptions, Optional pluginName As String = Nothing) As KernelPlugin
Type Parameters
- T
Parameters
- kernel
- Kernel
The Kernel containing services, plugins, and other state for use throughout the operation.
- target
- T
The instance of the class to be wrapped.
- jsonSerializerOptions
- JsonSerializerOptions
The JsonSerializerOptions to use for serialization and deserialization of various aspects of the function.
- 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.