Share via


KernelExtensions.AddFromFunctions Method

Definition

Overloads

AddFromFunctions(IKernelBuilderPlugins, String, IEnumerable<KernelFunction>)

Creates a plugin that wraps the specified target object and adds it into the plugin collection.

AddFromFunctions(ICollection<KernelPlugin>, String, IEnumerable<KernelFunction>)

Creates a plugin that contains the specified functions and adds it into the plugin collection.

AddFromFunctions(IKernelBuilderPlugins, String, String, IEnumerable<KernelFunction>)

Creates a plugin that wraps the specified target object and adds it into the plugin collection.

AddFromFunctions(ICollection<KernelPlugin>, String, String, IEnumerable<KernelFunction>)

Creates a plugin that contains the specified functions and adds it into the plugin collection.

AddFromFunctions(IKernelBuilderPlugins, String, IEnumerable<KernelFunction>)

Creates a plugin that wraps the specified target object and adds it into the plugin collection.

public static Microsoft.SemanticKernel.IKernelBuilderPlugins AddFromFunctions (this Microsoft.SemanticKernel.IKernelBuilderPlugins plugins, string pluginName, System.Collections.Generic.IEnumerable<Microsoft.SemanticKernel.KernelFunction>? functions);
static member AddFromFunctions : Microsoft.SemanticKernel.IKernelBuilderPlugins * string * seq<Microsoft.SemanticKernel.KernelFunction> -> Microsoft.SemanticKernel.IKernelBuilderPlugins
<Extension()>
Public Function AddFromFunctions (plugins As IKernelBuilderPlugins, pluginName As String, functions As IEnumerable(Of KernelFunction)) As IKernelBuilderPlugins

Parameters

plugins
IKernelBuilderPlugins

The plugin collection to which the new plugin should be added.

pluginName
String

The name for the plugin.

functions
IEnumerable<KernelFunction>

The initial functions to be available as part of the plugin.

Returns

The same instance as plugins.

Exceptions

functions contains two functions with the same name.

functions contains a null function.

Applies to

AddFromFunctions(ICollection<KernelPlugin>, String, IEnumerable<KernelFunction>)

Creates a plugin that contains the specified functions and adds it into the plugin collection.

public static Microsoft.SemanticKernel.KernelPlugin AddFromFunctions (this System.Collections.Generic.ICollection<Microsoft.SemanticKernel.KernelPlugin> plugins, string pluginName, System.Collections.Generic.IEnumerable<Microsoft.SemanticKernel.KernelFunction>? functions);
static member AddFromFunctions : System.Collections.Generic.ICollection<Microsoft.SemanticKernel.KernelPlugin> * string * seq<Microsoft.SemanticKernel.KernelFunction> -> Microsoft.SemanticKernel.KernelPlugin
<Extension()>
Public Function AddFromFunctions (plugins As ICollection(Of KernelPlugin), pluginName As String, functions As IEnumerable(Of KernelFunction)) As KernelPlugin

Parameters

plugins
ICollection<KernelPlugin>

The plugin collection to which the new plugin should be added.

pluginName
String

The name for the plugin.

functions
IEnumerable<KernelFunction>

The initial functions to be available as part of the plugin.

Returns

A KernelPlugin containing the functions provided in functions.

Exceptions

functions contains two functions with the same name.

functions contains a null function.

Applies to

AddFromFunctions(IKernelBuilderPlugins, String, String, IEnumerable<KernelFunction>)

Creates a plugin that wraps the specified target object and adds it into the plugin collection.

public static Microsoft.SemanticKernel.IKernelBuilderPlugins AddFromFunctions (this Microsoft.SemanticKernel.IKernelBuilderPlugins plugins, string pluginName, string? description = default, System.Collections.Generic.IEnumerable<Microsoft.SemanticKernel.KernelFunction>? functions = default);
static member AddFromFunctions : Microsoft.SemanticKernel.IKernelBuilderPlugins * string * string * seq<Microsoft.SemanticKernel.KernelFunction> -> Microsoft.SemanticKernel.IKernelBuilderPlugins
<Extension()>
Public Function AddFromFunctions (plugins As IKernelBuilderPlugins, pluginName As String, Optional description As String = Nothing, Optional functions As IEnumerable(Of KernelFunction) = Nothing) As IKernelBuilderPlugins

Parameters

plugins
IKernelBuilderPlugins

The plugin collection to which the new plugin should be added.

pluginName
String

The name for the plugin.

description
String

A description of the plugin.

functions
IEnumerable<KernelFunction>

The initial functions to be available as part of the plugin.

Returns

The same instance as plugins.

Exceptions

functions contains two functions with the same name.

functions contains a null function.

Applies to

AddFromFunctions(ICollection<KernelPlugin>, String, String, IEnumerable<KernelFunction>)

Creates a plugin that contains the specified functions and adds it into the plugin collection.

public static Microsoft.SemanticKernel.KernelPlugin AddFromFunctions (this System.Collections.Generic.ICollection<Microsoft.SemanticKernel.KernelPlugin> plugins, string pluginName, string? description = default, System.Collections.Generic.IEnumerable<Microsoft.SemanticKernel.KernelFunction>? functions = default);
static member AddFromFunctions : System.Collections.Generic.ICollection<Microsoft.SemanticKernel.KernelPlugin> * string * string * seq<Microsoft.SemanticKernel.KernelFunction> -> Microsoft.SemanticKernel.KernelPlugin
<Extension()>
Public Function AddFromFunctions (plugins As ICollection(Of KernelPlugin), pluginName As String, Optional description As String = Nothing, Optional functions As IEnumerable(Of KernelFunction) = Nothing) As KernelPlugin

Parameters

plugins
ICollection<KernelPlugin>

The plugin collection to which the new plugin should be added.

pluginName
String

The name for the plugin.

description
String

A description of the plugin.

functions
IEnumerable<KernelFunction>

The initial functions to be available as part of the plugin.

Returns

A KernelPlugin containing the functions provided in functions.

Exceptions

functions contains two functions with the same name.

functions contains a null function.

Applies to